Addition in Four Movements: Mapping Layer-wise Information Trajectories in LLMs

Yao Yan · 2025

Read Addition in Four Movements: Mapping Layer-wise Information Trajectories in LLMs by Yao Yan (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2506-07824.txt.

Introduction

Yao Yan wrote this 2025 paper peering inside a language model as it adds numbers, layer by layer. Multi-digit addition is a clean probe of real computation, and Yan dissected the forward pass of LLaMA-3-8B-Instruct with linear probes and a logit lens. Four stages surfaced, like movements in a piece of music.

First, the shape of the formula becomes readable in the activations while the answer still ranks low. Core computational features then flare up. Deeper in, the numeric value of the result sharpens until each digit can be decoded almost perfectly. Near the output the model tidies up and the correct token takes the top rank. The arc favors genuine internal computation over memorized answers. Code and data were released for others to replay.

Catalog record

CREATORYao Yan
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE38 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2506-07824

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Addition in Four Movements: Mapping Layer-wise Information Trajectories in LLMs Yao Yan Abstract Multi-digit addition is a clear probe of the computational power of large language models. To dissect the internal arithmetic processes in LLaMA-3-8B-Instruct, we combine linear probing with logit-lens inspection. Inspired by the step-by-step manner in which humans perform addition, we propose and analyze a coherent four-stage trajectory in the forward pass: Formula-structure representations become linearly decodable first, while the answer token is still far down the candidate list. Core computational features then emerge prominently. At deeper activation layers, numerical abstractions of the result become clearer, enabling near-perfect detection and decoding of the individual digits in the sum. Near the output, the model organizes and generates the final content, with the correct token reliably occupying the top rank. This trajectory suggests a hierarchical process that favors internal computation over rote memorization. We release our code and data to facilitate reproducibility. 1 Introduction Arithmetic tasks like multi-digit addition have emerged as an important testbed for evaluating whether large language models (LLMs) truly learn generalizable reasoning procedures or simply memorize patterns from their training data Nikankin et al. 2024 . Multi-digit addition is trivial for humans due to a well-defined algorithm (carry propagation), but for an LLM it requires either faithfully emulating that algorithm or finding alternate shortcuts. A model that can correctly add arbitrary numbers is likely executing some internal computation akin to the human algorithm, whereas systematic errors or context-specific failures could imply reliance on superficial heuristics or memorized exemplars. Prior studies probing LLM arithmetic reveal contrasting hypotheses. One line of work suggests LLMs develop structured, algorithm-like procedures. For example, analyses of GPT-style models show component specialization for subtasks like partial summation and carry handling, indicative of internal step-by-step solutions Yu and Ananiadou 2024 . Furthermore, even the minimal two-layer encoder-only Transformer can explicitly learn the human carry-add procedure (e.g., column summation and carry management across layers) Kruthoff 2024 . Figure 1: Schematic diagram of the multi-stage information processing model as LLMs solve addition problems. It illustrates how internal representations within the model, characterized by different properties—ranging from understanding problem structure (e.g., formulaic patterns), to core computations (e.g., carries and summations), then to the numerical abstraction of results (e.g., specific digits), and finally to the organization and generation of output—are sequentially activated and detected at different network depths. However, another line of research argues that LLMs achieve addition largely via simple pattern-matching heuristics rather than robust algorithms Nikankin et al. 2024 . For instance, neuron activation studies suggest models use a “bag of heuristics”—sparsely encoded, pattern-specific strategies Zhou et al. 2024 . This view is supported by findings of generalization failures in large LLMs on out-of-distribution elementary addition; models adept at standard addition performed poorly with unfamiliar symbols or violated commutativity (A+B vs. B+A) Yan et al. 2025 . Such failures imply reliance on surface patterns over learned core addition rules. Complementary evidence indicates pre-trained LLMs may also leverage latent Fourier representations for addition, combining low-frequency (magnitude) and high-frequency (e.g., parity) features Zhou et al. 2024 . Thus, a key question arises: when mainstream open-source large language models like LLaMA-3-8B-Instruct( Grattafiori et al. 2024 ) perform multi-digit addition, is their internal process closer to a human-like step-by-step algorithm (e.g., digit-wise summation with carries), or does it rely on a complex, non-algorithmic pattern extraction mechanism? To answer this question, we explored the multi-digit addition mechanism of LLaMA-3-8B-Instruct. Our research revealed a clear pattern of evolution in information representation with increasing model depth. Using probing techniques, we observed that information related to different aspects of the addition task became significantly decodable at different layers of the model. This evolutionary pattern can be roughly characterized by the order in which the following information types appear: 1. Formula structure representation (structural understanding and representation of input formula), 2. Emergence of core computational features (representation of key information related to addition operations and carry propagation), 3. Numerical abstraction of results (intermediate computational results are integrated into internal abstract numerical representations), 4. Organization and generation of output content (generation of final answer token and representation of display format). This observed layering of information representation at different depths suggests that the model uses a structured information processing approach to solve arithmetic tasks, which supports the ’computation rather than memory’ hypothesis. Although this is not directly equivalent to the model accurately executing a human-defined algorithm, it reveals an internal processing process that is more complex than simple pattern matching or memory retrieval. 2 Related Work LLMs face the long - standing question of whether their arithmetic competence derives from algorithmic computation or heuristic pattern matching. Prior work clusters into two camps, with a third line exploring abstract numerical structure. Algorithmic evidence. Fully reverse - engineered toy Transformers show that attention layers can implement a discrete Fourier Transform–style algorithm for modular addition Nanda et al. 2023 ; this concept of trigonometric manipulation has been extended to general addition in mid-sized LLMs, which are proposed to use a "Clock" algorithm operating on helical number representations Kantamneni and Tegmark 2025 . In larger models, component specialization persists: carry - routing heads emerge in 7B GPTs Yu and Ananiadou 2024 , and layer - wise decomposition into column summation and carry propagation is observed in 7B LLaMA variants Kruthoff 2024 . Causal mediation pinpoints operand routers and parallel digit streams Stolfo et al. 2023 ; Quirke and Barez 2024 . Heuristic evidence. An opposing view holds that correct answers arise from a "bag of heuristics". Neuron - level analyses identify sparse units encoding template - based strategies Nikankin et al. 2024 , while out - of - distribution tests reveal systematic failures when digits are permuted or replaced with novel symbols Yan et al. 2025 . Abstract numerical representations. Beyond this dichotomy, several studies report representations that generalize across operations. Pre - trained LLMs appear to superimpose low - frequency magnitude and high - frequency parity features in a Fourier - like basis Zhou et al. 2024 . Recent work further shows that the value of digits is recoverable by a simple linear probe,demonstrating that numbers lie in a low-dimensional linear subspace of hidden states ( Zhu et al. 2025 ) . Group - structured arithmetic tasks elicit basis vectors reminiscent of representation theory Chughtai et al. 2023 , and tree - structured reasoning traces have been reconstructed from hidden states Hou et al. 2023 . Complementary evidence shows that LLMs also encode numbers digit-by-digit : Levy and Geva 2025 identify separate neuron groups for each decimal position and explain typical single-digit mistakes by this representation. Our position. We connect these threads by offering a layer - resolved account of multi - digit addition in LLaMA - 3 - 8B. Combining linear probes Belinkov 2022 and the logit lens nostalgebraist 2020 , we uncover a four - stage trajectory—from formula recognition to explicit token generation—that reconciles component specialization with the emergence of reusable numerical abstractions. 3 Methodology This study aims to explore the internal information processing flow of the LLaMA3 8B Instruct when performing arithmetic operations (focusing on addition). Our approach uses LLaMA3-8B-Instruct as a base model, explores its internal representation to reveal its mechanism for processing arithmetic problems, and

Read the complete text