Part 6 of 9 in Training Metis. Previous: Measure the Kernel Before the Idea · Next: The Runaway Ended With More Reading, Not Sleep
Row 42 of our tool test (a "board vs reality" prompt) made Metis emit 223 brain_ask calls in a single message. Our worst case in a separate sample was 280. The model's weights had learned the format. They had not learned to stop.
Metis is the 72.6-million-weight model we train at home to call four tools: calc, brain_ask, web_fetch and run_js. This part is about its worst failure, the runaway loop, and a second failure the same week that was not the model's at all.
The tool test: 56 prompts, one right tool each
The tool test, which we call the toolgate, gives the model 56 prompts. Each prompt expects one particular tool call. The 400M round scored 55 of 56. The x4096 model of part 4 scored 50, with 19 of 20 brain_ask prompts, 26 of 30 run_js and 5 of 6 web_fetch. Row 42 was the new problem. The test harness itself aborted at that row at first. We fixed it so a failed turn counts as a failed row, so a loop is now one failed row and not a crashed run.
The loop needs the grammar and the chat route
We reproduced it on the path a user meets: the llama-server chat route, the call grammar on, 32-bit weights on the GPU. A grammar here is a constraint that only lets the model emit well-formed tool-call text. On that path 3 of 56 first messages hit the call cap (rows 12, 42 and 52), and so did 34 of 266 messages on our development split. Raw completion without the chat route did not reproduce row 42.
Here is the loop. The model writes "lookup, then a lone ". Healthy rows close an argument with "}} (2,166 times in our sample) or "}. After the lone quote, the grammar forbids the next thing the model wishes to write and offers only }} or ,. Boxed into those two options, it produced 166 to 222 parsed calls. Turning on parallel_tool_calls: false did not stop it. It turned the loop into whitespace up to the cap.
In a separate sample of 11,104 episodes that the model wrote for itself, 343 of the 378 runaways, defined as more than 8 calls in one message, were arithmetic prompts. For arithmetic, Metis called brain_ask where calc was right, and only 65 of 5,696 such episodes passed our checker.
Twenty arms of surgery, none worked
We tried to fix it with surgery. We built 20 arms in 6 families, using 27.4 GPU-minutes. Each one targeted loop behaviour directly:
- ablating the top neurons of the loop state
- scaling a gain
- a rank-1 edit on the loop detector neuron
- ablating each of 80 attention heads, one at a time
- DRY and repeat penalty, which are sampling rules, not weight edits
- steering with a direction vector at layer 3
None fixed it. The winner of the 80 head ablations was the same head as the random-control head, so it showed nothing. A random vector also broke 24 of 34 loops, which means breaking loops is easy and proves nothing. The nearest arm, steering at layer 3, cut the loop count but had a keep score of only 0.513.
We also built a probe on the loop state. On rows it had never seen it reached an AUROC of 0.993, where 1.0 is a perfect separation and 0.5 is a coin flip. It reads the state. It does not drive it: ablating its own top neurons did nothing. We call the loops knife-edge attractors.
A different test scored 0 of 56, and the model was fine
While the loop was under study, our own serving engine scored 0 of 56 on the same test. The server saw 609 prompt tokens for a request that our tokenizer, and llama.cpp, rendered as 84. The extra tokens were not in the template. tools/baro serve had a default, BARO_NEURONS=1, that appends memory notes to every user turn. It was the second time we hit that same trap. The harness now sends neurons: false with each request, and we wrote a rule for it.
After the fix, the prompt bytes and ids were equal across three engines: llama-server, our own serve and the Android app on two phones. That covered 56 test prompts, 8 app prompts and 55 second-turn prompts.
The toolgate still failed its parity bar. Our engine agreed with llama.cpp's calls on 52 of 56 prompts, against a bar of 54. The four misses were:
- 2 decode divergences on identical prompt ids. We did not measure the cause. A candidate is that our engine keeps activations in 32 bits where llama.cpp's quantized path does not.
- 1 parser difference. When a call is left unclosed, llama.cpp rewrites it into empty arguments and ours drops it.
- 1 loop row.
Two more traps cost time. llama-server clamps a slot to the length the model was trained on, 4,096 here, whatever -c says. --override-kv qwen3.context_length=int:32768 lifts it, and it changed no call. And after 17:40 some of our toolgate runs on the shared default port 8795 may have scored another job's server. We reran ours on port 8861, and the rerun matched the invalid run on 55 of 56 rows.
Where the lever sits
The surgery ended with one conclusion: the next lever is outside the weights. A cap on calls per message, a stop on over-long argument values, and training data in which each prompt has a single call were the three we named. Our notes record no measurement of the cap or the stop. The fix we measured came from training data, which is part 7: continued pretraining on 1.1 billion new tokens, with app tool rows at 10 percent of each batch, took the runaway count from 223 to 1.
That is not a contradiction. Surgery tried to switch off one behaviour in a trained model. Training changed what the model prefers everywhere. This is our reading, not a measured mechanism: the loop is a property of the model on one path, with one grammar, and not a part we could cut out.
What this does not show
We have one model and one 56-prompt test. 3 of 56 first messages looped, and our development split had 34 of 266. We can say that no edit of those 20 worked, not that none exists. And we do not know why the four parity misses happened. The check anyone can run: send row 42 through raw completion and through the chat route with the grammar on. For row 42 we saw the loop only on the second. A loop on the first would make our account of the cause wrong.

Comments
No comments yet.
Log in to comment.