三思而后行:语言模型中检索任务的一种通用涌现分解机制
Look Before You Leap: A Universal Emergent Decomposition of Retrieval Tasks in Language Models
AI总结:
该研究提出跨六领域的结构化检索任务集合ORION,通过因果分析发现语言模型存在通用的模块化检索任务分解机制,并基于此实现了可缓解提示注入的可扩展内部监督方案,准确率提升显著。
摘要:
在解决具有挑战性的问题时,语言模型(LM)能够从冗长复杂的上下文中识别相关信息。为研究语言模型如何在不同场景下解决检索任务,我们提出了ORION(结构化检索任务集合),它涵盖从文本理解到编程的六个领域的一系列结构化检索任务。ORION中的每个任务都可以抽象表示为:一个请求(例如问题)从上下文(例如故事)中检索某个属性(例如角色名称)。我们对18个参数量从1.25亿到700亿不等的开源语言模型进行了因果分析。我们发现语言模型会以模块化的方式在内部分解检索任务:最后一个token位置的中间层处理请求,而后期层从上下文中检索正确的实体。在通过因果方式强制实施这种分解后,模型仍然能够解决原始任务,在研究的106个模型-任务对中,有98个保留了原始正确token概率的70%。我们通过对Pythia-2.8b上的一个问答任务进行细粒度案例研究,将这种宏观分解与微观描述关联起来。基于我们的高层理解,我们展示了一个概念验证应用,用于实现语言模型的可扩展内部监督,以缓解提示注入问题,同时仅需对单个输入进行人工监督。我们的方案大幅提升了准确率(在Pythia-12b上从15.5%提升至97.5%)。这项工作提供了跨不同领域和模型的任务通用涌现模块化处理的证据,也是将可解释性应用于语言模型可扩展内部监督的开创性尝试。
英文摘要:
When solving challenging problems, language models (LMs) are able to identify relevant information from long and complicated contexts. To study how LMs solve retrieval tasks in diverse situations, we introduce ORION, a collection of structured retrieval tasks spanning six domains, from text understanding to coding. Each task in ORION can be represented abstractly by a request (e.g. a question) that retrieves an attribute (e.g. the character name) from a context (e.g. a story). We apply causal analysis on 18 open-source language models with sizes ranging from 125 million to 70 billion parameters. We find that LMs internally decompose retrieval tasks in a modular way: middle layers at the last token position process the request, while late layers retrieve the correct entity from the context. After causally enforcing this decomposition, models are still able to solve the original task, preserving 70% of the original correct token probability in 98 of the 106 studied model-task pairs. We connect our macroscopic decomposition with a microscopic description by performing a fine-grained case study of a question-answering task on Pythia-2.8b. Building on our high-level understanding, we demonstrate a proof of concept application for scalable internal oversight of LMs to mitigate prompt-injection while requiring human supervision on only a single input. Our solution improves accuracy drastically (from 15.5% to 97.5% on Pythia-12b). This work presents evidence of a universal emergent modular processing of tasks across varied domains and models and is a pioneering effort in applying interpretability for scalable internal oversight of LMs.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。