SVF-Matryoshka
Singular Vector Features (SVF) selects directions inside GPT-2 small to test which internal signals influence its answers. This repository contains our submission to the MIB benchmark for indirect object identification (IOI).
In IOI, the model completes sentences such as “John and Mary went to the store. John gave a book to …” The correct answer is “Mary.” We study signals that help the model identify the recipient's name and its position in the prompt.
The method has three steps:
- Build fixed measurements. An attention head is a component that reads information from other tokens. Its QK matrix scores how strongly one token should attend to another. We use singular vectors—directions obtained by decomposing this matrix—from later attention heads. We map these directions back into the output spaces of four earlier heads. Each direction measures one number from a head's output.
- Learn which measurements to keep. We train ranking scores while varying how many measurements we select. Taking the highest-ranked measurements produces nested selections: a smaller selection fits inside a larger one. This is the Matryoshka idea. The measurement directions remain fixed.
- Test their causal effect. We replace selected measurements from one prompt with those from another. An inverse map reconstructs the head output while preserving its unselected measurements. We then measure how the model's answer changes.
The method builds on the observation in Singular Vectors of Attention Heads Align with Features (Franco, Loughridge, and Crovella, 2026): singular vectors of attention matrices can align with features—directions that represent information inside a model. We use this observation to choose candidate measurements, then learn which to select for IOI.
Training used all 23,931 filtered public training pairs, covering ten sentence templates, for three passes through the data. The final selections contain:
| Signal | Benchmark variable | Measurements across four heads |
|---|---|---|
| Recipient's position | output_position |
105 |
| Recipient's name | output_token |
135 |
The submission folder contains the measurement and inverse maps, selected measurement indices, and Python code needed to load them. GPT-2's weights are not included.
The package passed MIB's official file verifier. On four hand-written prompt pairs, it produced exactly the same model outputs as the original training export. These are compatibility checks, not benchmark results. We have not measured public or hidden test performance for this final fit.