arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2406.16069cs.CLcs.AI
收藏

FastMem:对提示的快速记忆可提升大语言模型的上下文感知能力

FastMem: Fast Memorization of Prompt Improves Context Awareness of Large Language Models

KU Leuven(KU Leuven(天主教鲁汶大学));University of Science and Technology of China(中国科学技术大学);Institute for Advanced Algorithms Research, Shanghai(上海高级算法研究院);National University of Singapore(新加坡国立大学)

Junyi Zhu, Shuochen Liu, Yu Yu, Bo Tang, Yibo Yan, Zhiyu Li, Feiyu Xiong, Tong Xu, Matthew B. Blaschko

AI总结:

针对大语言模型上下文感知能力不足的问题,提出FastMem方法,通过推理前仅更新最后一个FFN模块快速记忆提示,在多类任务中显著提升模型性能与可靠性。

摘要:

大语言模型(LLMs)擅长生成连贯文本,但往往在上下文感知方面存在短板,导致在需要忠实遵循给定信息的任务中出现偏差。我们提出FastMem,这是一种通过快速记忆提示来增强指令微调LLMs上下文感知能力的新方法。FastMem仅通过更新最后一个前馈网络(FFN)模块,在推理前最大化提示的似然值。这种针对性方法可确保高效优化且不会过拟合,显著提升模型理解并准确遵循上下文的能力。我们的实验显示,该方法在阅读理解、文本摘要和输出结构遵循度方面均有大幅提升。例如,FastMem将Llama 3-8B-Inst在NQ-SWAP数据集上的准确率从59.1%提升至71.6%,并将Qwen 1.5-4B-Chat的输出结构失败率从34.9%降至25.5%。大量实验结果表明,FastMem有望为提升LLMs在各类应用中的可靠性与准确性提供稳健解决方案。我们的代码可在以下网址获取:https://github.com/IAAR-Shanghai/FastMem

英文摘要:

Large language models (LLMs) excel in generating coherent text, but they often struggle with context awareness, leading to inaccuracies in tasks requiring faithful adherence to provided information. We introduce FastMem, a novel method designed to enhance instruction fine-tuned LLMs' context awareness through fast memorization of the prompt. FastMem maximizes the likelihood of the prompt before inference by updating only the last Feed-Forward Network (FFN) module. This targeted approach ensures efficient optimization without overfitting, significantly improving the model's ability to comprehend and accurately follow the context. Our experiments demonstrate substantial gains in reading comprehension, text summarization and adherence to output structures. For instance, FastMem improves the accuracy of Llama 3-8B-Inst on the NQ-SWAP dataset from 59.1% to 71.6%, and reduces the output structure failure rate of Qwen 1.5-4B-Chat from 34.9% to 25.5%. Extensive experimental results highlight FastMem's potential to offer a robust solution to enhance the reliability and accuracy of LLMs in various applications. Our code is available at: https://github.com/IAAR-Shanghai/FastMem

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

↑