揭秘生成式检索模型如何一步步找出相关文档。
Reverse-Engineering the Retrieval Process in GenIR Models
- 通过替换编码器,发现解码器是检索核心。
- 解码过程分三阶段:预热、桥梁、交互,仅最后阶段完成查询与文档匹配。
- 适合研究大模型可解释性或生成式检索的读者。
生成式信息检索(GenIR)是一种新型范式,采用端到端的Transformer编码器-解码器模型根据查询预测文档排序。尽管其架构简洁且检索效果优异,但与交叉编码器或双编码器相比,其内部计算机制仍不明确。本文通过机制可解释性方法(如补丁法和词汇投影)研究GenIR模型的内部检索过程。通过将编码器替换为在较少文档上训练的版本,我们发现解码器是成功检索的主要组件。补丁实验表明,解码器并非所有组件都关键。具体而言,解码过程可分为三个阶段:(I) 预热阶段,为后续层激活提供关键信息;(II) 桥梁阶段,以交叉注意力为主,传递查询信息;(III) 交互阶段,主要由MLP激活,预测文档标识符。结果表明,查询与文档信息的交互仅在最后一阶段发生。本研究有助于深入理解GenIR模型,并推动未来解决其面临的挑战。
原文摘要 · Abstract (English)
Generative Information Retrieval (GenIR) is a novel paradigm in which a transformer encoder-decoder model predicts document rankings based on a query in an end-to-end fashion. These GenIR models have received significant attention due to their simple retrieval architecture while maintaining high retrieval effectiveness. However, in contrast to established retrieval architectures like cross-encoders or bi-encoders, their internal computations remain largely unknown. Therefore, this work studies the internal retrieval process of GenIR models by applying methods based on mechanistic interpretability, such as patching and vocabulary projections. By replacing the GenIR encoder with one trained on fewer documents, we demonstrate that the decoder is the primary component responsible for successful retrieval. Our patching experiments reveal that not all components in the decoder are crucial for the retrieval process. More specifically, we find that a pass through the decoder can be divided into three stages: (I) the priming stage, which contributes important information for activating subsequent components in later layers; (II) the bridging stage, where cross-attention is primarily active to transfer query information from the encoder to the decoder; and (III) the interaction stage, where predominantly MLPs are active to predict the document identifier. Our findings indicate that interaction between query and document information occurs only in the last stage. We hope our results promote a better understanding of GenIR models and foster future research to overcome the current challenges associated with these models.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。