[Paper Review] RecurrentGPT: Interactive Generation of (Arbitrarily) Long Text
RecurrentGPT uses a language-based recurrence mechanism with long- and short-term memories stored as natural language to enable arbitrarily long text generation and interactive writing with LLMs like ChatGPT. It demonstrates interactive fiction and consumer-facing content use cases.
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.
Motivation & Objective
- Address the fixed-size context limitation of Transformer-based LLMs for long-form text generation.
- Introduce a language-based surrogate for recurrence that uses natural language memories and prompts.
- Enable interactive, interpretable, and customizable long-text generation with no architectural changes to the backbone LLM.
- Demonstrate applications in interactive writing, personalized interactive fiction, and AI-as-content interactions.
Proposed method
- Represent LSTM-like components (content, plan, short-term memory, long-term memory) as natural language paragraphs and summaries.
- Store long-term memory as a VectorDB of embedded content on disk to exceed GPU memory limits.
- Use a prompt template to simulate the recurrent computation graph of an LSTM, generating new content, a plan for the next section, and updated memories.
- Provide multiple generated plans per timestep to support user choice and interaction.
- Incorporate a human-in-the-loop simulator to select and revise plans for autonomous long-text generation.
- Demonstrate integration with ChatGPT/GPT-4 as backbones and compare against baselines like Rolling-ChatGPT, RE3, and DOC.

Experimental results
Research questions
- RQ1Can a language-based recurrence mechanism enable truly long-form text generation beyond fixed context windows?
- RQ2Does storing long-term memory on disk with semantic retrieval preserve coherence over thousands of tokens?
- RQ3Does interactive generation via plans and memories improve interpretability and writer productivity?
- RQ4How does RecurrentGPT compare to hierarchical long-text systems and rolling-context baselines in coherence and interest?
Key findings
- RecurrentGPT produces significantly longer, coherent texts compared to rolling-context baselines and prior long-text methods in human evaluations.
- Long- and short-term memories contribute substantially to coherence, with GPT-4 backbones yielding stronger performance than ChatGPT or GPT-3.5.
- The approach enables autonomous long-text generation and interactive writing, with multiple generated plans supporting user choice and editing.
- Human evaluation favored RecurrentGPT across genres (sci-fi, romance, fantasy, horror, mystery, thriller) and longer lengths (~6000 words).
- A more powerful backbone LLM (GPT-4) substantially improves performance over lighter backbones in ablations.
- Experiments also explore interactive fiction formats and consumer-facing AI as content.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.