acceptodds
Published as a conference paper at NeurIPS 2026

How do Small Transformer Models Learn Hard Math Tasks?

Eshika Saxena, Kristin E. Lauter
Keywords:
Sydney, Main Track

Reviews

Among:
Shape:
123456this paper, Bottom 49%
Figure 1. Mean review rating of the reviewed papers at NeurIPS 2026. This paper averages 4.33 over 3 reviews, above 49% of the others.
Reviewer_CUmGOpenReview ↗
Rating
5
Clarity
3
Confidence
4
Originality
3
Quality
3
Significance
3
Read review
Summary

This paper presents a experimental evaluation of the behaviour of transformer models trained to solve the Learning With Errors (LWE) problem. In particular, these models are trained to predict a variable bb from a vector a∈RN\mathbf{a} \in \mathbb{R}^N related by b≡a⋅s+ϵmod  qb \equiv \mathbf{a} \cdot \mathrm{s} + \epsilon \mod q where s∈{0,1}N\mathbf{s}\in \{0,1\}^N is called the vector of secrets and ϵ\epsilon is some noise. The goal is to use perturbation techniques (a distinguisher) to obtain s\mathbf{s} from the trained model by observing how changes in the coordinates of a\mathbf{a} affect the output bb.

The experimental evaluation consists on training 30 models with increasing number of coordinates in s\mathbf{s} being =1=1. From these, 13 are able to recover the secret vectors, and 17 are not. With these models, the authors observe the following phenomena:

  • Accuracy of the models during training does not correlate with their ability to recover the secrets
  • Linear probes trained on the embeddings of the last layer show slightly better performance distinguishing between coordinates 1≤j≤N1 \leq j \leq N that correspond to zj=1\mathbf{z}_j=1 (secret) or zj=0\mathbf{z}_j=0 (no secret), and a finer cluster where we additionally add whether the coordinates are in the cruel or cool regions (something related to the preprocessing of the data) in the models that recover the secret
  • A study of feature importance based on the MaxPool before the linear embedding layers that reduces dimensionality to 2, shows a slight increase in importance in the secret coordinates for the classification
  • In my opinion, the biggest contribution of the paper: a PCA accross layers that shows that the clustering patter between secret and non-secret coordinates appears just before the embedding layer, and in fact the transformer obfuscates this clusters (all the previous analysis were based on the embeddings in the last layer)
  • In addition, also part of the most important contibution of the paper: the causal test where the coordinates of the positional encodings corresponding to secret positions are zeroed out, and control of random non-secret coordinates are also zeroed out, and then the distinguisher is re run, shows that the first case destroys the performance while the second leaves it mostly unaffected
Strengths and weaknesses

I think this paper is really well written, it was easy to follow and understand even though I am not an expert in this specific problem. From the positioning of the paper, its study seems original and presenting novel insights about an important problem. This use case seems real and meaningful, and the overall quality of this contribution is good in my opinion. In general, all four aspects of quality, clarity, originality and significance are mostly well-covered.

I only have three questions about two of these points where I believe that the paper could be improved (see the Questions below). If these are addresses, and those small weaknesses are fixed, I'd be happy to increase my score.

Questions

In terms of clarity

  1. On my first read, the experimental design of section 4.1 (in particular, lines 179--180) was a bit unclear. I was not sure of what the points of the embeddings represented, and what their dimensionality was. I believe this could be clarified if you explicitly expressed what your point clouds of embeddings represent: if I understood correctly, each point is associated with a coordinate 1≤j≤N1\leq j \leq N, where I think N=256N=256, because each token has an embedding, and then you average the corresponding embedding vectors h(tj(a(k)))∈Rdhiddenh(t_j\mathbf{(a^{(k)})})\in \mathbb{R}^{d_{\mathrm{hidden}}} across K=1000K=1000 samples. I believe that adding a more explicit explanation along these lines would increase the clarity of these experiments.
  2. I was also a bit confused with the explanation of the definition of the attribution scores (line 200): can the attribution of a given coordinate index have several components, depending on how many times pdp_d is the argmax of the column E:,dE_{:,d}? When I read the following sentence for the first time, I didn't fully understand it, because I didn't understand how the positions were related to the definition of the attribution score:

By summing these attribution scores across all dimensions $ d \in 1, . . . , d_{\mathrm{hidden}}$ for each position, we obtain a more accurate measure of which input positions drive the final prediction Maybe you could consider also trying to explain this definition in more detail to clarify this confusion.

Finally, I believe the significance of the cluster analysis could also be improved by answering the following question:

  1. Although the results in tables 2 (performance of linear probes in clustering the last layer embeddings), and 4 (silhouette scores of the clustering of the embedings in the input layer) are better for the models that are able to recover the secret, the improvement in performance is quite small and not very conclusive. For instance, the results of table 2 are almost overlapping, and the silhouette scores of table 4 are around 0, which generally indicates significant overlaps in the clusters and not a very nice clustering structure. How do you interpret these results, and why should we care about these differences even when they are small? Understanding better this point would help improve the significance of these contributions.
Limitations

They are addressed.

Paper formatting concerns

None

Final justification

The authors have addressed my questions and I believe this to be a solid contribution.

Reviewer_BrM4OpenReview ↗
Rating
3
Clarity
3
Confidence
3
Originality
2
Quality
2
Significance
2
Read review
Summary

This paper studies the mechanisms by which encoder-only transformers recover sparse secrets in the LWE problem. The paper then propose an L1-sparse positional embedding to make the recovered secret more directly interpretable from the model parameters.

Strengths and weaknesses

