# Attention Heads Are Independent and Additive: A Mathematical Framework for Reverse-Engineering Transformers

Original title: A Mathematical Framework for Transformer Circuits (2021)

> Hacker News story 49672365 · language: en · submitted 2026-09-12
> Web version: https://zeli.app/story/49672365
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 104 · by [Bluestein](<https://news.ycombinator.com/user?id=Bluestein>) · 💬 17
[original](<https://transformer-circuits.pub/2021/framework/index.html>) · [HN discussion](<https://news.ycombinator.com/item?id=49672365>)

## Summary

This paper introduces a mathematical framework for mechanistic interpretability of transformer language models, focusing on attention-only models with up to two layers. The authors show that zero-layer transformers model bigram statistics, one-layer transformers are ensembles of bigram and skip-trigram models, and two-layer transformers can implement complex algorithms via composition of attention heads, notably induction heads that explain in-context learning. Key insights include the residual stream as a communication channel, attention heads as independent additive operations, and decomposition into QK and OV circuits. The framework provides a foundation for reverse-engineering larger models.

## Key quote

> We find that specific attention heads that we term “induction heads” can explain in-context learning in these small models, and that these heads only develop in models with at least two attention layers.

## HN discussion (17 comments)

### [myself248](<https://news.ycombinator.com/item?id=49672877>)

> Nothing about B-H curves or magnetization current, must be that other kind of transformer, in that other kind of circuit.

### [_jayhack_](<https://news.ycombinator.com/item?id=49675407>)

> Shocking to me how little interest the general public has in mechinterp given the alien capabilities demonstrated by LLMs - this and the subsequent transformer-circuits.pub publications will be seen as classic, foundational work in a few years

### [amelius](<https://news.ycombinator.com/item?id=49672932>)

> \>  A previous project, the Distill Circuits thread, has attempted to reverse engineer vision models, but so far there hasn’t been a comparable project for transformers or language models.
>
> How successful was that?

---

## Cite

- Page: https://zeli.app/story/49672365
- Date: 2026-09-12
- Source: transformer-circuits.pub (https://transformer-circuits.pub/2021/framework/index.html)
- Hacker News: https://news.ycombinator.com/item?id=49672365

## Other languages

- zh: https://zeli.app/zh/story/49672365 · markdown: https://zeli.app/zh/story/49672365.md
- ja: https://zeli.app/ja/story/49672365 · markdown: https://zeli.app/ja/story/49672365.md
- ko: https://zeli.app/ko/story/49672365 · markdown: https://zeli.app/ko/story/49672365.md
- de: https://zeli.app/de/story/49672365 · markdown: https://zeli.app/de/story/49672365.md
- es: https://zeli.app/es/story/49672365 · markdown: https://zeli.app/es/story/49672365.md
- ru: https://zeli.app/ru/story/49672365 · markdown: https://zeli.app/ru/story/49672365.md
