ResearchResearch paperInterpretability · Large Language Models1 source · Oct 12, 2026

Counting with Attention and LayerNorm: Norm Scaling and Representation Geometry

We study the cost of counting in a single attention layer, up to a maximum length $L$, focusing on how softmax attention and layer normalization shape the representation from which the count is recovered.

Key points

  • Counting is a simple task on which transformers can nevertheless fail at long sequence lengths.
  • For regression, we show unnormalized linear attention counts exactly at parameter norms independent of $L$.
  • For softmax attention, regression cannot count exactly with finite parameters; it recovers the count after rounding, but only when the vector parameter norms grow with $L$.
  • Together, our theoretical and empirical findings characterize how self-attention, layer-normalization placement, and read-out choice shape the representation geometry and parameter cost of counting in the minimal single-head architecture studied here.

Sources (1)

  • [1]Counting with Attention and LayerNorm: Norm Scaling and Representation Geometry
    arXiv (AI, ML, NLP, CV, robotics, multi-agent) · Oct 12, 12:09 PM
    We study the cost of counting in a single attention layer, up to a maximum length $L$, focusing on how softmax attention and layer normalization shape the representation from which the count is recovered.
    Counting is a simple task on which transformers can nevertheless fail at long sequence lengths.

Extractive summary: sentences quoted from the sources.

Before this

  1. Oct 12, 2026AReA: Adaptive Receptive-Field Attention for Efficient High-Resolution Diffusion Transformers
  2. Oct 11, 2026autotrust/JEV-35B-NVFP4
  3. Oct 11, 2026History Replays Itself: Unleashing Long-Context Capability in Linear Attention
  4. Oct 10, 2026vllm-sr/d3
  5. Oct 10, 2026BridgeWAM: Bridging Video and Action Experts via Latent Bridge Queries
  6. Oct 9, 2026LiquidAI/LFM2.5-24B-A2B

Related