通过机制电路解析问答模型如何使用上下文与记忆,实现高效数据溯源和模型引导。
On Mechanistic Circuits for Extractive Question-Answering
- 用因果中介分析提取模型内部组件的机制电路
- 发现少数注意力头可自动完成可靠数据溯源
- 提出ATTNATTRIB算法,支持快速溯源与模型引导
大型语言模型在文档处理与抽取式问答任务中应用日益广泛。本文针对上下文增强的语言建模任务,提取其机制电路,以理解参数化记忆与检索上下文之间的交互关系,并探索电路在下游应用中的潜力,如数据溯源。通过因果中介分析技术,我们识别出模型内部关键组件(如注意力头、MLP)构成的电路。基于这些电路,我们发现少量注意力头可在前向传播中默认实现稳定的数据溯源,从而实现无需额外计算的免费溯源。据此提出ATTNATTRIB算法,在多个抽取式问答基准上达到当前最优溯源效果。此外,利用该溯源信号作为前向传播中的附加提示,可有效引导模型优先依据上下文回答而非依赖参数记忆。本研究不仅深化了对上下文增强语言模型的机制理解,更提供了可落地的数据溯源与模型控制方案。
原文摘要 · Abstract (English)
Large language models are increasingly used to process documents and facilitate question-answering on them. In our paper, we extract mechanistic circuits for this real-world language modeling task: context-augmented language modeling for extractive question-answering (QA) tasks and understand the potential benefits of circuits towards downstream applications such as data attribution to context information. We extract circuits as a function of internal model components (e.g., attention heads, MLPs) using causal mediation analysis techniques. Leveraging the extracted circuits, we first understand the interplay between the model's usage of parametric memory and retrieved context towards a better mechanistic understanding of context-augmented language models. We then identify a small set of attention heads in our circuit which performs reliable data attribution by default, thereby obtaining attribution for free in just the model's forward pass. Using this insight, we then introduce ATTNATTRIB, a fast data attribution algorithm which obtains state-of-the-art attribution results across various extractive QA benchmarks. Finally, we show the possibility to steer the language model towards answering from the context, instead of the parametric memory by using the attribution from ATTNATTRIB as an additional signal during the forward pass. Beyond mechanistic understanding, our paper provides tangible applications of circuits in the form of reliable data attribution and model steering.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。