Mechanistic Interpretability of Structure-Aware Numerical Reasoning in LLaMA 3.1 8B

arXiv cs.LG Papers

Summary

This paper uses mechanistic interpretability to analyze how LLaMA 3.1 8B models numerical sequences, revealing that it internally computes and stores first differences to extrapolate patterns.

arXiv:2608.18419v1 Announce Type: new Abstract: Recent work has shown that large language models (LLMs) exhibit strong numerical sequence modeling capabilities and show promise in time-series prediction. While LLMs display in-context learning capabilities, the mechanisms with which they accomplish time-series prediction remain unclear. Specifically, whether they truly understand the underlying structure, which at a minimum requires reasoning over first differences in the sequence of numbers. To study this, we investigate Llama 3.1-8B from a mechanistic interpretability point of view. Mechanistic interpretability is an emerging field concerned with the reverse engineering of the algorithms learned by neural networks such as LLMs. To assess Llamas' numerical sequence modeling capabilities and to facilitate our mechanistic interpretability analysis, we create a sequence modeling task that cannot be solved without picking up structural cues. Specifically, we sample n random numbers and repeat them with an offset. We find that Llama displays strong performance on our tasks suggesting that it can pick up on the underlying structure. To understand the mechanisms that allow it to do so, we perform probing experiments and activation patching based counterfactual analysis. Probing reveals that the model computes and stores first differences in its internal representations without explicit supervision, indicating that it tracks structural information about the sequence. Activation patching reveals that Llama retrieves the relevant first-difference with a mechanism similar to an induction circuit and subsequently adds it to the current value. Notably, our work represents one of the first studies to identify this form of concept induction in LLMs.
Original Article
View Cached Full Text

Cached at: 08/20/26, 10:26 AM

