Steering Along a Curve
Most activation steering assumes features are straight 1D lines. On character counting in Qwen3-4B, pushing along a 1D linear probe collapses linebreak probability from 98.8% to 2.6%. An 84-parameter closed-form affine map inside the model's 6D helical counting subspace turns line width into a smooth dial across two model families and still extrapolates 4× out of domain.
1D linear steering breaks a curved feature at matched L2 norm.
At scale s = 1.50 on W = 60 in Qwen3-4B (n = 16 WikiText-2 prompts), displacing the residual stream along the 1D linear character-count probe pushes states off the curved manifold and collapses linebreak probability from 98.8% to 2.6%. In Llama-3.2-3B it drops from 98.7% to 39.6%.
Closed-form 6D affine rescaling gives continuous control with zero gradients.
Fitting two 6×6 affine maps inside the 6D PCA subspace takes 0.71 seconds on CPU via SVD, strictly on short lines (c ≤ 120). Sweeping s from 0.67 to 1.50 tracks target line width linearly in both Qwen3-4B (slope 59.0 vs ideal 60.0, R² = 0.93) and Llama-3.2-3B (R² = 0.93), while matched-energy random 6D edits stay flat (+0.6 and 0.0 chars).
Fit strictly on c ≤ 120, yet generalizes to widths 400 and 500.
Frozen and evaluated four times beyond its calibration window with zero retraining, the same 84-parameter operator shifts mean breaks monotonically at W = 400 (397 → 453 on 8/8 prompts) and W = 500 (509 → 574 on 7/8 prompts). At W = 80 and W = 120, it produces larger shifts than a 3.83M-parameter Rank-8 LoRA without retraining per scale.
Both model families independently evolve the same Layer-5 circuit.
Qwen3-4B (36L, 1,152 heads) and Llama-3.2-3B (28L, 672 heads) both build a curved 6D helical counter peaking harmonically at Layer 5. Zeroing 20 random heads changes nothing (99.8% / 98.3%). Zeroing 20 circuit heads in Qwen3 (1.7%) or 16 DLA heads in Llama-3.2 (2.4%) drops linebreak probability to 3.0% and 1.6%.
The entire study ran on Colab for $0.11 in retained GPU compute ($0.36 gross across the session). Below is the full story — including the two interventions that failed and what they revealed about weight editing.
How does a model count characters when it only sees tokens?
Give a pretrained language model four lines of plain English wrapped at 60 characters — the kind of fixed-width formatting common in emails, RFCs, READMEs, and code comments. As the fifth line approaches column 60, the model assigns 98.8% probability to emitting a newline (\n) next.
That small reflex hides a clean internal computation. A transformer never sees individual characters as inputs; it sees variable-length BPE tokens. "In" is 2 characters, " 1841" is 5, "," is 1, and " English" is 8. To wrap reliably at column 60, the network has to sum those uneven token lengths into a cumulative character count c along the current line, hold c in its residual stream, and compare it against the width W established by earlier lines.
Line wrapping itself is trivial to code in Python. We study it because it is an unusually sharp microscope for activation steering. Most steering methods assume a concept lives along a single straight direction in activation space: add that vector to turn the concept up, subtract it to turn it down. On fuzzy traits like honesty or style, it is hard to tell whether a steering vector works cleanly or quietly degrades the network. Character count c has an exact integer ground truth at every token and an exact behavioral readout.
The straight-line assumption breaks on a helix
Anthropic's When Models Manipulate Manifolds (arXiv:2601.04480) showed that Claude 3.5 Haiku represents character count on a curved manifold rather than a straight line. We wanted to know three things on open-weight models: whether independent open families evolve the same circuit, what happens when standard 1D steering meets that curve, and whether curved rescaling can be compiled directly into static weights.
Start with the standard 1D recipe on Qwen3-4B. Collect residual-stream vectors H[b, t, :] (2,560 floats per token) at Layer 14 across fluent WikiText-2 passages and fit one linear regression predicting cumulative character count c. That gives a single direction w. To make a 60-character prompt wrap 1.5× wider (around 90 characters, s = 1.50), subtract a multiple of w so c = 60 reads like c = 40.
At matched perturbation size, linebreak probability collapses from 98.8% to 2.6%. The model stops wrapping cleanly altogether.
To see why, average the residual-stream vectors across many unrelated prompts that share the exact same integer count c = 1, 2, ..., 120. Different words and topics cancel out across prompts, leaving behind the shared count component M[c]. When we run PCA on those 120 vectors, they do not lie on a straight line. Across the first six principal components, pairs of coordinates oscillate like cosines and sines — coiling the number line into a curved 6D helix.
“Once you see the helix, the 98.8% → 2.6% collapse is immediate. Every valid count lives on the curved coil. A 1D linear push adds the same straight arrow everywhere, shoving the activation off the coil into empty space that downstream heads never learned to read. An 84-parameter affine map inside the 6D subspace instead slides the activation along the helix from c to c / s.”
Two independent model families converge on Layer 5
The curved helix is not an idiosyncrasy of one training run. Both Qwen3-4B (36 layers, 1,152 heads) and Llama-3.2-3B (28 layers, 672 heads) independently build the same RoPE-orthogonal 6D helical counter, peaking harmonically at Layer 5 (partial R² beyond token position = 0.732 in Qwen3 and 0.735 in Llama-3.2, with Llama peaking at 0.776 at Layer 7).
Mid-network, however, the two architectures diverge sharply. Between Layers 15 and 16 in Qwen3-4B, the 1D PCA variance of the count manifold jumps from 0.170 to 0.938 right before its Layer-17 boundary-comparison heads (L17H10, L17H11, L17H8). Llama-3.2-3B exhibits no 1D phase jump at all, staying between 0.123 and 0.257 across all 28 layers.
84 closed-form parameters turn line width into a dial
Let U6 be the top six right singular vectors of the centered mean matrix M (shape dmodel × 6, fit strictly on c ≤ 120). Projecting a token vector h into that 6D basis gives z = U6T(h − μ) in six coordinates. For any desired scale s, a single closed-form ridge regression inside those 6 dimensions solves for the 6×6 matrix As and 6-vector bs that map z(c) onto z(c / s).
During inference, on current-line tokens across two adjacent layers (L14–L15 in Qwen3-4B, L4–L5 in Llama-3.2-3B), we replace only those 6 coordinates while leaving the other dmodel − 6 dimensions untouched. Across two layers, the operator has 84 affine parameters (2 × (36 + 6)) and fits in 0.71 seconds on a CPU with zero gradients.
Sweeping s continuously from 0.67 to 1.50 moves the expected linebreak linearly in both families (R² = 0.93 at W = 60 in both models). In Llama-3.2-3B, the slopes are attenuated (~0.45× of ideal) because the hook acts early at Layers 4–5, allowing Layers 6–27 to partially re-accumulate unshifted count information. Matched-energy random 6D maps move nothing (+0.6 chars in Qwen3, 0.00 in Llama-3.2).
Domain boundary: at W = 120, contraction (s < 1) stops moving breaks inward in both models because c / s > 120 exits the c ≤ 120 calibration range. And on W = 80 and W = 120, break probability attenuates more steeply at high s (0.411 and 0.380 at s = 1.50) than at W = 60 (0.825).
Roughly 2% of attention heads carry 97–98% of the circuit
Where is the helical counter read out and converted into a newline token? We scored all 1,824 attention heads across both models on two distinct roles: QK boundary heads (which attend back to prior linebreaks to compare c against W) and late Direct Logit Attribution (DLA) heads (which directly write positive logit onto \n).
We then tested causal necessity via zero-ablation at W = 60. Zeroing 20 random heads leaves linebreaking completely untouched (99.8% in Qwen3, 98.3% in Llama-3.2). Zeroing the top-4 QK boundary heads in Qwen3 delays the break by +27.8 characters while leaving total break probability at 94.9%. Zeroing the 16 DLA heads (or the 20-head union — 1.7% of Qwen3 and 2.4–3.0% of Llama-3.2) drops linebreak probability to 3.0% in Qwen3 and 1.6% in Llama-3.2.
Zeroing 1.7% of Qwen3 and 2.4–3.0% of Llama-3.2 eliminates 97–98% of linebreaking.
Qwen3-4B
36 × 32 = 1,152 headsLlama-3.2-3B
28 × 24 = 672 heads4× out of domain, LoRA, and two honest negative results
Every parameter of the 6D operator was fit strictly on short calibration lines (c ≤ 120). To test whether the map captured true periodic manifold geometry rather than memorizing 120 points, we froze the operator and evaluated it four times further out on Qwen3-4B at W = 400 and W = 500 (n = 8 prompts per width). Across s ∈ {1.00, 1.10, 1.15, 1.25}, mean breaks still shift monotonically at W = 400 (397.0 → 452.8, 8/8 prompts up) and W = 500 (508.6 → 573.5, 7/8 up), with break probability attenuating from 0.780 to 0.357 and 0.847 to 0.478.
At s = 1.25, we also benchmarked the 84-parameter closed-form operator against a 3.83M-parameter Rank-8 LoRA trained for 48 steps on W ∈ {40, 60, 80} (12.07 s GPU training). The 6D operator delivered larger break shifts at W = 80 (+13.7 chars, t = +3.37, 15/16) and W = 120 (+11.4 chars, t = +3.22, 14/16) while tuning continuously to any s without retraining. Two fairness caveats belong beside that result: W = 120 was out of distribution for LoRA while inside our c ≤ 120 harvest window, and LoRA retained higher break confidence at wide margins (91.6% and 85.9% vs 85.2% and 69.1%).
Applying the 6D map to every token in the prompt rescales both the remembered width W on previous lines (W ↦ W/s) and the current count (c ↦ c/s). Because c/s == W/s is identical to c == W, the shift cancels. Scoping the hook strictly to the current line resolves the trap.
We tested three progressively cleaner closed-form updates to the query weights W_Q of the 4 localized boundary heads (ending with Fisher-subspace reduced-rank regression). WikiText-2 perplexity stayed nearly identical (|ΔPPL| ≤ 0.0154 in Qwen3, ≤ 0.0011 in Llama-3.2) and random-head edits shifted breaks by ≤ 0.03 chars, yet W_Q-only edits failed the two-sided control gate in both models (Qwen3 W = 60 shifted upward for both s = 0.67 and s = 1.50; Llama W = 80 inverted). The sparse circuit explains why: 16 downstream DLA heads still read the unshifted residual stream directly.
What this means for steering and interpretability
First, when a 1D steering vector fails or degrades a model, the feature may still be cleanly present — just curved inside a low-dimensional subspace. Matching the operator to that subspace (here a 6D affine map rather than 1D vector addition) turns a destructive perturbation into continuous, cross-family control.
Second, when an internal representation has geometric symmetry like periodic helical coordinates, a tiny closed-form map fit in under a second can generalize 4× beyond its calibration domain without gradient updates.
Third, locating a sparse circuit is not yet enough for static weight compilation. Even when 97–98% of a behavior flows through ~2% of attention heads, editing only the upstream routing queries fails while downstream logit writers continue reading the raw residual stream. Hook-free weight compilation will require joint edits across both QK routing and DLA readout paths, or tasks where the target boundary is not re-encoded on prefix tokens.
Scope limits: everything here is measured on one narrow task (fixed-width character linebreaking); our 1D control matches L2 norm rather than sweeping arbitrary scalar step sizes across layers; and primary dose-response curves use exact teacher-forced survival probabilities on unwrapped continuations rather than multi-line autoregressive generation with newline-resetting hooks.