Skip to main content
QUICK REVIEW

[论文解读] RecurrentGPT: Interactive Generation of (Arbitrarily) Long Text

Wangchunshu Zhou, Yuchen Eleanor Jiang|arXiv (Cornell University)|May 22, 2023
Topic Modeling被引用 10
一句话总结

RecurrentGPT 使用基于语言的递归机制,将长短期记忆以自然语言存储,以实现任意长度文本生成并与 ChatGPT 等大模型进行交互写作。它演示了互动式虚构和面向消费者的内容用例。

ABSTRACT

The fixed-size context of Transformer makes GPT models incapable of generating arbitrarily long text. In this paper, we introduce RecurrentGPT, a language-based simulacrum of the recurrence mechanism in RNNs. RecurrentGPT is built upon a large language model (LLM) such as ChatGPT and uses natural language to simulate the Long Short-Term Memory mechanism in an LSTM. At each timestep, RecurrentGPT generates a paragraph of text and updates its language-based long-short term memory stored on the hard drive and the prompt, respectively. This recurrence mechanism enables RecurrentGPT to generate texts of arbitrary length without forgetting. Since human users can easily observe and edit the natural language memories, RecurrentGPT is interpretable and enables interactive generation of long text. RecurrentGPT is an initial step towards next-generation computer-assisted writing systems beyond local editing suggestions. In addition to producing AI-generated content (AIGC), we also demonstrate the possibility of using RecurrentGPT as an interactive fiction that directly interacts with consumers. We call this usage of generative models by ``AI As Contents'' (AIAC), which we believe is the next form of conventional AIGC. We further demonstrate the possibility of using RecurrentGPT to create personalized interactive fiction that directly interacts with readers instead of interacting with writers. More broadly, RecurrentGPT demonstrates the utility of borrowing ideas from popular model designs in cognitive science and deep learning for prompting LLMs. Our code is available at https://github.com/aiwaves-cn/RecurrentGPT and an online demo is available at https://www.aiwaves.org/recurrentgpt.

研究动机与目标

  • 解决基于 Transformer 的大模型在长文本生成中的固定上下文长度限制。
  • 提出一种以自然语言记忆和提示为核心的递归代理。
  • 在不对主干 LLM 架构进行改动的前提下,实现交互式、可解释且可定制的长文本生成。
  • 展示在互动写作、个性化互动式虚构,以及 AI 即内容交互等应用场景。

提出的方法

  • 将 LSTM 类组件(内容、计划、短期记忆、长期记忆)表示为自然语言段落与摘要。
  • 将长期记忆存储为磁盘上的嵌入内容向量数据库(VectorDB),以突破 GPU 内存限制。
  • 使用提示模板来模拟 LSTM 的递归计算图,生成新内容、下一节的计划以及更新后的记忆。
  • 在每个时间步提供多种生成计划以支持用户选择和互动。
  • 引入人类在环的仿真器来选择并修订计划,以实现自主的长文本生成。
  • 展示与 ChatGPT/GPT-4 作为主干模型的集成,并与 Rolling-ChatGPT、RE3、DOC 等基线进行对比。
Figure 1: Illustration of the RecurrentGPT framework. RecurrentGPT enables recurrent prompting with LLMs by simulating an RNN using natural language building blocks and defines the recurrent computation graph with prompts.
Figure 1: Illustration of the RecurrentGPT framework. RecurrentGPT enables recurrent prompting with LLMs by simulating an RNN using natural language building blocks and defines the recurrent computation graph with prompts.

实验结果

研究问题

  • RQ1语言基础的递归机制是否能够实现超越固定上下文窗口的真正长文本生成?
  • RQ2将长期记忆存储在磁盘并进行语义检索是否能在成千上万个词的长度下保持连贯性?
  • RQ3通过计划与记忆进行的交互式生成是否提升可解释性和写作效率?
  • RQ4与分层长文本系统和滚动上下文基线相比,RecurrentGPT 在连贯性和趣味性方面的表现如何?

主要发现

  • 与滚动上下文基线和此前的长文本方法相比,RecurrentGPT 在人类评估中产生的文本更长且更具连贯性。
  • 长短期记忆对连贯性贡献显著,GPT-4 主干在性能上优于 ChatGPT 或 GPT-3.5。
  • 该方法实现了自主的长文本生成与交互式写作,且多种生成计划支持用户选择和编辑。
  • 在人类评估中,RecurrentGPT 在科幻、恋爱、奇幻、恐怖、悬疑、惊悚等体裁和较长长度(约 6000 字)方面表现更佳。
  • 更强大的主干 LLM(GPT-4)在消融实验中显著提升性能,相对于较弱的主干有明显改进。
  • 实验还探讨了互动式虚构格式和面向消费者的 AI 作为内容的应用。
Figure 2: Qualitative analysis of using RecurrentGPT as an interactive writing assistant and an interactive fiction. Highlighted plans or choices are that selected by human users.
Figure 2: Qualitative analysis of using RecurrentGPT as an interactive writing assistant and an interactive fiction. Highlighted plans or choices are that selected by human users.

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。