Richard Jeevash

Working paperNot peer-reviewed10 November 2026

Counting by dilution and a width stored at the newline: a partial account of line-breaking in Pythia-410M

In short Pythia-410M counts how full a line is by how thin one head’s attention to the line start gets, and reads the last line’s length back from the newline. A partial account: under the stricter test, even the fuller circuit’s fidelity to the model’s decision is only 0.22.

Read the paper (PDF, 25 pages)CodeCode and data archiveCite

The question

When text is wrapped at a fixed width, a model that predicts the line breaks has to track how many characters the current line holds, infer the width from earlier lines, and compare the two before every word. It never sees characters, only tokens of varying length, and nobody tells it the width.

The only causal account we know of came from one proprietary model, Claude 3.5 Haiku (Gurnee et al., 2025). In open models the character position was known to be decodable, but to our knowledge nobody had shown which components carry the count, how the width enters, or where the two are compared.

The parts we can name

the river bends east past the old mill and previous line: its length is the width the model has to infer counters · L5H6 + three heads readers · L6H2, L8H15, L17H1 ⏎ the bridge that crosses it was ⏎ or keep going? line-start newline holds the last line’s length, written by the same counting heads decision token L5H7 removes most of the per-token bias (some is left on short lines) the decision · layers 6 to 23 L17H1 and MLPs 14, 16, 18 push the newline up; two neurons in MLPs 21 and 23 hold it back the river bends east past the mill previous line: its length is the width to infer counters · L5H6 + three heads readers · L6H2, L8H15, L17H1 ⏎ the bridge that crosses it was ⏎ or keep going? line-start newline holds the last line’s length, written by the same counting heads decision token L5H7 removes most of the per-token bias (some is left on short lines) the decision · layers 6 to 23 L17H1 and MLPs 14, 16, 18 push the newline up; two neurons in MLPs 21 and 23 hold it back

The parts the paper names and tests. Heads are named by layer and index: L5H6 is head 6 of layer 5. They are not a complete circuit (see the limits below).

  • Counting by dilution. Head L5H6 puts most of its attention on the newline that started the line. As more tokens arrive, that share thins out, so the share itself tracks how full the line is. Three other heads count with it, and by layer 5 the count is written into the word’s state.
Fig. 01 Counting heads fade, reader heads arrive: attention to the line start as a line fills
0.000.250.500.751.00604530150Characters left before the edgeAttention to the line start (share of the head’s maximum)Counter L5H6Reader L8H150.000.250.500.751.00604530150Characters left before the edgeAttention to the line start (share of the head’s maximum)Counter L5H6Reader L8H15

From the word that might end the line, the counting head L5H6 gives the line start most of its attention early on, and less as the line fills. The reader head L8H15 barely looks there until the edge is close. Drag along the line to follow both.

Width 60, held-out text (round 4). Each head’s attention is scaled to its own maximum. The example line is only there to show position.

