Contextual Sparsity as a Tool for Mechanistic Understanding of Retrieval in Hybrid Foundation Models

Abstract

We mechanistically investigate the role of self-attention in hybrid foundation models that combine state-space modules with self-attention. Evaluating the RecurrentGemma-2B model on a synthetic needle-in-a-haystack task, we show that completely deactivating attention heads causes a total retrieval failure—even though overall generation quality is only modestly affected. Using a contextual sparsity approach inspired by Liu et al. (2023), we find that retaining only 2 out of 10 attention heads is sufficient to nearly preserve full retrieval performance. These findings highlight a specialized function of self-attention for copying and retrieval, suggesting that future work could focus on designing dedicated, interpretable retrieval mechanisms within hybrid architectures.

Cite

Text

Zani et al. "Contextual Sparsity as a Tool for Mechanistic Understanding of Retrieval in Hybrid Foundation Models." ICLR 2025 Workshops: SLLM, 2025.

Markdown

[Zani et al. "Contextual Sparsity as a Tool for Mechanistic Understanding of Retrieval in Hybrid Foundation Models." ICLR 2025 Workshops: SLLM, 2025.](https://mlanthology.org/iclrw/2025/zani2025iclrw-contextual/)

BibTeX

@inproceedings{zani2025iclrw-contextual,
  title     = {{Contextual Sparsity as a Tool for Mechanistic Understanding of Retrieval in Hybrid Foundation Models}},
  author    = {Zani, Davide and Michalak, Kurt Felix and Abreu, Steven},
  booktitle = {ICLR 2025 Workshops: SLLM},
  year      = {2025},
  url       = {https://mlanthology.org/iclrw/2025/zani2025iclrw-contextual/}
}