Prototype Transformer: Towards Language Model Architectures Interpretable by Design

Yordan Yordanov, Matteo Forasassi, Bayar Menzat, Ruizhi Wang, Chang Qi, Markus Kaltenberger, Amine M'Charrak, Tommaso Salvatori, Thomas Lukasiewicz

TL;DR

The Prototype Transformer (ProtoT) is a novel autoregressive language model architecture that replaces standard quadratic-cost self-attention with a linear-cost, prototype-based mixer. By routing information through learnable parameter vectors (prototypes), the model automatically learns disentangled, human-nameable concepts during training, enabling highly targeted behavioral edits with virtually no collateral damage to overall performance.

What Problem Does This Paper Address?

State-of-the-art language models are notorious "black boxes." Even when prompted to provide step-by-step reasoning, research shows their explicit explanations often disconnect from their actual internal computational pathways. This opacity breeds distrust and makes it difficult to diagnose or fix systemic issues like hallucinations and hidden biases.

Current interpretability methods primarily rely on post-hoc analysis tools (like Sparse Autoencoders) trained on top of existing architectures. ProtoT tackles this challenge by making the language model interpretable by design, baking transparency directly into the core routing mechanism of the network.

Methods

Instead of allowing every token to attend to every other token (which scales quadratically), ProtoT introduces $R$ learnable parameter vectors called prototypes that act as independent communication channels.

As illustrated in Figure 1, a single autoregressive step consists of:

  1. Write Gate: A channel-aligned gating mechanism that routes incoming token information into the $R$ prototype channels based on semantic similarity. It also utilizes a local convolution layer in early blocks to capture short-term relationships.
  2. Prefix Mean (PM): An aggregator that accumulates past information within each channel using an Exponential Moving Average (EMA) for time-discounting. This allows different prototypes to specialize across different time scales.
  3. Read Gate: A mechanism that reads information back out of the channels into the sequence based on the current token's similarity to the prototypes.

Because the state updates autoregressively via past-only aggregation, ProtoT achieves linear computational complexity $O(N)$ relative to sequence length and features a constant $O(1)$ compute and memory cost per token during generation.

Figure 1. A single autoregressive step of the ProtoT mixer module. Prototypes P1, . . . , PR route inputs x1, . . . , xi−1 (past-only – excluding xi) into R channels via similarity scores at the write gate. Time-discount and time-wise mean are applied per channel. The read gate reads from each channel via the similarity between its prototype and xi, followed by aggregation into the output yi.

Datasets

  • FineWeb-Edu: A high-quality, curated web crawl dataset used for pre-training (evaluated on a 250M token subset).
  • GLUE Benchmark: A collection of 9 standard English natural language understanding tasks used to evaluate downstream performance.
  • Custom Perturbation Benchmark: A newly introduced dataset containing 3,500 semantically equivalent sentence pairs across 7 categories (synonyms, typos, spelling, morphology, contractions, punctuation, abbreviations) designed to test model stability against surface-level lexical noise.

Key Insights and Ideas

  • The Semantic Routing Bottleneck: Forcing all cross-sequence communication through a limited number of prototype channels creates a bottleneck. To optimize next-token prediction, the prototypes are pressured to specialize, naturally evolving to represent clean, nameable concepts (e.g., "female", "scholastic narrative", or "COVID-19") without any explicit human labeling or supervision.
  • Predict-and-Consolidate Pattern: Internal activation tracking revealed a fascinating temporal coordination: the read gate consistently spikes exactly one token before the write gate activates for a given concept (see Figure 2). This implies the model actively anticipates which prototype channel will be relevant next before updating its memory.
  • Surgical Editability: Because concepts are localized to specific prototypes, researchers can perform highly targeted interventions. Ablating or masking a specific "female" prototype significantly drops the probability of generating words like "women" or "girls" in relevant contexts, while causing less than a 1% change to the model's global sequence coherence and perplexity.
Figure 2. Up: Sequences most strongly activating prototype 11 at layer 0, which encodes the concept of narrative in a scholastic context. Down: Write-gate, read-gate, and memory curves for a sequence that strongly activates prototype 23 at layer 4. Read- gate peaks precede write-gate activations, spiking on the token immediately before those that trigger write-gate routing.

Key Results

  • Text Generation Quality: In LLM-as-a-judge pairwise open-ended text generation evaluations, ProtoT achieved an Elo score of 1021.24, outperforming standard LLaMA (975.18) and the linear-attention baseline DeltaNet (961.80), while trailing slightly behind Mamba (1041.79).
  • Downstream Performance: On the GLUE benchmark, ProtoT achieved an average score of 67.6%, outperforming DeltaNet (64.5%) and remaining highly competitive with Mamba (68.6%), though falling short of standard LLaMA's dense attention mechanism (71.6%).
  • Robustness to Noise: ProtoT consistently outperformed LLaMA on synonyms, typos, spelling, and morphology, demonstrating that prototype aggregation provides inherent stability against surface-level lexical variations.

Limitations and Future Work

Despite its advantages, ProtoT scales poorly with context length if other model dimensions (like hidden size) are kept fixed, as the prototype channels can become an informational bottleneck. Additionally, a performance gap remains between ProtoT and standard quadratic Transformers (like LLaMA) in raw pre-training perplexity. Finally, while automated LLM evaluation scores ProtoT highly for disentanglement, some prototypes still exhibit polysemantic behaviors.

Future work will focus on scaling ProtoT to larger model sizes and developing training techniques to explicitly align prototypes with specific, stakeholder-defined semantic roles.

Summary updated

BibTeX
@inproceedings{yordanov2026prototype,
  author = {Yordan Yordanov and Matteo Forasassi and Bayar Menzat and Ruizhi Wang and Chang Qi and Markus Kaltenberger and Amine M'Charrak and Tommaso Salvatori and Thomas Lukasiewicz},
  title = {{Prototype Transformer: Towards Language Model Architectures Interpretable by Design}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=ELiOhFJIPh},
}
Figure