The numbers
Counter L5H6Reader L8H15
Characters left: 00.350.93
Characters left: 10.381.00
Characters left: 20.390.93
Characters left: 30.440.93
Characters left: 40.460.91
Characters left: 50.470.90
Characters left: 60.510.88
Characters left: 70.540.65
Characters left: 80.570.68
Characters left: 90.610.55
Characters left: 100.640.38
Characters left: 110.670.37
Characters left: 120.690.34
Characters left: 130.720.29
Characters left: 140.730.23
Characters left: 150.760.16
Characters left: 160.770.13
Characters left: 170.790.14
Characters left: 180.800.09
Characters left: 190.820.10
Characters left: 200.840.11
Characters left: 210.850.06
Characters left: 220.870.07
Characters left: 230.890.06
Characters left: 240.890.03
Characters left: 250.890.05
Characters left: 260.900.05
Characters left: 270.920.04
Characters left: 280.930.02
Characters left: 290.930.03
Characters left: 300.940.03
Characters left: 310.950.02
Characters left: 320.950.02
Characters left: 330.950.02
Characters left: 340.960.02
Characters left: 350.970.02
Characters left: 360.970.01
Characters left: 370.970.02
Characters left: 380.980.02
Characters left: 390.980.01
Characters left: 400.980.01
Characters left: 410.980.01
Characters left: 420.990.01
Characters left: 430.990.01
Characters left: 441.000.01
Characters left: 451.000.01
Characters left: 461.000.01
Characters left: 470.990.02
Characters left: 481.000.01
Characters left: 491.000.02
Characters left: 501.000.01
Characters left: 511.000.01
Characters left: 521.000.01
Characters left: 530.990.01
Characters left: 540.990.01
Characters left: 550.990.01
Characters left: 560.990.01
Characters left: 571.000.01
Characters left: 580.980.00
  • Correcting for tokens. A dilution count counts tokens as much as characters, so lines of many short tokens look fuller than they are. Head L5H7, with L4H14 as a weaker second, removes most of that bias, but not all of it on short lines.
  • Storing the width. At the newline, the same counting heads record how long the finished line was. That is the model’s estimate of the width.
  • Reading it back. At the word that might end the line, heads L6H2, L8H15 and L17H1 bring the stored length to the decision. L8H15 copies it through the newline’s value; L17H1 compares through the newline’s key.
  • No single comparison site. The width is written onto the count’s own direction over layers 6 to 14. L17H1 and MLPs 14, 16 and 18 push up the newline’s logit, and two neurons in MLPs 21 and 23 hold it back as a break becomes likely.

How it was tested

  1. 01

    Explore

    An exploration under a frozen charter, on WikiText-2 text, proposed the account.

  2. 02

    Freeze

    Before each round, its hypotheses, thresholds, material and scripts were frozen. Thresholds sat at about half the sizes seen in exploration.

  3. 03

    Test on unseen text

    Five rounds. The last three used Wikipedia articles created after the model was trained; the fifth added Python code and German.

  4. 04

    Other models

    Seven more open models, each under its own frozen protocol.

The predictions were written after the exploration, so these tests show that the account repeats on new text, not that it foresaw effects nobody had seen. One part failed in all three rounds that tested it, and the fifth round found out why.

Fig. 02 Where the one failed prediction came from: the fewer tokens a line holds, the more token weight is left
0.0000.0500.1000.1500.2000.05.010.015.020.025.0Mean number of tokens on the lineLeftover token weightno token biaswidth 2030406080100120Leftover token weight, 3.0: 0.162Leftover token weight, 4.1: 0.099Leftover token weight, 5.8: 0.050Leftover token weight, 10.2: 0.015Leftover token weight, 14.5: 0.036Leftover token weight, 18.7: −0.020Leftover token weight, 23.1: −0.0060.0000.0500.1000.1500.2000.05.010.015.020.025.0Mean number of tokens on the lineLeftover token weightno token biaswidth 2030406080100120Leftover token weight, 3.0: 0.162Leftover token weight, 4.1: 0.099Leftover token weight, 5.8: 0.050Leftover token weight, 10.2: 0.015Leftover token weight, 14.5: 0.036Leftover token weight, 18.7: −0.020Leftover token weight, 23.1: −0.006

At width 40 the intact model kept a small weight on the number of tokens in the line, in all three rounds that tested it. Round five traced it to counting by dilution: the leftover weight grows as lines hold fewer tokens, from within 0.04 of zero at widths of 60 to 120 to 0.16 at width 20.

English text at seven widths (labelled), round five. Values from the paper’s Table 9.

The numbers
Leftover token weight
Tokens per line: 3.00.162
Tokens per line: 4.10.099
Tokens per line: 5.80.050
Tokens per line: 10.20.015
Tokens per line: 14.50.036
Tokens per line: 18.7−0.020
Tokens per line: 23.1−0.006

How far it goes

  • Other widths, code and German. Counting and its correction pass their frozen tests at widths from 20 to 120, in code and in German, though at width 20 the count test rests on a single item. The two width roles were confirmed at width 60; in eight further conditions of width and text type, the readers held in five and the stored length was detectable in one. They show up only where the previous line clearly moves the decision.
  • GPT-2 Small, which does the task poorly, carries a decodable count but uses it a quarter as strongly, and loses the stored width early.
  • Seven other open models have heads in the same four roles: all 29 frozen role tests passed. But the heads and their arrangement differ between model families, so there is no single shared circuit. In two sizes of Qwen3 the same heads, by layer and index, play the same roles.
  • A companion paper, Small decisions, mostly separate parts, tests in Qwen3-0.6B whether these line-breaking heads are shared with indentation, ordinal suffixes and capitals. One of the Qwen3 readers, L17H6, also adds to indentation.
