← Latest papers
💬 NLP

PI-Mem: Pushing Long-Context Reasoning to 3.6M Tokens with Parallel-Iterative Memory

The paper introduces PI-Mem, a parallel-iterative memory mechanism that processes all context chunks simultaneously and iteratively refines a shared memory with reinforcement learning-based adaptive termination, enabling large language models to achieve superior accuracy and significant inference speedups on long-context reasoning tasks up to 3.6 million tokens.

Original authors: Dawei Liu, Haixu Song, Shuang Cheng, Shijie Wang, Haozheng Hou, Kaifeng Liu, Ermo Hua, Zhonghang Yuan, Zhijie Zhong, Yuchen Fan, Biqing Qi, Bowen Zhou

Published 2026-08-05
📖 4 min read☕ Coffee break read

Original authors: Dawei Liu, Haixu Song, Shuang Cheng, Shijie Wang, Haozheng Hou, Kaifeng Liu, Ermo Hua, Zhonghang Yuan, Zhijie Zhong, Yuchen Fan, Biqing Qi, Bowen Zhou

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to solve a massive, 3.6-million-page mystery novel. You have a brilliant detective, a Large Language Model (LLM), who is incredibly smart but has a very short-term memory. If you hand the detective the whole book at once, their brain gets overwhelmed, and they start forgetting the clues from page 10 by the time they reach page 1,000,000. This is the "long-context" problem in artificial intelligence: how do we keep a computer's attention on the beginning of a story while it's reading the end?

To solve this, scientists have tried two main tricks. The first is like trying to stretch a rubber band; they try to force the model to remember everything at once, but the rubber band often snaps or gets too slow to use. The second, more popular trick, is the "Recurrent Memory" approach. Imagine a detective who reads the book one chapter at a time. After reading Chapter 1, they write a tiny summary note in a notebook, throw away the chapter, and move to Chapter 2. They read Chapter 2, update their note, throw away the chapter, and so on. The problem? If the detective reads a confusing chapter later on, they might accidentally scribble over their important note from Chapter 1, erasing a crucial clue forever. It's a slow, serial process where the detective has to wait for one note to be finished before starting the next, making the whole investigation drag on.

This is where a new team of researchers steps in with a fresh idea called PI-Mem (Parallel-Iterative Memory). Instead of the detective reading one chapter, updating the note, and moving on, PI-Mem gives the detective a superpower: the ability to read all the chapters at the same time, but with a twist.

Here is how PI-Mem works in the real world of this paper. Imagine the detective has a "Shared Global Memory" board. Instead of reading the book sequentially, the detective looks at every single chapter simultaneously, using the current state of the memory board as a guide. For each chapter, they ask: "Does this page have a new clue that isn't already on my board?" If the answer is yes, they pull that specific clue out. If the answer is no, they ignore the rest of the noise.

Once they've scanned all the chapters in parallel, they take only the new clues they found and merge them onto the memory board, creating a cleaner, more complete picture. Then, they repeat the process. They look at all the chapters again, but this time, they use the updated board to guide them. Maybe a clue they missed in Chapter 5 suddenly makes sense because they just found a matching piece in Chapter 200. They keep doing these "rounds" of scanning until no new clues are found or they hit a limit. Finally, they solve the mystery using only the consolidated clues on the board, not the entire 3.6-million-page book.

The researchers tested this method on two different AI models (Qwen3.5 and Qwen2.5) using a benchmark called HotpotQA, which involves answering tricky questions that require finding information across huge documents. They pushed the context length to a staggering 3.6 million tokens (roughly the size of a massive library).

The results were striking. Compared to the old "read-one-by-one" method (Recurrent Memory), PI-Mem didn't just get better answers; it got them much faster. On the 3.6-million-token test, PI-Mem improved the accuracy by 6.25 to 7.81 percentage points over the previous best method. Even more impressive, it was 6.1 times faster on the larger model and 2.1 times faster on the smaller one. The old method was so slow because the detective had to wait for every single step to finish before moving to the next. PI-Mem, by reading everything in parallel, turned a slow, winding road into a high-speed highway.

The team also used a special training technique called Reinforcement Learning to teach the AI when to stop. They gave the AI a "bonus" for finishing the investigation quickly if it had enough evidence, discouraging it from doing unnecessary extra rounds of reading. This ensured the system didn't waste time re-reading chapters it had already solved.

In short, the paper suggests that by changing how the AI "thinks" about long documents—switching from a slow, sequential note-taker to a parallel, iterative investigator—we can solve complex problems in massive amounts of text without losing the clues from the beginning. It proves that you don't need to force the AI to remember everything at once; you just need to give it a better way to organize the pieces of the puzzle as it finds them.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →