The Unembedding Bottleneck: A Mechanistic Analysis of Single Digit Counting in LLMs

Satwik Sunnam, Raghav Magazine, Vatsalya Singh, Lavanya Kotha, Xingjian Li, Min XuNeurIPS 2026

TL;DR

Large language models can pass medical licensing exams yet routinely fail to count the letters in a short string—not because they can't do the math, but because they suffer from a geometric case of "tip-of-the-tongue" syndrome. By peering inside the networks, the authors show that LLMs actually compute single-digit counts accurately all the way to the final layer, only for that signal to sit completely perpendicular—and thus invisible—to the vocabulary readout layer. Realigning just ~0.001% of the model’s weights unlocks this trapped knowledge and boosts counting accuracy by up to 80%.

What Problem Does This Paper Address?

It’s one of AI’s strangest paradoxes: state-of-the-art LLMs excel at complex reasoning benchmarks, yet stumble over elementary counting tasks. While previous research has documented when models fail at counting or mapped out internal circuits when they succeed, we have lacked a clear mechanistic explanation of where and why counting breaks down. This paper steps into that gap via mechanistic interpretability—reverse-engineering the model's internal hidden states (the "residual stream") layer by layer to see whether the model fails to compute the count, forgets it mid-way, or simply fails to say it out loud.

Methods

To track the lifecycle of a count from input to output, the authors pair standard tools with a novel diagnostic and repair pipeline:

  • Dual-Metric Signal Tracking: Standard linear probes (lightweight classifiers trained on hidden layers) only tell you if information is present, even if it’s scattered across dozens of dimensions. The authors pair probes with a novel Signal-to-Noise Ratio (SNR) metric along the top principal component (PC1), measuring how concentrated the count signal is along a single dominant direction.
  • Quantifying the Unembedding Bottleneck: At the final layer, an LLM translates hidden states into word probabilities using an unembedding matrix ($W_U$). The authors measure the cosine similarity between the directions where the count lives (found via probes) and the columns of $W_U$ corresponding to the digits 0 through 9.
  • Probe-Informed LoRA: Instead of standard, randomly initialized Low-Rank Adaptation (LoRA), the authors seed the low-rank adapter matrix using the cleanest count directions discovered by their probes at high-SNR layers, surgically rotating only the 10 digit columns of $W_U$ to align with the internal count representation.

Datasets

The authors evaluate six open-weight models (spanning Multi-Head and Grouped-Query Attention, from 1.5B to 13B parameters) across custom synthetic datasets and established benchmarks:

  • Canonical Probing & Repair Sets: 80 controlled 3-shot prompts (counts 0–9) for layer-wise SNR/probe tracking, and 300 seeded prompts for 10-fold cross-validated LoRA training.
Canonical 3-shot counting prompt format
  • Combinatorial Counting Pool: A newly constructed evaluation suite varying target categories (alphabetic, semantic, numeric, symbolic, nonce-words), token pairs, and templates to test three tiers of generalization—from new random seeds (Level 1) to completely unseen token identities (Level 3), plus 20-item sequences for multi-digit stress-testing.
  • Standard Benchmarks: MMLU (5 diverse subjects) and GSM8K (grade-school math) to ensure the surgical edits don't break general reasoning or normal number generation.

Key Insights and Ideas

  • The Signal Disperses, Not Disappears: Early in the network, the count signal concentrates sharply along a single axis (high SNR), then suddenly collapses below noise levels. Yet linear probe accuracy stays high all the way to the end! Why? "Killer heads"—specific attention heads that dump large, unrelated vectors into the residual stream—bury the dominant axis and scatter the count signal across multiple dimensions without erasing it.
