arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.11374cs.LGcs.AI
收藏

面向检索的蒸馏:Transformer-SSM混合模型

Retrieval-Aware Distillation for Transformer-SSM Hybrids

Carnegie Mellon University(卡内基梅隆大学);MBZUAI(穆斯林人工智能研究院);Cartesia AI(Cartesia人工智能)

Aviv Bick, Eric P. Xing, Albert Gu

AI总结:

本文提出检索感知蒸馏方法,通过保留关键注意力头并蒸馏其余头部,实现更高效的Transformer-SSM混合模型,显著降低内存消耗并提升检索性能。

摘要:

状态空间模型(SSMs)提供了高效的序列建模,但在需要上下文检索的基准测试中落后于Transformer。先前的研究将这一差距归因于一组少量的注意力头,称为Gather-and-Aggregate(G&A),SSMs难以再现。我们提出了*检索感知蒸馏*,将预训练的Transformer转换为混合学生模型,仅保留这些检索关键的头部,并将其余头部蒸馏为循环头部。我们通过在合成检索任务上的消融实验识别出必要的头部,产生了一个具有稀疏、非均匀注意力放置的混合模型。我们证明,仅保留2%的注意力头可以在检索密集型任务上恢复超过95%的教师性能(在10个头部的10亿参数模型中),所需头部数量远少于保留至少25%的混合模型。我们进一步发现,大型循环状态经常补偿缺失的检索:一旦这些头部处理了检索,SSM基础架构可以被简化,即使在状态维度减少8倍的情况下损失也很小。通过减少注意力缓存和SSM状态,最终的混合模型比同类混合模型更高效5到6倍,以极低的内存成本缩小了Transformer与SSM之间的差距。

英文摘要:

State-space models (SSMs) offer efficient sequence modeling but lag behind Transformers on benchmarks that require in-context retrieval. Prior work links this gap to a small set of attention heads, termed Gather-and-Aggregate (G&A), which SSMs struggle to reproduce. We propose *retrieval-aware distillation*, which converts a pretrained Transformer into a hybrid student by preserving only these retrieval-critical heads and distilling the rest into recurrent heads. We identify the essential heads via ablation on a synthetic retrieval task, producing a hybrid with sparse, non-uniform attention placement. We show that preserving **just 2% of attention heads recovers over 95% of teacher performance on retrieval-heavy tasks** (10 heads in a 1B model), requiring far fewer heads than hybrids that retain at least 25%. We further find that large recurrent states often compensate for missing retrieval: once retrieval is handled by these heads, the SSM backbone can be simplified with limited loss, even with an $8\times$ reduction in state dimension. By reducing both the attention cache and the SSM state, the resulting hybrid is $5$--$6\times$ more memory-efficient than comparable hybrids, closing the Transformer--SSM gap at a fraction of the memory cost.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