Post-Routing Arithmetic in Llama-3: Last-Token Result Writing and Rotation-Structured Digit Directions
Organizations: Chongqing Normal University Chongqing Key Lab of Cognitive Intelligence and Intelligent Finance Chongqing, China
Abstract
We study three-digit addition in Meta-Llama-3-8B (base) under a one-token readout to characterize how arithmetic answers are finalized after cross-token routing becomes causally irrelevant. Causal residual patching and cumulative attention ablations localize a sharp boundary near layer~17: beyond it, the decoded sum is controlled almost entirely by the last input token and late-layer self-attention is largely dispensable. In this post-routing regime, digit(-sum) direction dictionaries vary with a next-higher-digit context but are well-related by an approximately orthogonal map inside a shared low-rank subspace (low-rank Procrustes alignment). Causal digit editing matches this geometry: naive cross-context transfer fails, while rotating directions through the learned map restores strict counterfactual edits; negative controls do not recover.
Figures & tables
| Layer range | Last-token strict | Non-last strict |
|---|---|---|
| 0–16 | 0.00 | 0.99 |
| 17–32 | 1.00 | 0.00 |
| Ablated Layers | Accuracy (%) |
|---|---|
| None (baseline) | 100.0 |
| 17–32 | 0.0 |
| 18–32 | 99.9 |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| ones-sum dict (stripped-tens) | tens-sum dict (stripped-hundreds) | |||||
| Layer | Unaligned | Procrustes | RelFro | Unaligned | Procrustes | RelFro |
| 17 | 0.09 | 0.10 | ||||
| 18 | 0.06 | 0.09 | ||||
| 19 | 0.04 | 0.04 | ||||
| 20 | 0.04 | 0.07 | ||||
| 21 | 0.05 | 0.05 | ||||
Numerical Reasoning in Language Models
Numerical reasoning in language models studies how systems represent, calculate with, and explain numbers across mathematical and real-world tasks.
See all 150 papers