让大模型自动识别并聚焦关键信息,提升回答准确性。
Model Tells Itself Where to Attend: Faithfulness Meets Automatic Attention Steering
- 通过显式调整注意力分数,自动引导模型关注重要上下文。
- 在开放书问答中使LLAMA3-70B-Instruct的忠实度平均提升7.95%。
- 无需修改模型参数,推理时即可生效,适合部署优化。
大型语言模型在各类实际任务中表现出色,但常难以充分理解与利用输入上下文,导致回应不忠实或出现幻觉。这一问题在长文本或含干扰信息的上下文中尤为突出,容易使模型偏离关键证据。现有方法多采用提示工程来增强模型对上下文的利用,如迭代提示:先让模型识别关键信息,再据此生成答案。然而,这类方法仅在词元空间隐式强调关键内容,往往不足以有效引导注意力。为此,本文提出AutoPASTA,一种在推理时自动识别关键上下文并显式调整注意力得分的方法,无需修改模型参数。实验表明,在开放书问答任务中,AutoPASTA显著提升了模型对关键信息的捕捉能力,大幅改善了模型忠实度与性能,例如对LLAMA3-70B-Instruct平均提升7.95%。代码将公开于https://github.com/QingruZhang/AutoPASTA。
原文摘要 · Abstract (English)
Large language models (LLMs) have demonstrated remarkable performance across various real-world tasks. However, they often struggle to fully comprehend and effectively utilize their input contexts, resulting in responses that are unfaithful or hallucinated. This difficulty increases for contexts that are long or contain distracting information, which can divert LLMs from fully capturing essential evidence. To address this issue, many works use prompting to help LLMs utilize contextual information more faithfully. For instance, iterative prompting highlights key information in two steps that first ask the LLM to identify important pieces of context and then derive answers accordingly. However, prompting methods are constrained to highlighting key information implicitly in token space, which is often insufficient to fully steer the model's attention. To improve model faithfulness more reliably, we propose AutoPASTA, a method that automatically identifies key contextual information and explicitly highlights it by steering an LLM's attention scores. Like prompting, AutoPASTA is applied at inference time and does not require changing any model parameters. Our experiments on open-book QA demonstrate that AutoPASTA effectively enables models to grasp essential contextual information, leading to substantially improved model faithfulness and performance, e.g., an average improvement of 7.95% for LLAMA3-70B-Instruct. Code will be publicly available at https://github.com/QingruZhang/AutoPASTA .
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。