多跳问答中的掩码:语言模型在上下文排列下表现的分析
Masking in Multi-hop QA: An Analysis of How Language Models Perform with Context Permutation
AI总结:
本文研究多跳问答中上下文顺序与因果掩码对语言模型推理的影响,发现文档顺序对齐推理链、双向注意力及注意力峰值启发式均可提升性能。
摘要:
多跳问答(Multi-hop Question Answering,MHQA)为问答增加了多层复杂性,使其更具挑战性。当语言模型(Language Models,LMs)被提示输入多个搜索结果时,它们不仅要负责检索相关信息,还要跨信息源运用多跳推理。尽管语言模型在传统问答任务上表现良好,但因果掩码可能会阻碍其跨复杂上下文进行推理的能力。本文通过在多种配置下排列搜索结果(检索到的文档),探究语言模型如何响应多跳问题。研究揭示了以下有趣发现:1)编码器-解码器模型(例如 Flan-T5 系列中的模型)尽管规模显著更小,但在 MHQA 任务中通常优于因果解码器-only语言模型;2)改变黄金文档的顺序会在 Flan-T5 模型和经过微调的解码器-only模型中呈现不同趋势,当文档顺序与推理链顺序一致时可观察到最佳性能;3)通过修改因果掩码,用双向注意力增强因果解码器-only模型,可以有效提升其最终性能。除上述内容外,本文还全面考察了 MHQA 场景下语言模型注意力权重的分布。实验表明,当所得答案正确时,注意力权重往往在更高数值处达到峰值。我们利用这一发现,以启发式方式提升语言模型在该任务上的性能。代码公开发布于 https://github.com/hwy9855/MultiHopQA-Reasoning。
英文摘要:
Multi-hop Question Answering (MHQA) adds layers of complexity to question answering, making it more challenging. When Language Models (LMs) are prompted with multiple search results, they are tasked not only with retrieving relevant information but also employing multi-hop reasoning across the information sources. Although LMs perform well on traditional question-answering tasks, the causal mask can hinder their capacity to reason across complex contexts. In this paper, we explore how LMs respond to multi-hop questions by permuting search results (retrieved documents) under various configurations. Our study reveals interesting findings as follows: 1) Encoder-decoder models, such as the ones in the Flan-T5 family, generally outperform causal decoder-only LMs in MHQA tasks, despite being significantly smaller in size; 2) altering the order of gold documents reveals distinct trends in both Flan T5 models and fine-tuned decoder-only models, with optimal performance observed when the document order aligns with the reasoning chain order; 3) enhancing causal decoder-only models with bi-directional attention by modifying the causal mask can effectively boost their end performance. In addition to the above, we conduct a thorough investigation of the distribution of LM attention weights in the context of MHQA. Our experiments reveal that attention weights tend to peak at higher values when the resulting answer is correct. We leverage this finding to heuristically improve LMs' performance on this task. Our code is publicly available at https://github.com/hwy9855/MultiHopQA-Reasoning.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。