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

具有摊销上下文记忆的语言模型在线自适应

Online Adaptation of Language Models with a Memory of Amortized Contexts

KAIST(韩国科学技术院);Yonsei University(延世大学);Stanford University(斯坦福大学);University of Oxford(牛津大学);Harvard University(哈佛大学);Thomson Reuters(汤森路透)

Jihoon Tack, Jaehyung Kim, Eric Mitchell, Jinwoo Shin, Yee Whye Teh, Jonathan Richard Schwarz

AI总结:

本文提出MAC框架,利用摊销元学习和记忆库实现语言模型在线高效自适应,无需梯度更新,提升性能与效率,并可与RAG结合。

摘要:

由于信息的快速生成和传播,大型语言模型(LLMs)尽管开发成本巨大,但很快就会过时。为了满足保持模型更新的关键需求,在线学习已成为利用LLMs进行实际应用时的重要工具。然而,考虑到不断扩展的未见文档语料库和现代LLMs的大参数空间,高效的自适应至关重要。为了应对这些挑战,我们提出了摊销上下文记忆(MAC),一种高效且有效的LLMs在线自适应框架,具有强大的知识保留能力。我们提出了一种特征提取和记忆增强方法,将新文档中的信息压缩并提取为存储在记忆库中的紧凑调制。在回答问题时,我们的模型会关注并从该记忆库中提取相关知识。为了高效地学习信息丰富的调制,我们利用基于摊销的元学习,该方法将原本需要的优化过程替换为编码器的单次前向传播。随后,我们学习根据问题选择并聚合所选文档为单一调制,从而在测试时无需进一步梯度更新即可自适应冻结的语言模型。我们的实验证明了MAC在多个方面的优越性,包括在线自适应性能、时间和内存效率。此外,我们展示了MAC如何与检索增强生成(RAGs)等流行替代方法结合并提升其性能。代码可在 https://github.com/jihoontack/MAC 获取。

英文摘要:

Due to the rapid generation and dissemination of information, large language models (LLMs) quickly run out of date despite enormous development costs. To address the crucial need to keep models updated, online learning has emerged as a critical tool when utilizing LLMs for real-world applications. However, given the ever-expanding corpus of unseen documents and the large parameter space of modern LLMs, efficient adaptation is essential. To address these challenges, we propose Memory of Amortized Contexts (MAC), an efficient and effective online adaptation framework for LLMs with strong knowledge retention. We propose a feature extraction and memory-augmentation approach to compress and extract information from new documents into compact modulations stored in a memory bank. When answering questions, our model attends to and extracts relevant knowledge from this memory bank. To learn informative modulations in an efficient manner, we utilize amortization-based meta-learning, which substitutes an otherwise required optimization process with a single forward pass of the encoder. Subsequently, we learn to choose from and aggregate selected documents into a single modulation by conditioning on the question, allowing us to adapt a frozen language model during test time without requiring further gradient updates. Our experiment demonstrates the superiority of MAC in multiple aspects, including online adaptation performance, time, and memory efficiency. In addition, we show how MAC can be combined with and improve the performance of popular alternatives such as retrieval augmented generations (RAGs). Code is available at: https://github.com/jihoontack/MAC.

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

↑