Figure 2: Collapse of dominant-axis (PC1) SNR in Llama-2-13B. The SNR along the dom- inant principal axis for both tokens of consider- ation peaks within the first few layers and then collapses below 1
Linear probe accuracy persists across all layers despite SNR collapse
  • Architecture Shapes Geometry: In Multi-Head Attention (MHA) models like Llama-2, the count subspace stays relatively stable across layers. In Grouped-Query Attention (GQA) models like Llama-3, shared key-value heads distribute the "killer head" effect, causing the count subspace to continuously rotate as it moves deeper.
  • The Unembedding Bottleneck: At the final layer, the cosine similarity between the model's internal count directions and the digit columns of $W_U$ is ~0.011—mathematically indistinguishable from two random vectors in high-dimensional space. The model knows the count, but its output readout is looking at a 90-degree angle away from the answer.

Key Results

  • Massive Accuracy Gains: Modifying just ~0.001% of parameters via Probe-Informed LoRA dramatically restores single-digit counting across all six models (Llama-2-7B/13B, Mistral-7B, Llama-3-8B, Qwen2-1.5B, Gemma-2-2B). On unseen sequences (Level 1), Qwen2-1.5B leaps from 0.0% to 81.3%, Llama-2-13B jumps from 4.4% to 82.4%, and Mistral-7B climbs from 29.7% to 90.1%.
  • Out-of-Distribution Generalization: On unseen factor combinations (Level 2), gains reach up to +52.0% (Llama-2-13B), and on completely unseen token pairs (Level 3), models still average a ~25% accuracy boost.
  • Verified Geometric Realignment: Post-LoRA, the average cosine alignment between Llama-2-13B’s internal count directions and $W_U$’s digit columns jumps 16-fold, from 0.018 to 0.292.
  • Zero Collateral Damage: MMLU scores remain virtually identical (within ±0.7%). By pairing the adapter with a parameter-free context-aware inference rule (only applying the corrected $W_U$ when the base model already intends to output a digit), Llama-2-13B preserves its exact 24% baseline accuracy on GSM8K.

Limitations and Future Work

  • Multi-Digit Counting Remains Tough: When tested on sequences up to length 19 (ExLongSeq), the LoRA repair yields much smaller gains (e.g., Llama-2-13B moves from 8.5% to 22.5%, and Gemma-2-2B actually drops from 20.3% to 14.8%). Multi-digit readout likely involves more complex tokenization and representational hurdles left for future work.
  • Single-Step Generation Only: The study focuses strictly on single-forward-pass answers and excludes Chain-of-Thought (CoT) reasoning models that count out loud token-by-token.
  • Static Adapter Over-Eagerness: Without the two-pass context-aware inference rule, unconditionally applying the modified $W_U$ boosts digit probabilities even when text is expected, degrading multi-step math generation like GSM8K. Designing dynamic, self-gating readouts—and hunting for "unembedding bottlenecks" in tasks beyond counting—are prime next steps.

Summary updated

Abstract

Large language models consistently fail at elementary counting tasks despite strong performance on complex reasoning benchmarks. Recent work has characterized counting failures behaviorally or identified circuits through which counting succeeds, but a mechanistic account of where and why counting breaks down remains absent. In this work, we provide such an account by tracing the count signal from embedding to output and identifying the geometric bottleneck that prevents correct readout for single digit counting problems. Using a dual-metric framework combining Signal-to-Noise Ratio (SNR) with linear probing, we show that counting information in models is linearly decodable through the final layer. The failure in counting is not caused by a loss of count information, but by limited accessibility i.e. the digit-token columns of the unembedding matrix $W_U$ are orthogonal to the count subspace in the residual stream, rendering correctly computed counts unreadable at the output. We term this as the **Unembedding Bottleneck** and to causally validate it, we apply a **Probe-Informed LoRA** correction targeting $W_U$, which restores single-digit counting accuracy by up to 80\% across six models while updating only **~0.001\%** of parameters and preserving general capabilities. Our findings reveal a broader class of failure in LLMs where information is internally present but geometrically inaccessible to the output projection
BibTeX
@inproceedings{sunnam2026unembedding,
  author = {Satwik Sunnam and Raghav Magazine and Vatsalya Singh and Lavanya Kotha and Xingjian Li and Min Xu},
  title = {{The Unembedding Bottleneck: A Mechanistic Analysis of Single Digit Counting in LLMs}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=p2sbwRiO7X},
}
Figure