arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.03052cs.CL
收藏

语言模型如何处理否定

How Language Models Process Negation

University of California, Berkeley(加州大学伯克利分校)

Zhejian Zhou, Tianyi Zhou, Robin Jia, Jonathan May

AI总结:

研究大型语言模型处理否定的内部机制,发现模型内部存在正确处理的组件,但后期注意力层导致错误,通过消融可提升准确率;模型同时采用抑制和构建两种机制,其中构建机制更显著。

摘要:

我们研究了大型语言模型(LLMs)在机制层面如何处理否定。首先,我们确定,尽管开放权重模型在涉及否定问题时经常给出错误答案,但它们确实拥有内部组件能够正确处理否定。其准确性低是由于后期注意力层的行为促进了简单的捷径;消融这些注意力模块极大地提高了否定相关问题的准确性。其次,我们揭示了模型处理否定的方式。我们考虑了两种假设:模型可能使用注意力头来关注被否定的短语并抑制相关概念,或者它们可能直接构建整个否定短语的表示(例如,将“不是气体”表示为促进液体和固体的向量)。我们应用一系列观察性和因果性可解释性技术于Mistral-7B和Llama-3.1-8B,以表明模型实现了这两种机制,其中“构建”机制更为突出。综合来看,我们的工作加深了对LLMs内部机制的理解,突出了构建主导的计算以及LLMs内竞争机制的共存。

英文摘要:

We study how Large Language Models (LLMs) process negation mechanistically. First, we establish that even though open-weight models often provide wrong answers to questions involving negation, they do possess internal components that process negation correctly. Their poor accuracy is due to late-layer attention behavior that promotes simple shortcuts; ablating those attention modules greatly improves accuracy on negation-related questions. Second, we uncover how models process negation. We consider two hypotheses: models could use attention heads that attend to the phrase being negated and suppress related concepts, or they could directly construct a representation of the entire negative phrase (e.g., representing "not gas" as a vector that promotes liquids and solids). We apply a range of observational and causal interpretability techniques on Mistral-7B and Llama-3.1-8B to show that models implement both mechanisms, with the "constructive" mechanism being more prominent. Combined, our work deepens the understanding of LLMs' internals, highlighting construction-dominant computations and the coexistence of competing mechanisms within LLMs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