Continue, Stop or Detour?
We let a small language model make the driving decisions in the CARLA simulator, ran a few lines of rules on the same road scenarios, and compared them over 40 runs
A language model can read a short description of a traffic scene and answer with a word. Does that make it a driver? We tried the smallest version of the question we could build in a simulator: once a second, something chooses continue, stop or detour, and an ordinary program does the steering and braking. We ran it twice over the same scenarios, once with a few lines of rules and once with a small language model.
- Nothing crashed. Neither policy had a collision in its 20 runs, or ran the light in its 5 red-light runs.
- The rules finished every scenario that could be finished (15 of 15). The model finished 10 of those 15.
- The model never chose to detour. In the blocked-lane scenario the other lane was reported as free at all 300 of its decisions there. It drove closer, braked and stayed put.
- At red lights it never set off. Standing at its start, about 40 to 44 m of road before the line, it answered
stopuntil green, although its instructions said to drive up to the line. - Every reply was usable, but slow. All 922 replies were valid and on time. The median took 2.4 seconds, and the simulator waited for each one.
This is a simulator result for one small model and one prompt. It says nothing about how any car drives on a real road.
Who does what
The point of the setup is that you can tell which part is responsible for what.
| Part | What it does |
|---|---|
| Simulator | CARLA 1.0, map Town10HD_Opt: the road, the cars, the traffic light, the physics |
| Observer | A program that reads the true state from the simulator and sends six numbers or flags |
| Policy | Chooses continue, stop or detour once per simulated second. This is the only part that differs between the two sides |
| Guard | Turns anything doubtful (an invalid reply, a timeout, a reply older than 5 s, a detour that is not available) into stop |
| Controller | A few lines of code that follow the lane, hold about 20 km/h, brake on stop and change lane on detour |
The policy never sees a camera image. It gets exactly this, in JSON:
{"speed_kmh": 18.8,
"traffic_light": {"state": "none", "stop_line_m": -1},
"obstacle_ahead_m": 15.7,
"detour_available": true,
"route_remaining_m": 84}So perception, usually the hard part of driving, is given away for free, and so is the judgement of whether the next lane is clear.
The two policies
The rule baseline:
- stop if the light is red or yellow and the line is 12 m away or less;
- if a parked car is 25 m ahead or closer, detour when the other lane is free, otherwise stop at 14 m;
- otherwise continue.
We wrote these thresholds knowing the scenarios, so read the baseline as “what a few obvious rules achieve here”, not as a strong self-driving system.
The model is Qwen3.5-4B in Unsloth’s GGUF build (Q8_0), served by Ollama with temperature 0, thinking turned off and the reply restricted to the three actions. Its full instructions were:
You choose the high-level action of a car in a driving simulator. A separate controller steers and brakes.
Actions: 'continue' drives on in the current route; 'stop' brakes to a standstill and holds; 'detour' moves to the adjacent lane to pass an obstacle, and is allowed only when detour_available is true.
Obey traffic lights: do not cross the stop line while the light is red or yellow, but drive up to it rather than stopping far away. Never hit an obstacle. Do not stop without a reason.
The car needs about 8 metres to stop from its cruising speed.
Answer with JSON only: {"action": "continue" | "stop" | "detour"}
The prompt was written before the first run and not changed afterwards. It does not say how often the model is asked, and the logs later showed that its stopping distance is wrong. Both matter below.
The scenarios
Each episode lasts at most 60 simulated seconds on a route of about 110 m. Each policy ran four scenarios with five seeds each; a seed fixes the start point, and the same seed gives both policies the same one.
| Scenario | Set-up | A good run |
|---|---|---|
| Open road | Nothing in the way | Reaches the end |
| Red light | Car starts standing; the light is red and turns green after a random 14 to 22 s (16.4 to 21.6 s in our runs) | Waits near the line, then reaches the end |
| Blocked lane | A parked car 36 to 44 m ahead, next lane free | Passes it and reaches the end |
| Every lane blocked | Parked cars ahead in its lane and in each lane beside it going the same way | Stops and stays stopped |
Results
| Scenario | Rules: reached the end | Model: reached the end | Time, rules | Time, model |
|---|---|---|---|---|
| Open road | 5 of 5 | 5 of 5 | 21.2 to 22.1 s | 21.2 to 22.1 s |
| Red light | 5 of 5 | 5 of 5 | 31.4 to 36.5 s | 38.4 to 43.5 s |
| Blocked lane | 5 of 5 | 0 of 5 | 23.3 to 24.4 s | not finished |
| Every lane blocked | 0 of 5 (correct) | 0 of 5 (correct) | not finished | not finished |
Collisions: 0 for both. Red-light violations: 0 for both. Replies rejected by the guard: 0 for both.
The red-light distances are measured straight ahead of the car, which reads short where the road bends. That error is in our observer program, so both policies were told the same wrong figure: in red-light run 3 the line showed as 31.5 m away at the start, while the road distance was about 40 m.
Red light: legal, and not what was asked
In all five runs the model’s first decision, with the car still standing at the start, was stop. It repeated that every second until the light turned green, then drove to the end. No rule was broken, but the car waited far back from the line and arrived later. A score that only counted violations would have called this perfect.
Because it never set off, we learned nothing about how the model approaches or stops at a light, and it could not have crossed the line on red.
Both pictures are replays of the recorded runs. The rules picture matches the position logged at 20 s. The model’s car stood still for the whole wait, so its matching position does not confirm which second the picture shows. The replay log records one vehicle in each frame and no obstacle ahead; parked-looking objects in the background are not additional test traffic. We have no usable pictures of the blocked-lane runs; the table and logs are the record.
Blocked lane: it saw the exit and did not take it
Here is the model’s blocked-lane run 1:
| Time | Speed | Parked car ahead | Other lane free | Model chose |
|---|---|---|---|---|
| 4 s | 18.1 km/h | 26.0 m | yes | continue |
| 5 s | 18.6 km/h | 20.9 m | yes | continue |
| 6 s | 18.8 km/h | 15.7 m | yes | continue |
| 7 s | 18.9 km/h | 10.5 m | yes | continue |
| 8 s | 19.0 km/h | 5.2 m | yes | stop |
| 9 s to the end | about 0 | 2.6 m | yes | stop |
In this run the rules changed lane at 20.9 m. The model drove on, braked first at 5.2 m, and then answered stop until time ran out. All five runs followed this pattern, braking first between 8.4 and 4.4 m. We did not test whether a lane change begun that close to the parked car would have worked.
When every lane was blocked, stopping was right and both did. The model stopped 1.3 to 3.9 m from the car, the rules 7.1 to 11.4 m.
Our prompt is a likely reason for where it braked. It said the car needs about 8 m to stop. The logs show the car actually needs about 2.5 m, so we gave the model a figure about three times too long. In all ten runs with a parked car, the model answered continue at every distance of 8.9 m or more and stop at the first one of 8.4 m or less, which is what following our 8 m would look like. The prompt also did not say that the next question comes a full second later, nor when a detour should begin, while the rules had a 25 m threshold built in. We did not test other prompts, so this is a pattern in the logs, not a proven cause. We do not know why the model never chose a detour.
Latency: the simulator was patient
| Median | 95th percentile | Slowest | |
|---|---|---|---|
| Model reply (922 decisions) | 2.38 s | 3.20 s | 3.68 s |
| Rules | under 0.001 s | under 0.001 s | under 0.001 s |
CARLA ran in synchronous mode: the world froze while the model thought. In real time, a car at 19 km/h covers about 13 m in 2.4 s, and a once-a-second decision loop could not be kept at all. The blocked-lane results would then be a different and probably worse experiment. The machine was a home server whose 8 GB graphics card was shared with the simulator. The recorded Ollama status reported a 60% CPU / 40% GPU processor split for the model. Faster hardware would change these times, but we did not measure by how much.
What this does not show
- Nothing about real roads. Perfect positions and light states, no other moving traffic, no pedestrians, one town, good weather, one low speed.
- Little about language models in general. One 4-billion-parameter model, one quantization, one prompt, one serving program.
- Fewer than 40 independent trials. Some seeds drew the same start point. The blocked-lane scenario had only three different starts, and with temperature 0 seeds 2, 3 and 4 of the model produced identical drives.
- Safety is only partly measured. We counted collisions and crossing a red line. Neither counter ever fired, and we did no run designed to make it fire. We did not measure lane departures, comfort or harsh braking.
- No invalid replies, by construction as much as by merit. The reply format was restricted to the three actions. The guard rejected nothing in these runs; only the unit tests exercised rejection behavior.
- Our controller, not CARLA’s. A simple one written for this test steered and braked.
Try it yourself
You need a machine that can run CARLA 1.0 (we used Linux with an 8 GB NVIDIA card, about 10 GB of free memory and Docker), and an Ollama server with the model. The report folder has the two policies, the scenario program, the launch script, the log of every decision, and the program that rebuilds the figure and tables from those logs. You can check the recorded results without rerunning CARLA. The simulator launchers are adapted from the originals and use image and model tags rather than immutable digests, so a new run is not an exact recreation. The policy checks run without a simulator:
cd setup && python3 -m unittest test_policy
python3 analyze.py # the tables, from ../resultsGood next experiments, each run as a new, separately labelled test: give the model the right stopping distance and tell it how often it is asked; measure distance along the road; give it its last few observations; try a larger model; or let the world keep moving while the model thinks.
CARLA-Air, the drone-and-car simulator we ran earlier, was outside this test and is a natural follow-up.
Sources
- CARLA, version 1.0, run on 28 November 2026 from the image
carlasim/carla:1.0. - Qwen3.5-4B GGUF by Unsloth, file
Q8_0, served by Ollama 0.40.18. - Every number on this page comes from our own logs, published in the report folder.

