Research
Prototype Transformer: Towards Language Model Architectures Interpretable by Design
Overview Research area: Language model architecture and mechanistic interpretability (deep learning / NLP). Technical level: Advanced. Scope: The paper introduces the Prototype Transformer (ProtoT), a
- arXiv
- 2602.11852
- Published
- 2026-02-12
- Authors
- Yordan Yordanov, Matteo Forasassi, Bayar Menzat, Ruizhi Wang, Chang Qi, Markus Kaltenberger, Amine M'Charrak, Tommaso Salvatori, Thomas Lukasiewicz
AI summary
Overview
- Research area: Language model architecture and mechanistic interpretability (deep learning / NLP).
- Technical level: Advanced.
- Scope: The paper introduces the Prototype Transformer (ProtoT), an autoregressive language model that swaps standard self-attention for a prototype-based mixer, and reports scaling, generation, GLUE, throughput, interpretability, and robustness results against LLaMA-style, Mamba, and DeltaNet baselines.
What This Paper Is About
State-of-the-art language models produce strong outputs but their internal reasoning is opaque, which undermines trust and contributes to hallucination and deceptive behavior; existing interpretability methods are post-hoc tools applied to architectures that were never designed for interpretability. The authors propose ProtoT, an architecture in which learnable parameter vectors ("prototypes") act as communication channels that aggregate context at different time scales, aiming to make concepts directly inspectable and editable during training rather than recovered after the fact. The goal is a model that stays competitive with linear-cost alternatives while exposing nameable concepts inside its computation.
Key Contributions
-
A prototype-based mixer architecture. ProtoT replaces self-attention with a module where R trainable prototype vectors act as filters for R communication channels, giving linear computational cost in sequence length (versus quadratic for self-attention), with the prefixes cached so token generation runs at constant O(1) compute and memory cost.
-
Evidence that prototypes learn disentangled, nameable concepts. Across abstraction levels, prototypes were found to capture concepts such as entity names, functional words, verbs, composite dates, illnesses, and school-related narratives, and the paper quantifies this against LLaMA attention heads and LLaMA sparse-autoencoder features.
-
Targeted, surgical behavior editing. Interventions on individual prototypes (e.g., re-initialization of a "female" prototype at layer 9, prototype 7) shifted the probability of related words by up to −16.60% for "women", with perplexity changes staying within ±1% in most cases and rarely exceeding 4%.
-
Extensive empirical evaluation. Comparisons on scalability (contexts from 256 to 2048 and a large-scale setting), text-generation Elo, GLUE, training/inference throughput, and robustness to meaning-preserving perturbations.
Main Findings
- Scalability tracks the linear baselines, not LLaMA. At the large-scale setting (hidden size 512, 12 layers, context 512, 339k documents), ProtoT reaches 29.5 test perplexity versus LLaMA 25.8, Mamba 26.5, and DeltaNet 31.5. The authors report ProtoT's relative gap to LLaMA improving from 15.0% to 14.3% worse with scale.
- Long-context scalability is a bottleneck. With other dimensions fixed, ProtoT degrades faster than baselines as context grows (90.5 at default 256, 84.8 at 512, 80.7 at 1024, 83.0 at 2048). Increasing the hidden size (h=512) helps most: 91.6, 76.7, 70.3, 70.2 across the same contexts. Increasing layers (L=12) gives 88.8, 78.0, 71.6, 71.8; increasing prototypes (R=64) gives 91.0, 80.7, 76.3, 76.1. The paper attributes this partly to projecting down to h/2 at the value stream to save compute.
- Text generation favors ProtoT over two baselines. Under an LLM-as-a-judge pairwise protocol converted to Elo scores, ProtoT scores 1021.24 versus LLaMA 975.18, DeltaNet 961.80, and Mamba 1041.79.
- GLUE performance is competitive but not best. LLaMA leads with a GLUE average of 71.6, followed by Mamba at 68.6, ProtoT at 67.6, and DeltaNet at 64.5. ProtoT scores 75.3 on MNLI and 74.8 on MNLI-MM (second-best on both), 90.0 on SST-2, 80.1 on MRPC, 66.2 on STS-B, 53.9 on RTE, 64.6 on WNLI, 64.8 on QQP, 81.8 on QNLI, and 27.7 on CoLA.
- Training throughput sits between Mamba and LLaMA. ProtoT reaches 25.2 and 7.6 it/s at batch sizes 32 and 128, versus Mamba at 11.9 and 3.2 it/s, DeltaNet at 3.5 and 1.8 it/s, and LLaMA at 55.1 and 23.6 it/s. In single-batch autoregressive inference, LLaMA is fastest at short contexts, ProtoT surpasses LLaMA at 32k tokens and beyond, and DeltaNet is fastest at long contexts.
- Prototypes beat LLaMA attention heads and SAE features on interpretability scoring. Using an LLM-based evaluator (GPT-5.1) on a 1–10 scale, ProtoT scores 6.52 ± 1.93 disentanglement, 7.88 ± 2.25 coverage, and 3.86 ± 1.94 themes. LLaMA SAE (top variance) scores 5.91 ± 1.92, 7.86 ± 1.84, 4.33 ± 1.82; LLaMA SAE (top frequency) 5.52 ± 1.81, 7.47 ± 1.88, 4.68 ± 1.82; LLaMA attention heads 5.02 ± 1.28, 6.69 ± 1.84, 5.02 ± 1.55; and a null model 3.20 ± 1.02, 4.03 ± 1.78, 6.97 ± 1.28.
- Concepts organize hierarchically and relate to time scale. Early layers encode more superficial patterns, deeper layers encode composite and abstract semantics, and lower half-life values tend to correspond to local elements such as stop words or punctuation. Half-life is derived as t(1/2)(k) = −ln2 / ln(β_k).
- Read gates anticipate write gates. Read activity consistently peaks one step before write activity, which the authors describe as a "predict and consolidate" pattern (e.g., write gate activating on "protection" while the read gate activates on the preceding token "fall").
- Interventions are concept-specific and low-collateral. Disrupting the "female" prototype L9 P7 decreased the probability of "women" by 16.60%, while disrupting the "male" prototype L9 P18 increased it by 16.95%; the neutral control L9 P2 had negligible impact. Across concepts, the maximum probability changes were −16.60% (women), −10.67% (girls), −21.97% (COVID), −21.54% (New Zealand), and −2.20% (mental); mean changes were −3.13%, −2.36%, −4.52%, −9.96%, and −0.73% respectively. Maximum perplexity changes were +0.29%, +0.29%, +5.58%, +3.47%, and −0.04%.
- Robustness under meaning-preserving noise is mixed. Mamba has the lowest Jensen–Shannon divergence overall (e.g., 0.010 on contractions, 0.005 on spelling), but ProtoT consistently outperforms LLaMA on synonyms, typos, spelling, and morphology (e.g., 0.026 versus 0.063 on spelling; 0.113 versus 0.145 on synonyms). ProtoT lags LLaMA on punctuation (0.398 versus 0.174) but surpasses DeltaNet.
- Prototype routing partly mediates robustness. In the Prototype-Mediated Robustness analysis over 500 pairs per slice, mean PMR was slightly negative for most slices (e.g., −0.093 for abbreviations, −0.027 for contractions) but the fraction of positive cases was roughly 0.5–0.6 for five of seven slices, with JS_clamped below JS_base.
- The authors position ProtoT between Mamba and DeltaNet. Their summary states ProtoT trails LLaMA in perplexity and downstream performance but outperforms it on text generation, and that because of the linear-versus-quadratic compute difference, the linear baselines are the more suitable comparison class. The paper's discussion of the semantics-altering intervention results (gender, negation, number tags) is cut off in the available content, so the authors' interpretation of that table is not reported here.
Methodology in Plain English
ProtoT keeps almost everything from a standard LLaMA-3-style transformer stack: L blocks, each with a mixer and a SwiGLU feed-forward module at an intermediate ratio of about 2.7, RMS pre-layernorm, and skip connections. The one change is the mixer. Instead of tokens attending to each other, R learned prototype vectors (R=32) act as filters. At each position, a write gate computes similarity between the current token and each prototype and uses a softmax over prototypes — not over sequence positions — to decide how much information to write into each of the R channels. A prefix mean aggregates only past positions (strictly j < i), applying an exponential time discount β_k = σ(γ_k) per channel and dividing by the total mass so it becomes a mean rather than a sum. A read gate then reads back from the channels using the similarity between the current token and the prototypes, and the result is projected into the output. Because each channel is a single averaged representation, different meanings competing for the same channel get blurred together, which pressures the model to specialize channels into distinct concepts.
Engineering details include a local convolution of kernel size 5 over the four past tokens plus the current one at layers 0 and 1, shared read/write routing at layer 0 with sharper τ_r initialization (3.0 versus 1.0), a low-rank projection to half the hidden size at the value stream that saves up to 50% of mixer compute, an Alpha Gate (a ReZero-like scalar initialized at identity 1.0 rather than ReZero's 0.0) used as a debugging signal for whether a mixer contributes, and dropout of 0.1 in several places. The recurrence in the prefix mean can be cached, so generation costs O(1) per token.
Experiments use a 250M-token subset of FineWeb-Edu (360,313 documents split 338,695/18,015/3,603) with a custom BPE tokenizer of 16,000 tokens, AdamW, linear warmup over 2% of training, cosine annealing to 10% of peak learning rate, and models 6 layers deep with hidden size 256 by default. Interpretability was studied by ranking sequences by prototype activation strength on the validation set, feeding the top ten activating sequences per prototype to GPT-5.1 for theme labeling and 1–10 scoring, and running targeted prototype re-initialization experiments.
Why This Matters
The paper argues that interpretability should be a design constraint rather than a post-hoc cleanup. If a model's internal channels are nameable and individually editable, then debugging, auditing, and correcting a model's behavior become engineering tasks rather than forensic ones.
Real-world applications the design could support:
- Auditing and compliance in regulated settings such as healthcare
Authors’ abstract
While state-of-the-art language models (LMs) surpass most humans in certain domains, their reasoning remains largely opaque, reducing trust and increasing the risk of deception and hallucination. We introduce the Prototype Transformer (ProtoT), an autoregressive LM architecture that replaces the quadratic-cost self-attention module of the Transformer with a linear-cost module based on prototypes, which are learned parameter vectors. In ProtoT, prototypes create communication channels that aggregate contextual information at different time scales. We show that this structure leads prototypes to automatically capture nameable concepts, such as "woman", during training, offering a path toward interpreting model reasoning and making targeted edits to model behavior. Compared with baselines, ProtoT scales well with model and data size, is robust to input perturbations, and performs well on text generation and downstream tasks, including GLUE. These results suggest that ProtoT is a promising step toward autoregressive language models that are more interpretable by design.