Strength

  • The main finding is surprising and to some extended supported (but not fully). The observation that a model can achieve 0% exact prediction accuracy while still enabling recovery of the secret is interesting. Importantly, the paper do not rely only on qualitative PCA visualizations. The causal ablation in Table 5, where zeroing the positional embeddings at secret positions nearly eliminates recovery while zeroing the same number of random non-secret positions has little effect, provides some intervention-based evidence for the claim.

  • The paper examines the same phenomenon from different aspects, including dimensionality reduction, linear probes, logit attribution, residual-stream tracing, and causal ablation. The fact that these analyses point to a consistent conclusion makes the result more promising. The layer-wise analysis, showing that the relevant structure appears early and becomes less clear through later attention layers, is also interesting.

  • The paper also attempts to close the loop from mechanistic observation to architectural intervention by introducing an L1-sparse positional embedding. This paper not only describes what the model is doing, but also try to design an architecture that makes the mechanism inspectable.

Weaknesses

  • The main concern is that the analysis depends heavily on lattice-reduction preprocessing. The cool/cruel variance asymmetry appears to drive much of the observed structure, so it is difficult to separate what the model learns from what the preprocessing makes easy to detect.

  • The causal intervention only ablates positional embeddings. To support the stronger conclusion that the secret specifically resides there, the paper should include ablations on input embeddings or other relevant components. Otherwise, the result is also consistent with the model simply relying on secret-relevant positions in a broader representation.

  • The four distinct clusters claim seems overstated. In the PCA plots, the cool clusters overlap substantially, and the input stage representation may actually appear most separated, which complicates the narrative that later layers primarily obfuscate the structure.

  • The experimental scope is narrow. The analysis is limited to one parameter regime, sparse binary secrets with Hamming weights 20–22, and settings where SALSA-style recovery already succeeds. It remains unclear whether the mechanism generalizes to harder or more realistic LWE settings.

  • The architectural intervention is weaker than it suggests. The L1 penalty does not isolate the secret in the top-h magnitudes. Secret indices appear mostly in the top-h to top-2h range, while cruel non-secret positions dominate the largest values. The method also assumes knowledge of h, which makes the recovery framing somewhat circular.

  • The proposed intervention combines existing ideas, namely L1 sparsity and magnitude/direction factorization. This is reasonable, but the paper should include ablations removing the sparsity penalty, removing the factorization, and comparing to a standard learnable positional embedding to clarify what each component contributes.

  • Training across 30 secrets is useful, but the qualitative figures appear to be single-seed examples, and there are no same-secret, multiple-initialization studies. Together with the lack of released code, this makes the mechanistic picture harder to fully trust.

Questions

Stated above.

Limitations

The main claim that the secret resides specifically in the positional embeddings feels weak. The analysis does not fully disentangle what the model learns from the signal introduced by lattice-reduction preprocessing, especially the cool/cruel variance asymmetry, and the causal ablation only tests positional embeddings without matched interventions on the input representation or cool/cruel structure. The experimental scope is also narrow: one parameter regime, sparse secrets with Hamming weights 20–22, and only settings where recovery already succeeds. Single-seed figures and unreleased code further limit confidence in robustness. Finally, the L1-sparse intervention is weaker than it suggests. Secret indices fall mostly in the top-h to top-2h range rather than the top-h, and the method assumes prior knowledge of the Hamming weight. Finally, the quality of figures are not great; it is hard to read the legends occasionally.

Paper formatting concerns

None.

Final justification

Explained below in the comment.

Reviewer_UWsTOpenReview ↗
Rating
5
Clarity
3
Confidence
3
Originality
3
Quality
3
Significance
3
Read review
Summary

The paper investigates how encoder models are able to help solve the LWE problem. Using mechanistic interpretability techniques, this paper sheds light on the internal mechanisms of a model trained for this task. The analysis discovers that the LWE secret is stored in the positional embeddings, and the authors further demonstrate this by doing architectural interventions.

Strengths and weaknesses

Strengths:

  • Relevant problem and interesting findings.
  • Solid experimental setup and clean analysis.
  • The intervention experiments are very interesting.

Weakness/Questions:

  • The title of the paper is too broad. The paper investigates a very specific math problem, and it is not clear how these findings would transfer to other math problems, neither does the paper make any attempt to do so. Given this, the title of the paper could be more specific.
  • In Table1, it is unclear what is the eval loss threshold for correctly guessing the secret. does it depend on the magnitude of the noise?
  • Would be interesting to see how the behaviour changes as model size is increased.
Questions

see strength/weakness section

Limitations

yes

Paper formatting concerns

NA

Final justification

I am satisfied by the author response, and support acceptance of this work.

Comments on the paper

1 comment
Meta-review

The paper presents a mechanistic study of how encoder-only transformers can recover sparse LWE secrets despite almost zero exact prediction accuracy. The reviews appear to agree that the main finding is novel. Causal ablation of secret-position positional embeddings is good evidence.

The author feedback should prioritize three issues. Current intervention shows that positional embeddings are causally important. But it seems less clear whether the secret is specifically localized there rather than represented more broadly. Also, the authors should clarify how much of observed structure remains after controlling for asymmetry due to lattice-reduction preprocessing. Last, ℓ1\ell_1 intervention appears to narrow candidate support. But is it justifying the stronger claim of direct secret recovery from parameter inspection?

The experimental scope is narrow, but this is fine for a paper like this if the claims are properly scoped accordingly. A clear response on the three points above plus any of the other points indicated in the reviews, can help a robust discussion.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Discussion (0)

Sign in to comment.