arXiv:2410.14387cs.CL2024-10被引 22

揭秘多语言大模型如何记忆和提取事实,发现语言依赖与独立机制并存。

How Do Multilingual Language Models Remember Facts?

  • 通过分析三款多语言模型,发现英语中的记忆机制基本适用于多语种环境。
  • 定位到语言在回忆中的作用:主语丰富性与语言无关,宾语提取则依赖语言。
  • 最后令牌表示可编码语言与内容信息,适合用于多语言知识编辑与评估。

大规模语言模型(LLMs)在预训练中存储并检索海量事实知识。以往研究已定位并识别出英语单语模型中的知识召回机制,但尚未探索这些机制在非英语语言及多语言大模型中的泛化情况。本文对三款多语言大模型进行了系统分析,发现此前在英语模型中识别的召回机制在多语言背景下基本适用,但存在语言与架构差异带来的细微差别。通过修补中间表示层,我们定位了语言在召回过程中的作用:主语信息的丰富化为语言无关机制,而宾语提取则具有语言依赖性。此外,我们发现最后一个令牌表示充当功能向量(Function Vector, FV),同时编码查询的语言和需从主语中提取的内容。在仅解码器架构的模型中,FV以两阶段方式组合这两类信息。这些发现揭示了多语言大模型中独特的知识召回机制,强调需要开发专门面向多语言场景的知识评估、事实编辑与知识获取新方法。

原文摘要 · Abstract (English)

Large Language Models (LLMs) store and retrieve vast amounts of factual knowledge acquired during pre-training. Prior research has localized and identified mechanisms behind knowledge recall; however, it has only focused on English monolingual models. The question of how these mechanisms generalize to non-English languages and multilingual LLMs remains unexplored. In this paper, we address this gap by conducting a comprehensive analysis of three multilingual LLMs. First, we show that previously identified recall mechanisms in English largely apply to multilingual contexts, with nuances based on language and architecture. Next, through patching intermediate representations, we localize the role of language during recall, finding that subject enrichment is language-independent, while object extraction is language-dependent. Additionally, we discover that the last token representation acts as a Function Vector (FV), encoding both the language of the query and the content to be extracted from the subject. Furthermore, in decoder-only LLMs, FVs compose these two pieces of information in two separate stages. These insights reveal unique mechanisms in multilingual LLMs for recalling information, highlighting the need for new methodologies -- such as knowledge evaluation, fact editing, and knowledge acquisition -- that are specifically tailored for multilingual LLMs.

多语言模型知识记忆功能向量语言依赖

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。