In-context learning \ -- performing tasks based on examples given in the prompt \ -- is an important capability that has emerged in large language models and has received significant attention in both theory and practice. Existing theoretical work often focuses on settings where the learning uses information purely from the prompt. However, many practical instances of in-context learning require the model to retrieve factual knowledge stored in the model's parameters, with the context serving to identify which knowledge is relevant. In this work, we study how in-context learning leverages factual knowledge recall. We formalize this behavior by introducing the \emph{in-context factual recall (IC-recall)} task, where a transformer is provided a context of (subject, answer) pairs generated from a hidden relation, along with a query subject, and must both infer this hidden relation and retrieve the corresponding answer. Factual knowledge is modeled by the transformer having access to a simple pre-constructed MLP associative memory storing (subject, relation, answer) triplets. We analyze the supervised fine-tuning dynamics of a one-layer transformer on IC-recall data and prove that the model successfully performs IC-recall by converging to a particular pairwise attention pattern. This fine-tuning stage requires a very small number of samples \ -- only polylogarithmic in the number of stored knowledge triplets. Experiments verify our theoretical predictions and show that the pairwise attention pattern emerges even when the MLP layer is pretrained instead of constructed.
Locate-then-edit for Multi-hop Factual Recall under Knowledge Editing
Peking University(北京大学);Provable Responsible AI and Data Analytics (PRADA) Lab(可验证负责任人工智能与数据分析(PRADA)实验室);King Abdullah University of Science and Technology(阿卜杜拉国王科技大学);South China University of Technology(华南理工大学)
Dynamic Weight Grafting: Localizing Finetuned Factual Knowledge in Transformers
Department of Computer Science, University of Chicago(计算机科学系,芝加哥大学);Department of Statistics, University of Chicago(统计学系,芝加哥大学);Data Science Institute, University of Chicago(数据科学研究所,芝加哥大学)
Expert-Aware Causal Tracing of Factual Recall in Sparse MoE Language Models
Center for Information and Language Processing (CIS)(信息与语言处理中心);Ubiquitous Knowledge Processing Lab (UKP)(无所不在的知识处理实验室);Munich Center for Machine Learning (MCML)(慕尼黑机器学习中心)
Factual Self-Awareness in Language Models: Representation, Robustness, and Scaling
Ubiquitous Knowledge Processing Lab (UKP Lab)(通用知识处理实验室);Department of Computer Science(计算机科学系);Hessian Center for AI (hessian.AI)(黑森人工智能中心);Technical University of Darmstadt(达姆施塔特技术大学)
MLPs are Hebbians: Constructing Efficient Fact-Storing MLPs for Transformers
Institute for Computational & Mathematical Engineering, Stanford University(斯坦福大学计算与数学工程研究所);Department of Computer Science, Stanford University(斯坦福大学计算机科学系);Department of Computer Science and Engineering, University at Buffalo(布法罗大学计算机科学与工程系)
Constructing Efficient Fact-Storing MLPs for Transformers
Computer Science Department, Stanford University(斯坦福大学计算机科学系);Institute for Computational & Mathematical Engineering, Stanford University(斯坦福大学计算与数学工程研究所);Computer Science Department, University of Wisconsin–Madison(威斯康星大学麦迪逊分校计算机科学系);Computer Science and Engineering Department, University at Buffalo(布法罗大学计算机科学与工程系)
Beyond Variance: Knowledge-Aware LLM Compression via Fisher-Aligned Subspace Diagnostics
Department of Computer Science, Iowa State University(计算机科学系,爱荷华州立大学);Department of Civil, Construction & Environmental Engineering, Iowa State University(土木、建设与环境工程系,爱荷华州立大学)
On the Robustness of Transformers against Context Hijacking for Linear Classification
Insititute of Data Science, The University of Hong Kong(香港大学数据科学学院);Actuarial Science, The University of Hong Kong(香港大学精算学系);Department of Computer Science, The University of Hong Kong(香港大学计算机科学系)
Predictable Confabulations: Factual Recall by LLMs Scales with Model Size and Topic Frequency
International Development Research Centre Canada(加拿大国际发展研究中心);University of Cape Town(开普敦大学);Global Center on AI Governance(人工智能治理全球中心);SnT, University of Luxembourg(卢森堡大学SnT分校);CITADEL AI Centre of Excellence, Burkina Faso(布基纳法索CITADEL人工智能卓越中心)
Through a Compressed Lens: Investigating The Impact of Quantization on Factual Knowledge Recall
Quality and Usability Lab, Technische Universität Berlin(柏林技术大学质量与可用性实验室);German Research Center for Artificial Intelligence (DFKI)(德国人工智能研究中心);Saarland Informatics Campus(萨尔州信息学院);LMU Munich(慕尼黑大学);Bosch Center for Artificial Intelligence (BCAI)(博世人工智能中心);Munich Center for Machine Learning (MCML)(慕尼黑机器学习中心);Centre for European Research in Trusted AI (CERTAIN)(可信人工智能欧洲研究中心);BIFOLD – Berlin Institute for the Foundations of Learning and Data(柏林学习与数据基础研究院);Technical University of Munich(慕尼黑技术大学)
Representation Shattering in Transformers: A Synthetic Study with Knowledge Editing
CBS-NTT Program in Physics of Intelligence, Harvard University;Harvard College;Informatics Lab, NTT Research Inc.;Information Science, University of Pennsylvania;Department of Physics, Massachusetts Institute of Technology
The Spectral Geometry of Thought: Phase Transitions, Instruction Reversal, Token-Level Dynamics, and Perfect Correctness Prediction in How Transformers Reason
University of Maryland, College Park(马里兰大学帕克分校);Google Research(谷歌研究院)
大型Transformer模型在许多自然语言任务中取得了令人印象深刻的性能。特别地,基于Transformer的语言模型已经被证明在以其大量参数对事实知识进行编码方面具有很强的能力。虽然提高Transformers的记忆和概括能力的任务已经得到了广泛的研究,但如何使transformers忘记特定的旧事实并记住新事实还不太清楚。在本文中,我们提出了一个新的任务\emph{explicitly modifying specific factual knowledge in Transformer models while ensuring the model performance does not degrade on the unmodified facts}。此任务在许多情况下都很有用,例如更新陈旧的知识,保护隐私,以及消除存储在模型中的意外偏见。我们对几种方法进行了基准测试,这些方法在这项任务上提供了自然的基线性能。这导致了Transformer模型的关键组件的发现,这些组件对于知识修改特别有效。这项工作还提供了不同的训练阶段(如预训练和微调)对记忆和知识修改的作用的见解。
Learning to Recall with Transformers Beyond Orthogonal Embeddings
University of Toronto and Vector Institute(多伦多大学和向量研究所);Flatiron Institute(Flatiron研究所);University of Southern California(南加州大学);New York University and Flatiron Institute(纽约大学和Flatiron研究所)
Provable In-Context Vector Arithmetic via Retrieving Task Concepts
Department of Computer Science, City University of Hong Kong, Hong Kong SAR;Center for Advanced Intelligence Project, RIKEN, Japan;Institute of High Performance Computing (IHPC), Agency for Science, Technology;Research (A STAR), Singapore;Centre for Frontier AI Research (CFAR), Agency for Science, Technology;College of Computing;Data Science, Nanyang Technological University, Singapore;Department of Mathematical Informatics, The University of Tokyo, Japan;School of Mathematics;Statistics, The University of Sydney, Australia
Mention Memory: incorporating textual knowledge into Transformers through entity mention attention
University of Southern California(南加利福尼亚大学);Google(谷歌);Google Research(谷歌研究院)
诸如开放域问答之类的自然语言理解任务通常需要从多个源检索和吸收事实信息。我们建议通过将大型文本语料库的半参数表示集成到Transformer模型中作为事实知识的来源来解决这个问题。具体来说,我们的方法表示知识与“提及记忆”,一个表的密集向量表示的每一个实体中提到的语料库。所提出的模型- TOME -是一个Transformer,它通过内部记忆层访问信息,其中输入通道中提到的每个实体都参与提到记忆。这种方法支持在单个Transformer模型中对许多不同的信息源进行合成和推理。在使用1.5亿次维基百科提及的记忆的实验中,TOME在几个开放领域知识密集型任务上实现了强大的性能,包括声明验证基准HoVer和FEVER以及几个基于实体的QA基准。我们还表明,该模型学习参加信息提及没有任何直接的监督。最后,我们证明了该模型可以推广到新的看不见的实体更新的内存,而无需再训练。
Fact or Guesswork? Evaluating Large Language Models' Medical Knowledge with Structured One-Hop Judgments
University of Georgia(佐治亚大学);University of California, Merced(加州大学默塞德分校);Lehigh University(莱特大学);The University of Queensland(昆士兰大学);National University of Singapore(新加坡国立大学);University of California, Los Angeles(加州大学洛杉矶分校)