一个受人类启发的阅读代理,具有对非常长上下文的要点记忆。
A Human-Inspired Reading Agent with Gist Memory of Very Long Contexts
February 15, 2024
作者: Kuang-Huei Lee, Xinyun Chen, Hiroki Furuta, John Canny, Ian Fischer
cs.AI
摘要
当前的大型语言模型(LLMs)不仅受限于最大上下文长度,而且无法稳健地处理长输入。为了解决这些限制,我们提出了ReadAgent,这是一个LLM代理系统,在我们的实验中将有效上下文长度增加了20倍。受到人类互动阅读长文档的启发,我们将ReadAgent实现为一个简单的提示系统,利用LLMs的高级语言能力来(1)决定将哪些内容存储在一个记忆片段中、(2)将这些记忆片段压缩成称为要点记忆的短期记忆,以及(3)采取行动在原始文本中查找段落,如果ReadAgent需要提醒自己相关细节以完成任务。我们通过使用检索方法、使用原始长上下文以及使用要点记忆来评估ReadAgent与基线的性能。这些评估是在三个长文档阅读理解任务上进行的:QuALITY、NarrativeQA和QMSum。ReadAgent在所有三个任务上均优于基线,同时将有效上下文窗口扩展了3-20倍。
English
Current Large Language Models (LLMs) are not only limited to some maximum
context length, but also are not able to robustly consume long inputs. To
address these limitations, we propose ReadAgent, an LLM agent system that
increases effective context length up to 20x in our experiments. Inspired by
how humans interactively read long documents, we implement ReadAgent as a
simple prompting system that uses the advanced language capabilities of LLMs to
(1) decide what content to store together in a memory episode, (2) compress
those memory episodes into short episodic memories called gist memories, and
(3) take actions to look up passages in the original text if ReadAgent needs to
remind itself of relevant details to complete a task. We evaluate ReadAgent
against baselines using retrieval methods, using the original long contexts,
and using the gist memories. These evaluations are performed on three
long-document reading comprehension tasks: QuALITY, NarrativeQA, and QMSum.
ReadAgent outperforms the baselines on all three tasks while extending the
effective context window by 3-20x.