Fig. 04 When the parts appear in training
0.000.250.500.751.001,0004,00016,00048,000143,000Training step (log scale)ShareCounter L5H6: attention on the line startReaders: share of the width effectCounter L5H6: attention on the line start, 1,000: 0.73Counter L5H6: attention on the line start, 2,000: 0.81Counter L5H6: attention on the line start, 4,000: 0.86Counter L5H6: attention on the line start, 8,000: 0.83Counter L5H6: attention on the line start, 16,000: 0.88Counter L5H6: attention on the line start, 48,000: 0.82Counter L5H6: attention on the line start, 143,000: 0.81Readers: share of the width effect, 1,000: 0.15Readers: share of the width effect, 2,000: 0.23Readers: share of the width effect, 4,000: 0.31Readers: share of the width effect, 8,000: 0.34Readers: share of the width effect, 16,000: 0.37Readers: share of the width effect, 48,000: 0.42Readers: share of the width effect, 143,000: 0.540.000.250.500.751.001,0004,00016,00048,000143,000Training step (log scale)ShareCounter L5H6: attention on the line startReaders: share of the width effectCounter L5H6: attention on the line start, 1,000: 0.73Counter L5H6: attention on the line start, 2,000: 0.81Counter L5H6: attention on the line start, 4,000: 0.86Counter L5H6: attention on the line start, 8,000: 0.83Counter L5H6: attention on the line start, 16,000: 0.88Counter L5H6: attention on the line start, 48,000: 0.82Counter L5H6: attention on the line start, 143,000: 0.81Readers: share of the width effect, 1,000: 0.15Readers: share of the width effect, 2,000: 0.23Readers: share of the width effect, 4,000: 0.31Readers: share of the width effect, 8,000: 0.34Readers: share of the width effect, 16,000: 0.37Readers: share of the width effect, 48,000: 0.42Readers: share of the width effect, 143,000: 0.54

Across seven checkpoints, the counting head already puts most of its attention on the line start by step 1,000, while the readers’ share of the width effect grows steadily, from 15% to 54% in the final model.

Exploratory: one training run, seven checkpoints, WikiText-2 text at width 60. Values from the paper’s Table 8.

The numbers
Counter L5H6: attention on the line startReaders: share of the width effect
Step 1,0000.730.15
Step 2,0000.810.23
Step 4,0000.860.31
Step 8,0000.830.34
Step 16,0000.880.37
Step 48,0000.820.42
Step 143,0000.810.54

What this doesn’t show

The account is partial in two ways, and the paper says so in its title.

  • The token correction is incomplete. On short lines some token weight is left: 0.16 at width 20 (the chart above).
  • The named parts are not a complete circuit. Kept alone, they keep the ranking of breaks but not their size. Even with 24 more components found by a search, the circuit’s fidelity to the intact model’s decision is only 0.22 under resample ablation, which the paper takes as the better guide (0.79 under mean ablation). Neither figure is a share of the mechanism understood, and what the added components compute is not known.
Fig. 03 Is the named circuit enough? Fidelity as components are added
−0.2500.0000.2500.5000.7501.0000481624Components added to the named circuitFidelityno better than a constantMean ablationResample ablationMean ablation, 0: −0.164Mean ablation, 4: 0.531Mean ablation, 8: 0.701Mean ablation, 16: 0.765Mean ablation, 24: 0.785Resample ablation, 0: −0.161Resample ablation, 4: 0.025Resample ablation, 8: 0.201Resample ablation, 16: 0.189Resample ablation, 24: 0.217−0.2500.0000.2500.5000.7501.0000481624Components added to the named circuitFidelityno better than a constantMean ablationResample ablationMean ablation, 0: −0.164Mean ablation, 4: 0.531Mean ablation, 8: 0.701Mean ablation, 16: 0.765Mean ablation, 24: 0.785Resample ablation, 0: −0.161Resample ablation, 4: 0.025Resample ablation, 8: 0.201Resample ablation, 16: 0.189Resample ablation, 24: 0.217

