With the enhancement in the field of generative artificial intelligence (AI), contextual question answering has become extremely relevant. Attributing model generations to the input source document is essential to ensure trustworthiness and reliability. We observe that when large language models (LLMs) are used for contextual question answering, the output answer often consists of text copied verbatim from the input prompt which is linked together with "glue text" generated by the LLM. Motivated by this, we propose that LLMs have an inherent awareness from where the text was copied, likely captured in the hidden states of the LLM. We introduce a novel method for attribution in contextual question answering, leveraging the hidden state representations of LLMs. Our approach bypasses the need for extensive model retraining and retrieval model overhead, offering granular attributions and preserving the quality of generated answers. Our experimental results demonstrate that our method performs on par or better than GPT-4 at identifying verbatim copied segments in LLM generations and in attributing these segments to their source. Importantly, our method shows robust performance across various LLM architectures, highlighting its broad applicability. Additionally, we present Verifiability-granular, an attribution dataset which has token level annotations for LLM generations in the contextual question answering setup.
翻译:随着生成式人工智能领域的进步,上下文问答变得尤为重要。将模型生成内容归因于输入源文档对于确保可信度与可靠性至关重要。我们观察到,当使用大语言模型进行上下文问答时,输出答案通常包含从输入提示中逐字复制的文本,这些文本通过LLM生成的"粘合文本"连接在一起。受此启发,我们提出LLM对文本复制来源具有内在感知能力,这种感知可能捕获在LLM的隐藏状态中。我们引入了一种基于LLM隐藏状态表示的上下文问答归因新方法。该方法无需大量模型重训练和检索模型开销,可提供细粒度归因并保持生成答案的质量。实验结果表明,我们的方法在识别LLM生成中逐字复制片段及其来源归因方面,性能与GPT-4相当或更优。重要的是,该方法在不同LLM架构间均表现出稳健性能,彰显了其广泛适用性。此外,我们发布了Verifiability-granular数据集,该数据集为上下文问答场景下的LLM生成提供了词元级标注。