Bigram Subnetworks: Mapping to Next Tokens in Transformer Language Models
Tyler A. Chang, Benjamin K. Bergen
TL;DR
The paper investigates whether a minimal, interpretable circuit underpins next-token predictions in Transformer language models by extracting bigram subnetworks that reproduce P(w_i | w_{i-1}) using a small subset of parameters. Using continuous sparsification, the authors identify subnetworks of roughly 10M non-embedding parameters (about 0.1–0.2% of the model) that achieve $r>0.95$ correlation with bigram behavior across models up to 1B parameters, with the bulk of activity in the first MLP layer. Detailed analyses show these subnetworks recreate key residual-stream dynamics, including the initial transformation from current to next-token space, and they align closely with optimally pruned subnetworks, with ablations causing large drops in performance. This work provides a principled, sparse building block for mechanistic interpretability and suggests a pathway to studying more complex circuits by assembling beyond the minimal bigram subnetwork.
Abstract
In Transformer language models, activation vectors transform from current token embeddings to next token predictions as they pass through the model. To isolate a minimal form of this transformation, we identify language model subnetworks that make bigram predictions, naive next token predictions based only on the current token. We find that bigram subnetworks can be found in fully trained language models up to 1B parameters, and these subnetworks are critical for model performance even when they consist of less than 0.2% of model parameters. Bigram subnetworks are concentrated in the first Transformer MLP layer, and they overlap significantly with subnetworks trained to optimally prune a given model. Mechanistically, the bigram subnetworks often recreate a pattern from the full models where the first layer induces a sharp change that aligns activations with next token predictions rather than current token representations. Our results demonstrate that bigram subnetworks comprise a minimal subset of parameters that are both necessary and sufficient for basic next token predictions in language models, and they help drive the transformation from current to next token activations in the residual stream. These subnetworks can lay a foundation for studying more complex language model circuits by building up from a minimal circuit.
