Lune

ACL Findings2026

Do Transformers Grok Succinct Algorithms? Mechanistic Evidence for Counting Circuits

Yizheng Zhao

Abstract

Recent theory suggests Transformers are inherently succinct, capable of representing recursive algorithms like binary counting over exponential state spaces using constant-size circuits, unlike the exponential bottleneck of RNNs. However, it remains unclear under what conditions gradient-trained Transformers converge to these predicted succinct circuits, or whether they settle for heuristics. We bridge this gap by rigorously testing the Succinctness Hypothesis via mechanistic interpretability on the LARGECOUNTER task. We report a striking dichotomy: shallow Transformers (d = 64) generalize perfectly, whereas massive LSTM baselines (d = 2048) fail completely (< 6% accuracy), empirically validating the succinctness gap. This dichotomy extends to modern state-space models: Mamba and Mamba-2 fail even more catastrophically (< 1.1%), confirming the hierarchy Transformer ≫ LSTM > SSM predicted by formal complexity results. We show this capability is acquired via a grokking phase transition driven by a weightnorm "complexity collapse". Mechanistic analysis reveals the learned circuit aligns precisely with Boolean RASP theory: attention heads utilize Rotary Positional Embeddings (RoPE) for "Same-Bit Lookup", while MLPs act as exact XOR/AND logic gates. Furthermore, we detect analogous "Arithmetic Heads" in pre-trained LLMs (Pythia), suggesting that succinctness is a representational inductive bias that, when activated by sufficient regularization, governs how models learn algorithmic reasoning.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Locating and Editing Factual Associations in GPT cites Language Models are Few-Shot Learners
  • Pythia: A Suite for Analyzing Large Language Models Across Training and Scaling cites Language Models are Few-Shot Learners
  • Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality cites Pythia: A Suite for Analyzing Large Language Models Across Training and Scaling
  • Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality cites Language Models are Few-Shot Learners
  • Training language models to follow instructions with human feedback cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on24

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida et al.NeurIPS 2022 · 24,707 citations
  3. Locating and Editing Factual Associations in GPTKevin Meng, David Bau, Alex Andonian, Yonatan BelinkovNeurIPS 2022 · 3,415 citations
  4. Pythia: A Suite for Analyzing Large Language Models Across Training and ScalingStella Biderman, Hailey Schoelkopf, Quentin Gregory Anthony, Herbie Bradley et al.ICML 2023 · 1,822 citations
  5. Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space DualityTri Dao, Albert GuICML 2024 · 1,407 citations

Related papers

  1. Towards Universality: Studying Mechanistic Similarity Across Language Model ArchitecturesJunxuan Wang, Xuyang Ge, Wentao Shu, Qiong Tang et al.ICLR 2025
  2. What Algorithms can Transformers Learn? A Study in Length GeneralizationHattie Zhou, Arwen Bradley, Etai Littwin, Noam Razin et al.ICLR 2024 · 189 citations
  3. What Happens During the Loss Plateau? Understanding Abrupt Learning in TransformersPulkit Gopalani, Wei HuNeurIPS 2025 · 6 citations
  4. Progress measures for grokking via mechanistic interpretabilityNeel Nanda, Lawrence Chan, Tom Lieberum, Jess Smith et al.ICLR 2023 · 54 citations
  5. Circuit Complexity Bounds for RoPE-based Transformer ArchitectureBo Chen, Xiaoyu Li, Yingyu Liang, Jiangxuan Long et al.EMNLP 2025 · 33 citations
Dusk over the sea between two cliffs drawn in fine vertical lines