Pith. sign in

REVIEW 3 cited by

Learning to grok: Emergence of in-context learning and skill composition in modular arithmetic tasks

Not yet reviewed by Pith; the record is open.

This paper has not been read by Pith yet. Machine review is queued; the pith claim, tier, and objections will appear here once it completes.

SPECIMEN: schema-true, not a live event

T0 review · schema-true

One-sentence machine reading of the paper's core claim.

pith:XXXXXXXX · record.json · timestamp

arxiv 2406.02550 v2 pith:5CX2PMOI submitted 2024-06-04 cs.LG cond-mat.dis-nnhep-thstat.ML

classification cs.LGcond-mat.dis-nnhep-thstat.ML
keywords tasksin-contextlearningmodelsout-of-distributioncompositiongeneralizationmodular
verification ladder T0 review T1 audit T2 compute T3 formal
0 comments
abstract

Large language models can solve tasks that were not present in the training set. This capability is believed to be due to in-context learning and skill composition. In this work, we study the emergence of in-context learning and skill composition in a collection of modular arithmetic tasks. Specifically, we consider a finite collection of linear modular functions $z = a \, x + b \, y \;\mathrm{mod}\; p$ labeled by the vector $(a, b) \in \mathbb{Z}_p^2$. We use some of these tasks for pre-training and the rest for out-of-distribution testing. We empirically show that a GPT-style transformer exhibits a transition from in-distribution to out-of-distribution generalization as the number of pre-training tasks increases. We find that the smallest model capable of out-of-distribution generalization requires two transformer blocks, while for deeper models, the out-of-distribution generalization phase is \emph{transient}, necessitating early stopping. Finally, we perform an interpretability study of the pre-trained models, revealing highly structured representations in both attention heads and MLPs; and discuss the learned algorithms. Notably, we find an algorithmic shift in deeper models, as we go from few to many in-context examples.

Discussion (0). Continue with ORCID to comment.

Forward citations

Cited by 3 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score. Full citation record

  1. Distinct Computations Emerge From Compositional Curricula in In-Context Learning

    cs.LG 2025-06 conditional novelty 6.0 of 10

    When transformer models see easy component examples before a harder combined math problem in one prompt, they solve unseen versions of the combined problem and store intermediate steps internally, unlike models traine...

  2. Uncovering a Universal Abstract Algorithm for Modular Addition in Neural Networks

    cs.LG 2025-05 conditional novelty 6.0 of 10

    Trained MLPs and transformers solving modular addition can be unified under an approximate Chinese Remainder Theorem, and deep or embedding-based networks learn only O(log n) frequency features.

  3. Spectral Journey: How Transformers Predict the Shortest Path

    cs.LG 2025-02 conditional novelty 5.0 of 10

    Two-layer transformers learn shortest paths on small graphs by building embeddings that correlate with spectral decomposition of the line graph, yielding an approximate spectral path-finding algorithm.

Pith tools