The parts named in the account keep the ranking of breaks but not their size. Adding 24 components found by a search raises the circuit’s fidelity to 0.79 under mean ablation, but only to 0.22 under the stricter resample ablation, which the paper takes as the better guide.

Fidelity is how closely the circuit’s newline log-odds follow the intact model’s: 1 is a perfect copy, 0 a constant. It is not a share of the mechanism understood. Round five, held-out English text at width 60. From the paper’s Table 10.

The numbers
Mean ablationResample ablation
Added: 0−0.164−0.161
Added: 40.5310.025
Added: 80.7010.201
Added: 160.7650.189
Added: 240.7850.217
  • One model was studied in depth, on English Wikipedia prose wrapped greedily at widths of 20 to 120 characters, with smaller samples of code and German. Poetry, lists and other wrapping rules may be handled differently.
  • The tests show that the effects did not vanish on new text, not that their sizes are exact: thresholds were set at about half the explored sizes.
  • The new text comes from Wikipedia pages created after Pythia was trained, but such pages can contain older text, and it resembles the training data in style. The text used for the Qwen3, Gemma and SmolLM2 models may overlap their training data.
  • In the other models, key and value routes were separated only in OLMo-2-1B, and the finding that their token correctors also count by dilution is exploratory.

How the study went

  1. 26 experiments on WikiText-2 under a frozen charter proposed the account. Two of its predictions failed there.

  2. Held-out WikiText-2 text. Every part held except one: at width 40 the model keeps a small weight on the number of tokens in the line.

  3. Wikipedia articles created after the model was trained. This time the width-40 leftover was predicted, and it held.

  4. A second batch of new articles: the decision step, whether the circuit is enough, the shape of the count, and why GPT-2 Small does worse. Every part passed.

  5. The open ends, on new articles, Python code and German text. All 16 predictions held; at width 20 the counters’ test rested on a single item.

  6. Pythia-1B, Qwen2.5-0.5B, OLMo-2-1B, Qwen3-1.7B, Qwen3-0.6B, Gemma-4-E2B and SmolLM2-1.7B, each under its own frozen protocol: all 29 role tests passed.

  7. This version, organised by claim, with every round’s frozen results in an appendix and a statement of where the code and data are: 25 pages.

Read it, cite it

Status
Working paper, not peer-reviewed
This version
10 November 2026
Field
Language models
Models
Pythia-410M, seven other open models
Archive
doi:10.5281/zenodo.24112444
Read the abstract

When text is wrapped at a fixed width, a model that predicts the line breaks must count the characters on the current line, infer the width from earlier lines and compare the two. We give a causal account of parts of this computation in Pythia-410M, proposed in an exploration and then tested in five rounds of frozen predictions on held-out text, including Wikipedia articles created after the model was trained. A head in layer 5 counts characters by how much attention it gives to the line start; a second head removes the per-token bias that this creates; and at the newline the same counting heads store the length of the finished line, which three later heads read at the decision. These two width roles were confirmed at width 60; in eight further conditions of width and text type, the readers held in five and the stored length was detectable in one. The decision is assembled across layers 6 to 18 and damped by two neurons, in MLPs 21 and 23, that suppress the newline. The correction is incomplete on short lines: a token weight of 0.16 remains at width 20. The account is not a complete circuit: with 24 further components its fidelity to the intact model’s decision is 0.79 under mean ablation but only 0.22 under resample ablation, and neither figure is a share of the mechanism understood. Seven other open models have heads in the same four roles, arranged differently across model families.

BibTeX

@misc{jeevash2026line,
  title  = {{Counting by dilution and a width stored at the newline: a partial account of line-breaking in Pythia-410M}},
  author = {Jeevash, Richard},
  year   = {2026},
  note   = {Working paper, not peer-reviewed. Code and data: doi:10.5281/zenodo.24112444},
  url    = {https://richardjeevash.com/research-line-breaking.html}
}