# Mechanistic Interpretability of Structure-Aware Numerical Reasoning in LLaMA 3.1–8B
Source: [https://arxiv.org/html/2608.18419](https://arxiv.org/html/2608.18419)
\\correspondingauthor

## Mechanistic Interpretability of Structure\-Aware Numerical Reasoning in LLaMA 3\.1–8BConference:The fourth International Workshop on Rich Media with Generative AI ; November 10–14, 2026; Rio de Janeiro, BrazilThe fourth International Workshop on Rich Media with Generative AI \(RichMediaGAI ’26\), November 10–14, 2026, Rio de Janeiro, BrazilDOI:[10\.1145/3841458\.3841545](https://doi.org/10.1145/3841458.3841545)ISBN:979\-8\-4007\-2947\-8/2026/11CCS:Computing methodologies Natural language processingCCS:Time SeriesCCS:Mechanistic Interpretability

Rahul ChowdhuryOrcID:[0009\-0008\-1575\-6077](https://orcid.org/0009-0008-1575-6077)Affiliation:Northeastern University,Boston,MA,USAemail:[chowdhury\.rah@northeastern\.edu](mailto:[email protected])Timothy A RupprechtAffiliation:EmbodyX Inc\.,San Mateo,CA,USAemail:[tarupprecht@gmail\.com](mailto:[email protected]),Senhao CaoAffiliation:Northeastern University,Boston,MA,USAemail:[senhao\.cao@gmail\.com](mailto:[email protected]),Jiahao LiuAffiliation:Mobi\.ai,Boston,MA,USAemail:[jiahao@takemobi\.com](mailto:[email protected]),Octavia CampsAffiliation:Northeastern University,Boston,MA,USAemail:[O\.Camps@northeastern\.edu](mailto:[email protected]),David BauAffiliation:Northeastern University,Boston,MA,USAemail:[davidbau@northeastern\.edu](mailto:[email protected]),Pu ZhaoAffiliation:Northeastern University,Boston,MA,USAemail:[p\.zhao@northeastern\.edu](mailto:[email protected])andYanzhi WangAffiliation:Northeastern University,Boston,MA,USAemail:[yanzhiwang@northeastern\.edu](mailto:[email protected])

2026; © cc

###### Abstract\.

Recent work has shown that large language models \(LLMs\) exhibit strong numerical sequence modeling capabilities and show promise in time\-series prediction\. While LLMs display in\-context learning capabilities, the mechanisms with which they accomplish time\-series prediction remain unclear\. Specifically, whether they truly understand the underlying structure, which at a minimum requires reasoning over first differences in the sequence of numbers\. To study this, we investigate Llama 3\.1\-8B from a mechanistic interpretability point of view\. Mechanistic interpretability is an emerging field concerned with the reverse engineering of the algorithms learned by neural networks such as LLMs\. To assess Llamas’ numerical sequence modeling capabilities and to facilitate our mechanistic interpretability analysis, we create a sequence modeling task that cannot be solved without picking up structural cues\. Specifically, we samplennrandom numbers and repeat them with an offset\. We find that Llama displays strong performance on our tasks suggesting that it can pick up on the underlying structure\. To understand the mechanisms that allow it to do so, we perform probing experiments and activation patching based counterfactual analysis\. Probing reveals that the model computes and stores first differences in its internal representations without explicit supervision, indicating that it tracks structural information about the sequence\. Activation patching reveals that Llama retrieves the relevant first\-difference with a mechanism similar to an induction circuit and subsequently adds it to the current value\. Notably, our work represents one of the first studies to identify this form of concept induction in LLMs\.

††cc\-license:by## 1\.Introduction

![Refer to caption](https://arxiv.org/html/2608.18419v1/OutlineUpdate6drawio.png)Figure 1\.Illustrates how the model identifies a repeated first\-difference \(delta\) pattern after differencing, then extrapolates by locating and copying the delta that immediately follows the final observed one, and adding it to last number\.Large Language Models \(LLMs\) can zero\-shot extrapolate sequences, and generate novel sequences and functions in response to complex queries\([19](https://arxiv.org/html/2608.18419#bib.bib1);[25](https://arxiv.org/html/2608.18419#bib.bib32);[27](https://arxiv.org/html/2608.18419#bib.bib29);[45](https://arxiv.org/html/2608.18419#bib.bib27);[39](https://arxiv.org/html/2608.18419#bib.bib28);[2](https://arxiv.org/html/2608.18419#bib.bib14)\)\. How do they do this? Did they encounter these trends during training and simply extrapolate using a rule learned specifically for those patterns? Or did they learn to infer the underlying structure of sequence data more generally?

If LLMs can understand the ordinal structure of numerical data — identifying a hidden pattern, reasoning about it, and applying a consistent extrapolation algorithm — the implications extend well beyond memorization\. It would suggest these models are learning abstract structural reasoning, a capability with relevance far beyond language: reasoning over time\-series data, understanding geometric relationships between image pixels, or maintaining structural coherence across connected points in 3D data\([21](https://arxiv.org/html/2608.18419#bib.bib39);[23](https://arxiv.org/html/2608.18419#bib.bib38);[26](https://arxiv.org/html/2608.18419#bib.bib37);[22](https://arxiv.org/html/2608.18419#bib.bib35);[28](https://arxiv.org/html/2608.18419#bib.bib34);[24](https://arxiv.org/html/2608.18419#bib.bib33);[25](https://arxiv.org/html/2608.18419#bib.bib32);[37](https://arxiv.org/html/2608.18419#bib.bib31);[38](https://arxiv.org/html/2608.18419#bib.bib30)\)\.

In this work, we study the LLaMA 3\.1–8B model through the lens of mechanistic interpretability\. To probe its structural reasoning capabilities, we introduce a non\-trivial sequence modeling task, shown in Figure[2](https://arxiv.org/html/2608.18419#S1.F2), that cannot be solved via token\-level copying through induction heads\([4](https://arxiv.org/html/2608.18419#bib.bib12)\)\. Our interpretability analysis combines linear probing with activation patching\. Probing shows that first\-difference representations are locally stored and linearly decodable across layers\. Patching experiments further reveal that the model identifies structurally critical tokens, retrieves the correct offset through induction over these latent differences, and performs the final arithmetic step by adding that offset to the last number in the sequence\. These computations are precise, localized, and structurally grounded\.

To our knowledge, this is the first mechanistic interpretability study to uncover an internal mechanism by which an LLM performs induction over latent structure in numerical sequences—where extrapolation arises from arithmetic operations over internal representations retrieved through, and we illustrate it in Figure[1](https://arxiv.org/html/2608.18419#S1.F1)\.

![Refer to caption](https://arxiv.org/html/2608.18419v1/combined_0_modified.png)Figure 2\.\(a\) Shows the input signal, which consists of all unique values which means no number appears twice in the sequence\. \(b\) Shows the deltas of the input signal, revealing that a cycle or pattern emerges only after applying the differencing operation\.
## 2\.Related Work

[19](https://arxiv.org/html/2608.18419#bib.bib1)showed that LLMs can perform sequence completion tasks, attributing this ability to in\-context learning\. However, they did not examine whether such performance stems from memorization, nor did they investigate the underlying mechanisms or the model’s understanding of temporal structure\.\([10](https://arxiv.org/html/2608.18419#bib.bib3)\)proposed LLM\-Time that explored ways to make a pre\-trained LLMs fit for time\-series forecasting, demonstrating that pretrained LLMs can perform well on time\-series forecasting tasks without fine\-tuning\. Time\-GPT\([7](https://arxiv.org/html/2608.18419#bib.bib2)\)is a foundation model trained exclusively on time\-series data, and Lag\-Llama\([20](https://arxiv.org/html/2608.18419#bib.bib4)\)is another time\-series\-specific transformer\. While these models highlight effectiveness of transformers for sequence modeling\([44](https://arxiv.org/html/2608.18419#bib.bib36);[36](https://arxiv.org/html/2608.18419#bib.bib20);[34](https://arxiv.org/html/2608.18419#bib.bib21);[35](https://arxiv.org/html/2608.18419#bib.bib22);[15](https://arxiv.org/html/2608.18419#bib.bib26);[14](https://arxiv.org/html/2608.18419#bib.bib25);[16](https://arxiv.org/html/2608.18419#bib.bib43);[43](https://arxiv.org/html/2608.18419#bib.bib45);[17](https://arxiv.org/html/2608.18419#bib.bib44);[11](https://arxiv.org/html/2608.18419#bib.bib24);[33](https://arxiv.org/html/2608.18419#bib.bib23)\), they fall outside our study scope, as we focus on general\-purpose LLM\.

[1](https://arxiv.org/html/2608.18419#bib.bib5)and[12](https://arxiv.org/html/2608.18419#bib.bib6)examined in\-context learning using toy models but did not explore whether LLMs can infer sequential structure in tasks they were not explicitly trained for\.\([13](https://arxiv.org/html/2608.18419#bib.bib15)\)applied mechanistic interpretability to identify shared circuits in simple sequence continuation tasks, such as extending short increasing number sequences\. While\([13](https://arxiv.org/html/2608.18419#bib.bib15)\)demonstrated LLMs’ ability to handle familiar patterns, it did not address whether these models can reason over more abstract or irregular numerical structures\. In contrast, our work investigates whether a LLM can recognize and extrapolate more complex sequential structures—such as sequences defined by arbitrary first differences\. This goes beyond surface\-level extension and explores the model’s ability to infer and extend abstract structure in number sequences\.

## 3\.Problem Setting

### 3\.1\.Dataset

We design a dataset to have strings containing numbers followed by a comma, and each instance finishes with a comma so that the predicted next token is a number\. The numbers in the whole dataset were between 0 and 999\. We construct each sequence with first differences from integers in the set containing all integers between−9\-9and99inclusive, excluding00\. Each sequence consists of unique numbers whose deltas are also unique up to the 17th position, after which the delta repeats\.

We design the dataset to specifically test whether the LLM can uncover latent numerical structure and specifically track delta within a sequence\. As we illustrate in Figure[2](https://arxiv.org/html/2608.18419#S1.F2)and in an abbreviated form in Table[1](https://arxiv.org/html/2608.18419#S3.T1), each sequence comprises two segments: the first is a random walk with unique deltas and no apparent pattern; the second segment reuses the same set of deltas, in the same order, as the first segment\. This structure ensures that the model must recognize the pattern in delta and identify the unique location from which the model can copy the delta from\.

Index0123452324252627313233343536375556575859TokenS403,405,400411,417,409416,436,438,433444,450,442Delta2\-576\-8\-2202\-576\-8Table 1\.Table shows selected index positions, tokens, and their corresponding first differences from the tokenized input\. A recurrence in the first difference after token 33 marks the onset of a repeating cycle\.Algorithm 1Predict Next Number via First\-Difference Pattern DetectionInput: Token sequenceS=\[BOS,s1,s2,…,sn​,\]S=\[\\text\{BOS\},s\_\{1\},s\_\{2\},\\ldots,s\_\{n\}\\texttt\{,\}\] Output: Predicted next numbersn\+1s\_\{n\+1\}

1:Compute first differences:

2:D=\[s2−s1,s3−s2,…,sn−sn−1\]D=\[s\_\{2\}\-s\_\{1\},\\ s\_\{3\}\-s\_\{2\},\\ \\ldots,\\ s\_\{n\}\-s\_\{n\-1\}\]

3:Identify repeating pattern

PPin

DD
4:Locate the index

kkwhere

PPfirst appears in

DD
5:Determine the phase position

ppof

sns\_\{n\}within pattern

PP
6:Let

dp=D⁡\[p\]d\_\{p\}=D\[p\]be the corresponding first difference

7:Compute prediction:

sn\+1=sn\+dps\_\{n\+1\}=s\_\{n\}\+d\_\{p\}
8:return

sn\+1s\_\{n\+1\}

### 3\.2\.Model

We conduct all experiments using LLaMA 3\.1–8B\([9](https://arxiv.org/html/2608.18419#bib.bib17)\), a transformer\([30](https://arxiv.org/html/2608.18419#bib.bib13)\)based model with 32 layers and 32 attention heads per layer\. One key reason for choosing this model is that its tokenizer represents each integer from 0 to 999 as a single token\. This property makes the analysis more tractable by reducing the number of tokens per sequence, thereby simplifying both intervention and observation during interpretability experiments\. As a result, LLaMA 3\.1–8B was used consistently across all experiments\.

### 3\.3\.Software

We extensively use NNsight and NDIF framework\([6](https://arxiv.org/html/2608.18419#bib.bib18)\)for tracing activations, applying interventions, and analyzing internal representations of the LLaMA 3\.1–8B model\.

### 3\.4\.Performance Evaluation

We evaluate LLaMA 3\.1\-8B on the sequence prediction task as shown in Figure[1](https://arxiv.org/html/2608.18419#S1.F1)and Figure[2](https://arxiv.org/html/2608.18419#S1.F2), and we formally describe it in Algorithm[1](https://arxiv.org/html/2608.18419#alg1)\. We prompt the model to predict the 30thnumber given the first 29 elements of each input sequence\. The evaluation dataset consists of 10,000 sequences, each formatted as a comma\-separated string of integers\. Every instance ends with a comma, indicating that the next token to be predicted should be a number\.

Due to this formatting, we tokenize each number and each comma separately, as we illustrate in abbreviated form in Table[2](https://arxiv.org/html/2608.18419#S1.F2)\. Including the initial special token, the model processes 59 tokens before generating the 60thtoken as output\. This prediction corresponds to the 30thnumber in the sequence\.

#### 3\.4\.1\.Metrics

We employ two complementary evaluation metrics:

Mean Absolute Error \(MAE\)quantifies average prediction error:

\(1\)MAE=1n​∑i=1n\|yi−y^i\|,\\text\{MAE\}=\\frac\{1\}\{n\}\\sum\_\{i=1\}^\{n\}\\left\|y\_\{i\}\-\\hat\{y\}\_\{i\}\\right\|,whereyiy\_\{i\}andy^i\\hat\{y\}\_\{i\}denote the ground truth and predicted values, respectively, andnnis the number of instances\.

Coefficient of Determination \(R2R^\{2\}\)measures explained variance:

\(2\)R2=1−∑i=1n\(yi−y^i\)2∑i=1n\(yi−y¯\)2,R^\{2\}=1\-\\frac\{\\sum\_\{i=1\}^\{n\}\(y\_\{i\}\-\\hat\{y\}\_\{i\}\)^\{2\}\}\{\\sum\_\{i=1\}^\{n\}\(y\_\{i\}\-\\bar\{y\}\)^\{2\}\},wherey¯\\bar\{y\}is the mean of ground truth\. Values close to 1 indicate strong predictive performance, while values near 0 or negative suggest performance close to or worse than a naive mean predictor\.

#### 3\.4\.2\.Results

LLaMA 3\.1\-8B achieves an MAE of 4\.2748 and anR2R^\{2\}of 0\.9958 on our evaluation dataset\. The highR2R^\{2\}value indicates that the model explains approximately 99\.58% of the variance in the target sequences, demonstrating strong pattern recognition capabilities for numerical sequence prediction\.

## 4\.Is Numerical Information Represented Locally in the Model?

![Refer to caption](https://arxiv.org/html/2608.18419v1/aaai_paperreadybestlast.png)Figure 3\.Layerwise linear decodability of first differences and final numbers\. Mean absolute error \(MAE; top\) and coefficient of determination \(R2R^\{2\}; bottom\) for linear probes trained to decode delta \(left\) at 27thposition and final number \(right\) at 57thposition from hidden states across layers\. Solid green lines denote performance on true targets; dashed red lines denote control probes trained on shuffled labels\. Delta show consistently strong linear decodability, while final number representations gradually lose decodability\.To predict the next number, the model must add the final observed value to a previously seen first difference\. This raises a core interpretability question: does the model explicitly encode these numerical components in structured, localized representations, or does it rely solely on implicit pattern recognition?

We useprobingexperiments to assess the representational content of the model’s hidden states\. Unlike patching—which tests whether an activation is*functionally necessary*by measuring how altering it affects the model’s output—probing asks whether specific information is*present*in the representation, regardless of whether the model ultimately uses it\. Here, we probe for the presence and location of numerically meaningful quantities in the hidden layers by training linear regressors to decode two key values: \(1\) the first difference from the 27thtoken position \(where it is expected to be stored\), and \(2\) the final number from the 57thtoken position\. If successful, this would indicate that the model explicitly encodes these arithmetic components in localized, interpretable forms, even without task\-specific supervision, and uses these interpretable representations for prediction\.

### 4\.1\.Probing Setup

We collect hidden states from two key token positions: the 27thtoken position, which is expected to encode the first difference that must be added to the final number to predict the next number, and the 57thtoken position, which contains the final number in the input sequence\. At each layer, we train linear regression models using ordinary least squares on 4,500 training samples and 500 held\-out samples for testing:

\(3\)𝜷^=arg​min𝜷⁡‖𝐘−𝐗​𝜷‖2,\\small\\hat\{\\boldsymbol\{\\beta\}\}=\\operatorname\*\{arg\\,min\}\_\{\\boldsymbol\{\\beta\}\}\\left\\\|\\mathbf\{Y\}\-\\mathbf\{X\}\\boldsymbol\{\\beta\}\\right\\\|^\{2\},where𝐗∈Rn×d\\mathbf\{X\}\\in\\mathrm\{R\}^\{n\\times d\}is the matrix of hidden states \(withd=4096d=4096dimensional representations acrossn=4500n=4500training examples\),𝐘∈Rn\\mathbf\{Y\}\\in\\mathrm\{R\}^\{n\}is the target vector \(either the first difference or the final number\), and𝜷∈Rd\\boldsymbol\{\\beta\}\\in\\mathrm\{R\}^\{d\}is the learned weight vector\.

To establish baselines, we implement control conditions that test whether observed decodability reflects genuine localization or spurious correlations\. For first difference decoding, we train control probes using activations from the 57thtoken to predict the first difference of 27thposition, testing whether first difference information is accessible from positions nearer to the last token position\. For final number decoding, we train control probes using activations from the 27thtoken to predict the number at the 57thposition\. These ensure that successful decoding reflects position\-specific encoding rather than global numerical information distribution\.

### 4\.2\.Results

Figure[3](https://arxiv.org/html/2608.18419#S4.F3)presents the results of probing experiments\. The top row reports the MAE of the linear regression model on held\-out test samples, while the bottom row shows theR2R^\{2\}\. We compute these metrics at each layer to evaluate the linearity of the target quantities throughout the model’s depth\.

The results confirm that both the first difference \(at the 27thtoken position\) and the final number \(at the 57thtoken position\) are linearly decodable from the hidden states, as evidenced by low MAE values and highR2R^\{2\}scores approaching 1\. Notably, the first difference becomes linearly accessible starting after the 7thlayer, where the MAE drops sharply and approaches its minimum, while theR2R^\{2\}score increases and stabilizes above 0\.8\. Although performance slightly decays with depth, it remains relatively stable across the first 16 layers\. In contrast, the linear decodability of the final number at the 57thposition shows a gradual decline across deeper layers, with MAE increasing andR2R^\{2\}decreasing after layer 8\. This suggests that the final number representation becomes increasingly entangled with other contextual information as it propagates through model\.

Crucially, the control conditions demonstrate substantially worse performance across all layers for both targets\. For first differences, control probes using 57thtoken activations achieve negativeR2R^\{2\}values and high MAE, indicating no meaningful linear relationship\. Similarly, control probes attempting to decode final numbers from 27thtoken activations show consistently poor performance\. This confirms that the observed decodability is position\-specific and not due to general numerical information in the representations\.

Together, these results indicate that the numerical components necessary for the model’s arithmetic composition\-the first difference and the final number\-are linearly encoded in specific locations\.

## 5\.Is the Next Number Computed by Adding a Retrieved First Difference?

![Refer to caption](https://arxiv.org/html/2608.18419v1/Source2.png)Figure 4\.Illustrates the query\-hidden state patching technique that we use to test whether the model performs arithmetic composition by retrieving a first difference from an earlier position\. The clean sequence \(bottom\) contains a structured delta pattern, while the corrupt sequence \(top\) is flat\-valued\. We transplant activations from the clean run into the corrupt run from a given layerllonward\. We patch hidden states \(shown with blue arrows\) at layerslltoLLat one token position at a time except the beginning\-of\-sequence and final two tokens\. We patch the query vector of the final token \(shown with orange arrows\) from the clean run at layersl\+1l\+1toLL, ensuring the model attends to the correct location encoding the target first difference\. This setup isolates and tests the causal contribution of induction and addition behaviors in the model’s prediction pipeline\.Having established that the model encodes first differences and final numbers in localized representations, we now ask whether it*functionally uses*those representations to perform arithmetic composition\. We test whether the model retrieves a previously seen first difference from a particular token position and perform arithmetic operation on it\.

To answer this question, we useactivation patching\([32](https://arxiv.org/html/2608.18419#bib.bib7);[18](https://arxiv.org/html/2608.18419#bib.bib8);[31](https://arxiv.org/html/2608.18419#bib.bib9);[42](https://arxiv.org/html/2608.18419#bib.bib40);[40](https://arxiv.org/html/2608.18419#bib.bib41);[41](https://arxiv.org/html/2608.18419#bib.bib42);[8](https://arxiv.org/html/2608.18419#bib.bib10);[5](https://arxiv.org/html/2608.18419#bib.bib11)\), following the patching methodology of\([3](https://arxiv.org/html/2608.18419#bib.bib16)\)\. We transplant activations from a clean sequence into a corrupt one to determine if the model retrieves the delta from the hypothesized position \(delta that follows the latest one\) and adds that to a new number of an unseen sequence\.

### Clean vs\. Corrupt Sequence

We define two types of input sequences:

- •Clean sequence:xclean=\(x1,…,x29\)x^\{\\text\{clean\}\}=\(x\_\{1\},\\dots,x\_\{29\}\), where the deltasΔi\\Delta\_\{i\}begin to repeat afteri=17i=17, and the model predicts:x30=x29\+Δ∗x\_\{30\}=x\_\{29\}\+\\Delta^\{\*\}whereΔ∗\\Delta^\{\*\}is the difference retrieved from an earlier position\. In tokenized form,x29x\_\{29\}appears at token 57, and the outputx30x\_\{30\}is generated at token 58\.
- •Corrupt sequence:xcorrupt=\(100,100,…,100\)x^\{\\text\{corrupt\}\}=\(100,100,\\dots,100\), so thatΔi=0\\Delta\_\{i\}=0for allii\.

What makes thecorrupt sequenceparticularly well\-suited for evaluating the extraction and addition of the first difference is its deliberately flattened structure, which eliminates any intrinsic gradient or variation in the input\. The corrupt sequence serves as an ideal control, as it lacks the algorithm present in the clean sequence, allowing us to test whether the model can still retrieve and apply a meaningful first difference from an alternate source\.

### 5\.1\.Patching Setup

LetHt\(l\)H\_\{t\}^\{\(l\)\}andQt\(l\)Q\_\{t\}^\{\(l\)\}denote the hidden state and query vector at tokentt, layerll\. We patch hidden states to all tokens except the beginning token, the final number token \(57\), and the final token \(58\):

Htcorrupt,\(l:L\)←Htclean,\(l:L\)H\_\{t\}^\{\\text\{corrupt\},\(l:L\)\}\\leftarrow H\_\{t\}^\{\\text\{clean\},\(l:L\)\}The query vector of final token \(58\) is patched from one layer above:

Q58corrupt,\(l\+1:L\)←Q58clean,\(l\+1:L\)Q\_\{58\}^\{\\text\{corrupt\},\(l\+1:L\)\}\\leftarrow Q\_\{58\}^\{\\text\{clean\},\(l\+1:L\)\}
In particular, following\([3](https://arxiv.org/html/2608.18419#bib.bib16)\), we patch layerlland all subsequent layers, as we illustrate in Figure[4](https://arxiv.org/html/2608.18419#S5.F4)\. Patching downstream layers ensures that transient causal signals are preserved and not suppressed as noise by later layers, thereby, improving sensitivity to the influence of critical nodes on the final prediction\.

For the final token, we specifically patch the query vector across layersl\+1l\+1throughLL\. This is necessary because the corrupt sequence does not learn in\-context to retrieve target first differences from earlier tokens\. By patching the query vector of the final token from the clean forward pass, we ensure that the model attends to the position encoding the appropriate first difference, thereby, facilitating the intended retrieval behavior\.

### 5\.2\.Causal Metric

To quantify causal influence, we use difference in predicted probabilities ofcounterfactual labelycf=100\+Δ∗y\_\{\\text\{cf\}\}=100\+\\Delta^\{\*\}as evaluation metric:

\(4\)Δ​P=Ex∼𝒟​\[Ppatched​\(ycf∣x\)−Pcorrupt​\(ycf∣x\)\]\\Delta P=\\mathrm\{E\}\_\{x\\sim\\mathcal\{D\}\}\\left\[P\_\{\\text\{patched\}\}\(y\_\{\\text\{cf\}\}\\mid x\)\-P\_\{\\text\{corrupt\}\}\(y\_\{\\text\{cf\}\}\\mid x\)\\right\]wherePpatched​\(ycf∣x\)P\_\{\\text\{patched\}\}\(y\_\{\\text\{cf\}\}\\mid x\)is the probability assigned to thecounterfactual labelycfy\_\{\\text\{cf\}\}under the patched forward pass, andPcorrupt​\(ycf∣x\)P\_\{\\text\{corrupt\}\}\(y\_\{\\text\{cf\}\}\\mid x\)is the corresponding probability under the corrupt forward pass\. A higherΔ​P\\Delta Pindicates stronger causal contribution of the patched components to the model’s ability to predict the correct label\.

### 5\.3\.Results

Figure[5](https://arxiv.org/html/2608.18419#S5.F5)presents the results of the patching experiment conducted on 100 data instances with zero MAE to ensure a strong response signal\. We observe a significant increase in the probability difference score \(Δ​P\\Delta P\), highlighted in red in Figure[5](https://arxiv.org/html/2608.18419#S5.F5), at the 27thtoken position, beginning from layer 14 onward\. This indicates that, from layer 15 onward, the query vector of the final token \(position 58\) causally interacts with the hidden state at position 27\. The arithmetic operation is highly localized: only at these layers does the model cleanly separate the corrupt final number and compose it with the correct first difference\. Earlier interventions disrupt this alignment due to representational entanglement between the corrupt and patched sequences, which impairs computation\.

This finding supports the hypothesis that the model performs induction over first differences by locating and copying a locally stored delta representation—analogous to the \[A\]\[B\]…\[A\]\[?\] pattern discussed in\([4](https://arxiv.org/html/2608.18419#bib.bib12)\)—that follows the final observed one, though this behavior operates at a structural rather than token level\. The arithmetic operation that follows induction—adding the copied delta to the final number at position 57 to generate the next token—is generalizable, as the model performs it even in the absence of a guiding algorithm in the corrupt sequence\. This confirms that the model engages in both induction and arithmetic composition in numerical sequence extrapolation\.

![Refer to caption](https://arxiv.org/html/2608.18419v1/AllTokens.png)Figure 5\.Heatmap of probability difference scores \(Δ​P\\Delta P\) across layers and token positions, following patching of the final query vector from layersl\+1l\{\+\}1toLLand hidden states from layerslltoLL\. A sharp causal effect emerges at token 27, highlighted in red, indicating that the final query attends to position 27 to retrieve the locally stored first difference that follows the last observed one\.

## 6\.Can the Model Identify Functionally Critical Tokens for Delta Retrieval and Extrapolation?

Although previous experiments demonstrate that the model stores first differences in localized representations and retrieves the appropriate ones for arithmetic composition, they do not tell if the model uncovers the underlying algorithm\. In particular, uncovering requires identifying the onset of a repeating pattern, aligning it with the final observed difference, and selecting the correct delta to apply\. To investigate this, we use patching to isolate the causal contribution of each attention head and assess which heads drive successful extrapolation by routing value from appropriate positions\.

### Patching Setup

We use the same clean and corrupt sequences described in the previous section, where the clean input contains a repeating first\-difference pattern and the corrupt input is a flat sequence of 100s\. The target counterfactual label remains:ycf=100\+Δ∗y\_\{\\text\{cf\}\}=100\+\\Delta^\{\*\}\.

LetQs\(l,h\)Q\_\{s\}^\{\(l,h\)\},Kt\(l,h\)K\_\{t\}^\{\(l,h\)\},Vt\(l,h\)V\_\{t\}^\{\(l,h\)\}, andWO\(l,h\)W\_\{O\}^\{\(l,h\)\}denote the query, key, value vectors, and output projection matrix for head\(l,h\)\(l,h\)in layerllat tokenssattending to token positionstt\. The attention weights at head\(l,h\)\(l,h\)are computed as:

αt,s\(l,h\)=softmax⁡\(\(Qs\(l,h\)\)⊤​Kt\(l,h\)dh\)\\alpha\_\{t,s\}^\{\(l,h\)\}=\\mathrm\{softmax\}\\left\(\\frac\{\(Q\_\{s\}^\{\(l,h\)\}\)^\{\\top\}K\_\{t\}^\{\(l,h\)\}\}\{\\sqrt\{d\_\{h\}\}\}\\right\)
The corresponding output of attention head\(l,h\)\(l,h\)at tokenttis:

zs\(l,h\)=WO\(l,h\)​\(∑t=1Tαt,s\(l,h\)⋅Vt\(l,h\)\)z\_\{s\}^\{\(l,h\)\}=W\_\{O\}^\{\(l,h\)\}\\left\(\\sum\_\{t=1\}^\{T\}\\alpha\_\{t,s\}^\{\(l,h\)\}\\cdot V\_\{t\}^\{\(l,h\)\}\\right\)
To evaluate the causal effect of head\(l,h\)\(l,h\)at the final token positions=58s=58, we patch just its output, as we illustrate in Figure[9](https://arxiv.org/html/2608.18419#A1.F9)in the appendix , from the clean run into the corrupt run:

z58corrupt,\(l,h\)←z58clean,\(l,h\)z\_\{58\}^\{\\mathrm\{corrupt\},\(l,h\)\}\\leftarrow z\_\{58\}^\{\\mathrm\{clean\},\(l,h\)\}
This setup isolates the contribution of a single attention head by substituting its output at the final token while preserving the rest of the corrupt context\.

### 6\.1\.Causal Metric

To determine which tokens most significantly contribute to the model’s prediction, we construct a profile of attention heads that integrates two key signals: \(1\) thecausal effectof each head, and \(2\) thevalue\-weighted attention massit allocates across token positions\. We compute the causal effect as the change in the model’s predicted probability for the counterfactual label when we patch head’s output at positions=58s=58from the clean to the corrupt run, as we describe in the previous section\. The second component—the value\-weighted attention— identifies how much of its value is added to the residual stream through this head\.

We define the token importance scoreTIt\\mathrm\{TI\}\_\{t\}as:

\(5\)TIt=1N​∑n=1Nλn\(l,h\)⋅wn,t\(l,h\),\\small\\mathrm\{TI\}\_\{t\}=\\frac\{1\}\{N\}\\sum\_\{n=1\}^\{N\}\\lambda\_\{n\}^\{\(l,h\)\}\\cdot w\_\{n,t\}^\{\(l,h\)\},whereNNis the number of evaluation samples,λn\(l,h\)=Ppatched​\(ycf∣xn\)−Pcorrupt​\(ycf∣xn\)\\lambda\_\{n\}^\{\(l,h\)\}=P\_\{\\mathrm\{patched\}\}\(y\_\{\\mathrm\{cf\}\}\\mid x\_\{n\}\)\-P\_\{\\mathrm\{corrupt\}\}\(y\_\{\\mathrm\{cf\}\}\\mid x\_\{n\}\)is the causal effect of patching head\(l,h\)\(l,h\)in samplenn, andwn,t\(l,h\)w\_\{n,t\}^\{\(l,h\)\}is the value\-weighted attention score at the attended positiontt\. The value\-weighted attention scorewn,t\(l,h\)w\_\{n,t\}^\{\(l,h\)\}is defined using the attention weights and value norms:

\(6\)wn,t\(l,h\)=αt,s\(l,h\)⋅‖Vt\(l,h\)‖2,w\_\{n,t\}^\{\(l,h\)\}=\\alpha\_\{t,s\}^\{\(l,h\)\}\\cdot\\left\\\|V\_\{t\}^\{\(l,h\)\}\\right\\\|\_\{2\},
This metricTIt\\mathrm\{TI\}\_\{t\}weights causal influence with value\-aware attention, providing a principled measure of token\-level functional relevance to the model’s output\.

### 6\.2\.Results

Figure[6](https://arxiv.org/html/2608.18419#S6.F6)presents the results of the causal attention\-based analysis over 100 sequences with zero MAE, and the top five most relevant tokens are identified as positions 57, 33, 27, 55, and 25\. As we show in Table[1](https://arxiv.org/html/2608.18419#S3.T1), these correspond to the critical points that the model needs for identification and extrapolation of the pattern: the final number \(57\), the onset of the repeating delta pattern \(33\), the delta that gets added to the final value \(27\), the number that the model needs to compute the last delta \(55\), and a token \(25\) that both matches the final delta and enables retrieval of the next one\.

These results also suggest the model emphasizes tokens that support first\-difference alignment, with token 27 playing a key role in extrapolation\. The pattern of attention supports the hypothesis that the model recognizes the pattern and must have first used the final first difference as a retrieval anchor to locate the appropriate delta, and, upon recognizing the repeating structure, may further leverage phase alignment and positional encoding to guide delta selection\.

![Refer to caption](https://arxiv.org/html/2608.18419v1/TokenImportancePaperReady.png)Figure 6\.Token importance scores \(TIt\\mathrm\{TI\}\_\{t\}\) across sequence positions\. Peaks highlight the model’s use of structural alignment for pattern detection and delta retrieval\.

## 7\.Does the Model Prioritize Delta Induction Over Positional Cues?

Prior experiments demonstrate that the model stores and composes first differences to extrapolate future values\. However, they do not reveal whether retrieval is governed by semantic identity of delta or by its positional and phase\-based alignment in input\.

To investigate this, we perform a key swapping intervention between the 27thand 25thtokens—two positions with high and comparable importance scores as shown in Figure[6](https://arxiv.org/html/2608.18419#S6.F6)\.

### 7\.1\.Rotary Position Embedding \(RoPE\)

Letx∈𝐑dx\\in\\mathbf\{R\}^\{d\}denote an input vector, whereddis even\. Following the formulation introduced by \(Su et al\. 2024\)\([29](https://arxiv.org/html/2608.18419#bib.bib19)\), we partitionxxintod/2d/2adjacent 2D pairs:

x=\[\(x1\(1\),x1\(2\)\),\(x2\(1\),x2\(2\)\),…,\(xd/2\(1\),xd/2\(2\)\)\]x=\\left\[\\,\(x\_\{1\}^\{\(1\)\},x\_\{1\}^\{\(2\)\}\),\\,\(x\_\{2\}^\{\(1\)\},x\_\{2\}^\{\(2\)\}\),\\,\\dots,\\,\(x\_\{d/2\}^\{\(1\)\},x\_\{d/2\}^\{\(2\)\}\)\\,\\right\]
LetWq,Wk∈𝐑d×dW\_\{q\},W\_\{k\}\\in\\mathbf\{R\}^\{d\\times d\}be the query and key projection matrices\. For positionmm, the RoPE\-transformed query is:

Qm=RoPE​\(Wq​x,m\)=⨁i=1d/2R⁡\(m​θi\)​\(Wq​x\)iQ\_\{m\}=\\text\{RoPE\}\(W\_\{q\}x,m\)=\\bigoplus\_\{i=1\}^\{d/2\}R\(m\\theta\_\{i\}\)\\,\(W\_\{q\}x\)\_\{i\}and similarly, for positionnn, the RoPE\-transformed key is:

Kn=RoPE​\(Wk​x,n\)=⨁i=1d/2R⁡\(n​θi\)​\(Wk​x\)iK\_\{n\}=\\text\{RoPE\}\(W\_\{k\}x,n\)=\\bigoplus\_\{i=1\}^\{d/2\}R\(n\\theta\_\{i\}\)\\,\(W\_\{k\}x\)\_\{i\}
Here,R⁡\(m​θi\)R\(m\\theta\_\{i\}\)is a 2D rotation matrix applied to theii\-th 2D component:

R⁡\(m​θi\)=\[cos⁡\(m​θi\)−sin⁡\(m​θi\)sin⁡\(m​θi\)cos⁡\(m​θi\)\]R\(m\\theta\_\{i\}\)=\\begin\{bmatrix\}\\cos\(m\\theta\_\{i\}\)&\-\\sin\(m\\theta\_\{i\}\)\\\\ \\sin\(m\\theta\_\{i\}\)&\\cos\(m\\theta\_\{i\}\)\\end\{bmatrix\}
Here,R⁡\(n​θi\)R\(n\\theta\_\{i\}\)is a 2D rotation matrix applied to theii\-th 2D component:

R⁡\(n​θi\)=\[cos⁡\(n​θi\)−sin⁡\(n​θi\)sin⁡\(n​θi\)cos⁡\(n​θi\)\]R\(n\\theta\_\{i\}\)=\\begin\{bmatrix\}\\cos\(n\\theta\_\{i\}\)&\-\\sin\(n\\theta\_\{i\}\)\\\\ \\sin\(n\\theta\_\{i\}\)&\\cos\(n\\theta\_\{i\}\)\\end\{bmatrix\}The operator⨁\\bigoplusdenotes vector concatenation across thed/2d/2rotated 2D components:

⨁i=1d/2vi=\[v1;v2;…;vd/2\]\\bigoplus\_\{i=1\}^\{d/2\}v\_\{i\}=\[v\_\{1\};\\,v\_\{2\};\\,\\dots;\\,v\_\{d/2\}\]where eachvi∈𝐑2v\_\{i\}\\in\\mathbf\{R\}^\{2\}, yielding a final vector in𝐑d\\mathbf\{R\}^\{d\}\.

The query and key vectors are independently rotated using their respective absolute positionsmmandnn, and the relative positional information gets encoded through their dot productQm⊤​KnQ\_\{m\}^\{\\top\}K\_\{n\}\.

### 7\.2\.Patching Setup

LLaMA 3\.1\-8B uses rotary position embedding \(RoPE\)\([29](https://arxiv.org/html/2608.18419#bib.bib19)\)where positional information is local to key and query\. We swap KeysK27clean,\(l:L\)↔K25clean,\(l:L\)K\_\{27\}^\{\\text\{clean\},\(l:L\)\}\\leftrightarrow K\_\{25\}^\{\\text\{clean\},\(l:L\)\}in layerlland all subsequent layers to redirect positional and phase\-based cues while preservingV27clean,\(l:L\)V\_\{27\}^\{\\text\{clean\},\(l:L\)\}andV25clean,\(l:L\)V\_\{25\}^\{\\text\{clean\},\(l:L\)\}by patching the values from the original run to maintain their first difference content across layersl\+1l\+1throughLL, as we illustrate in Figure[10](https://arxiv.org/html/2608.18419#A1.F10)in the appendix\. This setup attempts to disentangle two types of cues bound to the delta representation\.

### 7\.3\.Causal Metric

To quantify the causal impact of an intervention, we measure the change in the model’s confidence for both the counterfactual labelycf=x29\+Δ25y\_\{\\text\{cf\}\}=x\_\{29\}\+\\Delta\_\{25\}and the ground truth labelygt=x29\+Δ27y\_\{\\text\{gt\}\}=x\_\{29\}\+\\Delta\_\{27\}\. The causal effect on the counterfactual label is defined as:

\(7\)Δ​Pcf=Ex∼𝒟​\[Ppatched​\(ycf∣x\)−Pcorrupt​\(ycf∣x\)\],\\Delta P\_\{\\text\{cf\}\}=\\mathrm\{E\}\_\{x\\sim\\mathcal\{D\}\}\\left\[P\_\{\\text\{patched\}\}\(y\_\{\\text\{cf\}\}\\mid x\)\-P\_\{\\text\{corrupt\}\}\(y\_\{\\text\{cf\}\}\\mid x\)\\right\],and for the ground truth label:

\(8\)Δ​Pgt=Ex∼𝒟​\[Ppatched​\(ygt∣x\)−Pcorrupt​\(ygt∣x\)\]\.\\Delta P\_\{\\text\{gt\}\}=\\mathrm\{E\}\_\{x\\sim\\mathcal\{D\}\}\\left\[P\_\{\\text\{patched\}\}\(y\_\{\\text\{gt\}\}\\mid x\)\-P\_\{\\text\{corrupt\}\}\(y\_\{\\text\{gt\}\}\\mid x\)\\right\]\.
We also report the absolute probabilities assigned after the intervention:Ppatched​\(ycf∣x\)P\_\{\\text\{patched\}\}\(y\_\{\\text\{cf\}\}\\mid x\)andPpatched​\(ygt∣x\)P\_\{\\text\{patched\}\}\(y\_\{\\text\{gt\}\}\\mid x\)\. These metrics together capture both the direction and magnitude of the model’s response to the intervention\.

### 7\.4\.Results

Figure[7](https://arxiv.org/html/2608.18419#S7.F7)presents the probability difference following the key\-swapping interventionK27clean,\(l:L\)↔K25clean,\(l:L\)K\_\{27\}^\{\\text\{clean\},\(l:L\)\}\\leftrightarrow K\_\{25\}^\{\\text\{clean\},\(l:L\)\}that we conduct over 100 instances with zero MAE\. The intervention leads to a significant increase inΔ​Pcf\\Delta P\_\{\\text\{cf\}\}and a corresponding drop inΔ​Pgt\\Delta P\_\{\\text\{gt\}\}, suggesting that phase or position\-based cues contribute meaningfully for delta retrieval and composition\. However, as shown in Figure[8](https://arxiv.org/html/2608.18419#S7.F8), which reports the absolute probabilities after intervention, the drop inPpatched​\(ygt\)P\_\{\\text\{patched\}\}\(y\_\{\\text\{gt\}\}\)was not sufficient forPpatched​\(ycf\)P\_\{\\text\{patched\}\}\(y\_\{\\text\{cf\}\}\)to overtake it\. This indicates that although key\-based redirection influences the model’s behavior, it is ultimately not strong enough to override the original delta\-based composition since the value vector must contain information that this first difference comes after the last observed one\. The model’s affinity for delta\-based composition supports the hypothesis that it first performed induction over first differences to learn the underlying structure: internally simulated the composition process, and identified the correct algorithm, potentially refining it through phase\-based alignment\.

![Refer to caption](https://arxiv.org/html/2608.18419v1/PaperReadyProbDiffKVCorr.png)Figure 7\.Shows key\-swap intervention shifts confidence from ground truth to counterfactual, revealing the role of position\-aware attention alignment in delta retrieval\.![Refer to caption](https://arxiv.org/html/2608.18419v1/PaperReadyProbKVCORR.png)Figure 8\.Shows ground truth remains more probable post key\-swap, indicating the model prioritizes delta\-based composition over redirected attention\.

## 8\.Conclusion

This work demonstrates the LLM, despite not being explicitly trained for high\-precision numerical tasks, exhibit an emergent ability to perform structural extrapolation in numerical sequences without any explicit supervision\. We show that the LLM is capable of recognizing trends, inferring position\-dependent rules encoded as distinct first differences, and systematically composing these rules to generate accurate predictions over evolving input sequences\. Our analyses reveal that the LLM exhibit reasoning behaviors, operating over latent structure\. Patching provided strong evidence that the model identifies numerical patterns, computes first differences even before recurring structures emerge, stores these differences locally, and later retrieves them to generate accurate predictions\. Probing confirmed that the observed effects are not incidental but reflect functional computations over structured internal representations\.

We believe these findings would invite future work on extending these insights to other reasoning tasks where latent structure plays a critical role\.

## References

- Akyüreket al\.\(2022\)E\. Akyürek, D\. Schuurmans, J\. Andreas, T\. Ma, and D\. ZhouWhat learning algorithm is in\-context learning? investigations with linear models\.arXiv preprint arXiv:2211\.15661\.Cited by:[§2](https://arxiv.org/html/2608.18419#S2.p2.1)\.
- Bubecket al\.\(2023\)S\. Bubeck, V\. Chandrasekaran, R\. Eldan, J\. Gehrke, E\. Horvitz, E\. Kamar, P\. Lee, Y\. T\. Lee, Y\. Li, S\. Lundberg,et al\.Sparks of artificial general intelligence: early experiments with gpt\-4\.arXiv preprint arXiv:2303\.12712\.Cited by:[§1](https://arxiv.org/html/2608.18419#S1.p1.1)\.
- Dumaset al\.\(2024\)C\. Dumas, V\. Veselovsky, G\. Monea, R\. West, and C\. WendlerHow do llamas process multilingual text? a latent exploration through activation patching\.InICML 2024 Workshop on Mechanistic Interpretability,Cited by:[§5\.1](https://arxiv.org/html/2608.18419#S5.SS1.p2.1),[§5](https://arxiv.org/html/2608.18419#S5.p2.1)\.
- Elhageet al\.\(2021\)N\. Elhage, N\. Nanda, C\. Olsson, T\. Henighan, N\. Joseph, B\. Mann, A\. Askell, Y\. Bai, A\. Chen, T\. Conerly, N\. DasSarma, D\. Drain, D\. Ganguli, Z\. Hatfield\-Dodds, D\. Hernandez, A\. Jones, J\. Kernion, L\. Lovitt, K\. Ndousse, D\. Amodei, T\. Brown, J\. Clark, J\. Kaplan, S\. McCandlish, and C\. OlahA mathematical framework for transformer circuits\.Transformer Circuits Thread\.Note:https://transformer\-circuits\.pub/2021/framework/index\.htmlCited by:[§1](https://arxiv.org/html/2608.18419#S1.p3.1),[§5\.3](https://arxiv.org/html/2608.18419#S5.SS3.p2.1)\.
- Finlaysonet al\.\(2021\)M\. Finlayson, A\. Mueller, S\. Gehrmann, S\. Shieber, T\. Linzen, and Y\. BelinkovCausal analysis of syntactic agreement mechanisms in neural language models\.arXiv preprint arXiv:2106\.06087\.Cited by:[§5](https://arxiv.org/html/2608.18419#S5.p2.1)\.
- Fiotto\-Kaufmanet al\.\(2024\)J\. Fiotto\-Kaufman, A\. R\. Loftus, E\. Todd, J\. Brinkmann, C\. Juang, K\. Pal, C\. Rager, A\. Mueller, S\. Marks, A\. S\. Sharma, F\. Lucchetti, M\. Ripa, A\. Belfki, N\. Prakash, S\. Multani, C\. Brodley, A\. Guha, J\. Bell, B\. Wallace, and D\. BauNNsight and ndif: democratizing access to foundation model internals\.External Links:2407\.14561,[Link](https://arxiv.org/abs/2407.14561)Cited by:[§3\.3](https://arxiv.org/html/2608.18419#S3.SS3.p1.1)\.
- Garza and Mergenthaler\-Canseco \(2023\)A\. Garza and M\. Mergenthaler\-CansecoTimeGPT\-1\.arXiv preprint arXiv:2310\.03589\.Cited by:[§2](https://arxiv.org/html/2608.18419#S2.p1.1)\.
- Goldowsky\-Dillet al\.\(2023\)N\. Goldowsky\-Dill, C\. MacLeod, L\. Sato, and A\. AroraLocalizing model behavior with path patching\.arXiv preprint arXiv:2304\.05969\.Cited by:[§5](https://arxiv.org/html/2608.18419#S5.p2.1)\.
- Grattafioriet al\.\(2024\)A\. Grattafiori, A\. Dubey, A\. Jauhri, A\. Pandey, A\. Kadian,et al\.The llama 3 herd of models\.External Links:2407\.21783,[Link](https://arxiv.org/abs/2407.21783)Cited by:[§3\.2](https://arxiv.org/html/2608.18419#S3.SS2.p1.1)\.
- Gruveret al\.\(2024\)N\. Gruver, M\. Finzi, S\. Qiu, and A\. G\. WilsonLarge language models are zero\-shot time series forecasters\.Advances in Neural Information Processing Systems36\.Cited by:[§2](https://arxiv.org/html/2608.18419#S2.p1.1)\.
- Guanet al\.\(2021\)H\. Guan, S\. Liu, X\. Ma, W\. Niu, B\. Ren, X\. Shen, Y\. Wang, and P\. ZhaoCoCoPIE: enabling real\-time ai on off\-the\-shelf mobile devices via compression\-compilation co\-design\.Communications of the ACM64\(6\),pp\. 62–68\.Cited by:[§2](https://arxiv.org/html/2608.18419#S2.p1.1)\.
- Kantamneniet al\.\(2024\)S\. Kantamneni, Z\. Liu, and M\. TegmarkHow do transformers" do" physics? investigating the simple harmonic oscillator\.arXiv preprint arXiv:2405\.17209\.Cited by:[§2](https://arxiv.org/html/2608.18419#S2.p2.1)\.
- Lanet al\.\(2023\)M\. Lan, P\. Torr, and F\. BarezTowards interpretable sequence continuation: analyzing shared circuits in large language models\.arXiv preprint arXiv:2311\.04131\.Cited by:[§2](https://arxiv.org/html/2608.18419#S2.p2.1)\.
- Liet al\.\(2023\)Y\. Li, C\. Yang, P\. Zhao,et al\.Towards real\-time segmentation on the edge\.AAAI’23/IAAI’23/EAAI’23\.External Links:ISBN 978\-1\-57735\-880\-0,[Link](https://doi.org/10.1609/aaai.v37i2.25232),[Document](https://dx.doi.org/10.1609/aaai.v37i2.25232)Cited by:[§2](https://arxiv.org/html/2608.18419#S2.p1.1)\.
- Liet al\.\(2022\)Y\. Li, P\. Zhao, G\. Yuan, X\. Lin, Y\. Wang, and X\. ChenPruning\-as\-search: efficient neural architecture search via channel pruning and structural reparameterization\.arXiv preprint arXiv:2206\.01198\.Cited by:[§2](https://arxiv.org/html/2608.18419#S2.p1.1)\.
- Linet al\.\(2025\)J\. Lin, A\. Taherin, A\. Akbari, A\. Akbari,et al\.Vote: vision\-language\-action optimization with trajectory ensemble voting\.arXiv preprint arXiv:2507\.05116\.Cited by:[§2](https://arxiv.org/html/2608.18419#S2.p1.1)\.
- Liuet al\.\(2025\)J\. Liu, Z\. Kong, P\. Dong, C\. Yang,et al\.Structured agent distillation for large language model\.arXiv preprint arXiv:2505\.13820\.Cited by:[§2](https://arxiv.org/html/2608.18419#S2.p1.1)\.
- Menget al\.\(2022\)K\. Meng, D\. Bau, A\. Andonian, and Y\. BelinkovLocating and editing factual associations in gpt\.Advances in Neural Information Processing Systems35,pp\. 17359–17372\.Cited by:[§5](https://arxiv.org/html/2608.18419#S5.p2.1)\.
- Mirchandaniet al\.\(2023\)S\. Mirchandani, F\. Xia, P\. Florence, B\. Ichter, D\. Driess, M\. G\. Arenas, K\. Rao, D\. Sadigh, and A\. ZengLarge language models as general pattern machines\.arXiv preprint arXiv:2307\.04721\.Cited by:[§1](https://arxiv.org/html/2608.18419#S1.p1.1),[§2](https://arxiv.org/html/2608.18419#S2.p1.1)\.
- Rasulet al\.\(2023\)K\. Rasul, A\. Ashok, A\. R\. Williams, A\. Khorasani, G\. Adamopoulos, R\. Bhagwatkar, M\. Biloš, H\. Ghonia, N\. Hassen, A\. Schneider,et al\.Lag\-llama: towards foundation models for time series forecasting\.InR0\-FoMo: Robustness of Few\-shot and Zero\-shot Learning in Large Foundation Models,Cited by:[§2](https://arxiv.org/html/2608.18419#S2.p1.1)\.
- Shenet al\.\(2025a\)X\. Shen, C\. Han, Y\. Zhou,et al\.DraftAttention: fast video diffusion via low\-resolution attention guidance\.arXiv preprint arXiv:2505\.14708\.Cited by:[§1](https://arxiv.org/html/2608.18419#S1.p2.1)\.
- Shenet al\.\(2025b\)X\. Shen, W\. Ma, J\. Liu,et al\.QuartDepth: post\-training quantization for real\-time depth estimation on the edge\.InCVPR,Cited by:[§1](https://arxiv.org/html/2608.18419#S1.p2.1)\.
- Shenet al\.\(2026\)X\. Shen, W\. Ma, Y\. Zhou,et al\.Fastcar: cache attentive replay for fast auto\-regressive video generation on the edge\.InICLR,Cited by:[§1](https://arxiv.org/html/2608.18419#S1.p2.1)\.
- Shenet al\.\(2025c\)X\. Shen, Z\. Song, Y\. Zhou,et al\.Lazydit: lazy learning for the acceleration of diffusion transformers\.InAAAI,Cited by:[§1](https://arxiv.org/html/2608.18419#S1.p2.1)\.
- Shenet al\.\(2025d\)X\. Shen, Z\. Song, Y\. Zhou,et al\.Numerical pruning for efficient autoregressive models\.InAAAI,Cited by:[§1](https://arxiv.org/html/2608.18419#S1.p1.1),[§1](https://arxiv.org/html/2608.18419#S1.p2.1)\.
- Shenet al\.\(2025e\)X\. Shen Y\. Wanget al\.Efficient reasoning with hidden thinking\.arXiv preprint arXiv:2501\.19201\.Cited by:[§1](https://arxiv.org/html/2608.18419#S1.p2.1)\.
- Shenet al\.\(2024\)X\. Shen, P\. Zhao, Y\. Gong, Z\. Kong, Z\. Zhan, Y\. Wu, M\. Lin, C\. Wu, X\. Lin, and Y\. WangSearch for efficient large language models\.InNeurIPS,Cited by:[§1](https://arxiv.org/html/2608.18419#S1.p1.1)\.
- Shenet al\.\(2025f\)X\. Shen, H\. Zheng, Y\. Gong,et al\.Sparse learning for state space models on mobile\.InICLR,External Links:[Link](https://openreview.net/forum?id=t8KLjiFNwn)Cited by:[§1](https://arxiv.org/html/2608.18419#S1.p2.1)\.
- Suet al\.\(2024\)J\. Su, M\. Ahmed, Y\. Lu, S\. Pan, W\. Bo, and Y\. LiuRoformer: enhanced transformer with rotary position embedding\.Neurocomputing568,pp\. 127063\.Cited by:[§7\.1](https://arxiv.org/html/2608.18419#S7.SS1.p1.1),[§7\.2](https://arxiv.org/html/2608.18419#S7.SS2.p1.1)\.
- Vaswani \(2017\)A\. VaswaniAttention is all you need\.Advances in Neural Information Processing Systems\.Cited by:[§3\.2](https://arxiv.org/html/2608.18419#S3.SS2.p1.1)\.
- Viget al\.\(2020\)J\. Vig, S\. Gehrmann, Y\. Belinkov, S\. Qian, D\. Nevo, Y\. Singer, and S\. ShieberInvestigating gender bias in language models using causal mediation analysis\.Advances in neural information processing systems33,pp\. 12388–12401\.Cited by:[§5](https://arxiv.org/html/2608.18419#S5.p2.1)\.
- Wanget al\.\(2023\)K\. R\. Wang, A\. Variengien, A\. Conmy, B\. Shlegeris, and J\. SteinhardtInterpretability in the wild: a circuit for indirect object identification in GPT\-2 small\.InThe Eleventh International Conference on Learning Representations,External Links:[Link](https://openreview.net/forum?id=NpsVSN6o4ul)Cited by:[§5](https://arxiv.org/html/2608.18419#S5.p2.1)\.
- Wanget al\.\(2018\)S\. Wang, X\. Wang, S\. Ye, P\. Zhao, and X\. LinDefending dnn adversarial attacks with pruning and logits augmentation\.In2018 IEEE Global Conference on Signal and Information Processing \(GlobalSIP\),pp\. 1144–1148\.Cited by:[§2](https://arxiv.org/html/2608.18419#S2.p1.1)\.
- Wuet al\.\(2022\)Y\. Wu, Y\. Gong, P\. Zhao,et al\.Compiler\-aware neural architecture search for on\-mobile real\-time super\-resolution\.InECCV,pp\. 92–111\.Cited by:[§2](https://arxiv.org/html/2608.18419#S2.p1.1)\.
- Yanget al\.\(2023\)C\. Yang, P\. Zhao, Y\. Li,et al\.Pruning parameterization with bi\-level optimization for efficient semantic segmentation on the edge\.InCVPR,Cited by:[§2](https://arxiv.org/html/2608.18419#S2.p1.1)\.
- Zhanet al\.\(2021\)Z\. Zhan, Y\. Gong, P\. Zhao, G\. Yuan,et al\.Achieving on\-mobile real\-time super\-resolution with neural architecture and pruning search\.InICCV,pp\. 4821–4831\.Cited by:[§2](https://arxiv.org/html/2608.18419#S2.p1.1)\.
- Zhanet al\.\(2024a\)Z\. Zhan, Z\. Kong, Y\. Gong,et al\.Exploring token pruning in vision state space models\.InNeurIPS,External Links:[Link](https://openreview.net/forum?id=eWiGn0Fcdx)Cited by:[§1](https://arxiv.org/html/2608.18419#S1.p2.1)\.
- Zhanet al\.\(2024b\)Z\. Zhan, Y\. Wu, Y\. Gong,et al\.Fast and memory\-efficient video diffusion using streamlined inference\.InNeurIPS,External Links:[Link](https://openreview.net/forum?id=iNvXYQrkpi)Cited by:[§1](https://arxiv.org/html/2608.18419#S1.p2.1)\.
- Zhanet al\.\(2024c\)Z\. Zhan, Y\. Wu, Z\. Kong,et al\.Rethinking token reduction for state space models\.InEMNLP,Miami, Florida, USA,pp\. 1686–1697\.External Links:[Link](https://aclanthology.org/2024.emnlp-main.100)Cited by:[§1](https://arxiv.org/html/2608.18419#S1.p1.1)\.
- Zhaoet al\.\(2026a\)L\. Zhao, X\. Jiang, X\. Xiao, Q\. Fan, L\. Lu, Y\. Wang, X\. Lin, O\. Camps, P\. Zhao, and J\. GuHieramp: coarse\-to\-fine autoregressive amplification for generative dataset distillation\.arXiv preprint arXiv:2603\.06932\.Cited by:[§5](https://arxiv.org/html/2608.18419#S5.p2.1)\.
- Zhaoet al\.\(2026b\)L\. Zhao, Y\. Wu, Y\. Gong, Y\. Wang, and P\. ZhaoOmniMem: scalable and adaptive memory retrieval for long video generation\.arXiv preprint arXiv:2605\.30519\.Cited by:[§5](https://arxiv.org/html/2608.18419#S5.p2.1)\.
- Zhaoet al\.\(2025a\)L\. Zhao, Y\. Wu, X\. Jiang, J\. Gu, Y\. Wang, X\. Xu, P\. Zhao, and X\. LinTaming diffusion for dataset distillation with high representativeness\.arXiv preprint arXiv:2505\.18399\.Cited by:[§5](https://arxiv.org/html/2608.18419#S5.p2.1)\.
- Zhaoet al\.\(2025b\)P\. Zhao, D\. Gunawan, X\. Shen, Z\. Zhan,et al\.Efficient and accurate post\-training sparsification of large language models with proximal operators\.InProceedings of the 3rd International Workshop on Rich Media With Generative AI,RichMediaGAI ’25,pp\. 11–19\.External Links:ISBN 9798400720444Cited by:[§2](https://arxiv.org/html/2608.18419#S2.p1.1)\.
- Zhaoet al\.\(2024a\)P\. Zhao, X\. Shen, Z\. Kong, Y\. Shen, S\. Chang, T\. Rupprecht, L\. Lu, E\. Nan, C\. Yang, Y\. He,et al\.Fully open source moxin\-7b technical report\.arXiv preprint arXiv:2412\.06845\.Cited by:[§2](https://arxiv.org/html/2608.18419#S2.p1.1)\.
- Zhaoet al\.\(2024b\)P\. Zhao, F\. Sun, X\. Shen,et al\.Pruning foundation models for high accuracy without retraining\.InFindings of EMNLP 2024,External Links:[Link](https://aclanthology.org/2024.findings-emnlp.566),[Document](https://dx.doi.org/10.18653/v1/2024.findings-emnlp.566)Cited by:[§1](https://arxiv.org/html/2608.18419#S1.p1.1)\.

## Appendix

## Appendix AIllustrating Patching Experiments

![Refer to caption](https://arxiv.org/html/2608.18419v1/Headsdrawio.png)Figure 9\.Illustrates the head\-level patching intervention that we use to isolate the functional role of individual attention heads in pattern recognition and delta retrieval\. The clean sequence \(bottom\) contains structured first\-difference patterns, while the corrupt sequence \(top\) is flat\-valued\. At each layerll, we patch only the output of a single attention head \(at the final token position\) from the clean forward pass into the corrupt one \(shown with orange arrow\), while all other heads and components remain unchanged\. This targeted intervention tests whether the selected head causally contribute to the recognition of repeating structure, retrieval of a critical first difference, and contributes to accurate extrapolation in the final prediction\.![Refer to caption](https://arxiv.org/html/2608.18419v1/Key-ValueSwapdrawio.png)Figure 10\.Illustrates the key\-swapping intervention that we use to disentangle the model’s reliance on phase \(positional\) cues versus delta\-based representations during extrapolation\. We swap keys from token positions 25 and 27—both identified as causally important—are swapped from layerllonward \(indicated by orange and gray arrows\), while preserving the respective value vectors from layerllonward\. This setup tests whether the model selects the correct first difference for addition based on the original delta identity stored in the value vector or shifts its prediction in response to the redirected positional cue, thereby revealing its bias toward phase\.

Similar Articles

Exploring Structures in Physics Problems: Can AI Agents Discover Statistical Mechanical Mappings?

arXiv cs.AI

This paper introduces StatMechBench-v0, a benchmark for evaluating whether LLM-based AI agents can discover statistical mechanical mappings from raw partition functions to tractable representations. Results show agents often pass numerical checks while misidentifying underlying structures, highlighting limitations in current LLM reasoning and the need for richer verification.

Are Latent Reasoning Models Easily Interpretable?

Lobsters Hottest

The paper investigates the interpretability of latent reasoning models, finding that reasoning tokens are often unnecessary but can be decoded to reveal interpretable traces when needed, suggesting these models implement expected solutions.