TL;DR
MATCHA is a new framework that aligns the internal "thoughts" (activations) of different Large Language Models (LLMs), allowing tools like hallucination detectors or steering vectors to be transferred from one model to another without retraining. By learning an input-dependent, many-to-many mapping between layers, MATCHA reconstructs target model activations more accurately and efficiently than previous fixed-mapping approaches.
What Problem Does This Paper Address?
As new LLMs are released at a breakneck pace, researchers develop sophisticated tools to understand and control them—such as probes that detect when a model is about to lie or "steering vectors" that prevent a model from generating harmful content. However, these tools are usually model-specific. If you build a great safety filter for Llama-3, it won't work on Qwen-2.5 because their internal representation spaces (the coordinates and depths where information is stored) are different.
The core challenge is activation alignment: finding a mathematical map that can take the internal state of a "source" model and translate it into the state of a "target" model. Most prior work assumed a simple one-to-one relationship (e.g., layer 5 of Model A maps to layer 5 of Model B). This paper argues that such fixed mappings are too rigid, especially when models have different depths or come from different architectural families.
Methods
The authors introduce MATCHA (Many-to-many Alignment Through Cross-attention over Hidden Activations). The key innovation is factoring the alignment into two distinct, interpretable parts:
- The Layer Map: Instead of assuming which layers correspond, MATCHA uses a cross-attention mechanism. It treats target layers as "queries" and source layers as "keys." This produces an explicit $L_t \times L_s$ matrix that shows exactly how much each source layer contributes to a specific target layer. Crucially, this map is input-dependent—the alignment can shift slightly depending on the prompt.
- The Feature Map: Once the layers are mixed, a shared linear projection and a small residual network transform the actual feature values from the source's numerical space to the target's.
This design allows the model to be trained end-to-end to minimize the reconstruction error between the mapped source activations and the actual target activations.
Datasets
- LIMA: A small but diverse dataset of 1,000 high-quality prompts used to train the alignment maps.
- TriviaQA: Used to evaluate "probing transfer"—training a hallucination detector on one model and testing it on another via MATCHA.
- AdvBench, HarmBench, and JailbreakBench: Used to test "steering transfer"—taking a vector that suppresses harmful responses in a target model and applying it to a source model.
Key Insights and Ideas
- Many-to-Many is Essential: The researchers found that target layers don't just map to one source layer; they typically draw from a "band" of neighboring layers. Restricting the map to a one-to-one correspondence significantly hurts performance.
- The "Belly" Effect: When models have different depths, the mapping isn't a straight diagonal line. The learned maps often show a "belly" or curve in the middle layers, suggesting that different models process information at different relative speeds.
- Input-Dependence Matters: The optimal way to align two models changes based on what they are talking about. MATCHA’s ability to adjust its mapping per-input is a major reason it outperforms static baselines.
Key Results
The authors tested MATCHA across 42 pairs of models (including Llama, Qwen, and Gemma) ranging from 1B to 8B parameters.
- Superior Reconstruction: MATCHA consistently outperformed all baselines (like Command-V and Hierarchical Optimal Transport) in reconstructing target activations. In "smaller-to-larger" model transfers, it improved Recall@1 (a measure of how often the mapped state is the closest to the true state) by 0.12 points.
- Behavioral Teleportation: MATCHA proved highly effective for transferring interventions. For example, a steering vector designed to suppress refusals in a target model could be "teleported" to a source model, achieving significantly higher attack success rates than other alignment methods.
- Efficiency: Despite its complexity, MATCHA is incredibly fast, taking only about 0.06 milliseconds to perform a transfer.
Limitations and Future Work
- Internal Access Required: MATCHA requires access to the internal hidden states of the models. This makes it easy to use with open-weight models but difficult for closed APIs (like GPT-4) unless providers offer hidden state access.
- Pair-wise Training: Currently, a separate MATCHA map must be trained for every pair of models. The authors suggest that future work could involve creating a "universal" alignment space that connects multiple models simultaneously.
- Dual-Use Risks: The authors explicitly note that while this tool is great for interpretability, it could also be used to transfer "jailbreak" techniques between models, necessitating careful safety considerations.
Summary updated