LongZero: Enhancing Long-Context Reasoning in LLMs from Zero Data
Zhennan Wan, Jianfei Chen
arXiv:2610.30132v1Large language models are getting better at reading long documents, long conversations, and even whole books. But there’s still a big gap between handling long inputs in a superficial way and doing real long-context reasoning: finding the right evidence, ignoring distractors, combining facts across documents, and producing an answer that is actually grounded in the context. That matters for practical uses like enterprise search, legal or medical review, customer support over long chat histories, and any setting where the model has to reason over a large body of text rather than just recall something from its pretraining. This paper focuses on a very specific obstacle to improving that ability: training data. Reinforcement learning with verifiable rewards has been very successful for short reasoning tasks, but long-context RL needs training examples that are long, diverse, difficult enough to teach the model something, and still automatically checkable. Human annotation is expensive, naturally occurring long-context question-answer data is limited, and many synthetic pipelines still depend on external corpora or stronger teacher models. That becomes awkward when the goal is to improve the model without relying on outside help. There is also another subtle issue: if the model can answer from its own parametric memory instead of the provided context, then the training signal becomes muddy. The key question here is whether a model can improve its long-context reasoning from zero data — meaning, with no external training set at all, just by generating its own tasks. That idea has already worked well in short-context domains like math, code, games, and agents. But long-context tasks are harder, because the task itself includes not just a question, but a long input that must be consistent with the question and answer. If you ask the model to write a long document first and then invent a question about it, you’re asking it to do the very thing it is bad at. The authors’ central insight is to reverse the order. First, the model writes a compact structured specification: the question, the supporting evidence, and the answer. Only after the answer is fixed do they expand that evidence into a long multi-document context. So the long text is generated around a known answer, not the other way around. That idea is the basis of LongZero. It uses the model being trained to synthesize two complementary kinds of long-context tasks. The first is reasoning over multiple documents. The second is retrieval in long conversations, similar to multi-round coreference-style tasks, where the model must recover one specific earlier response among many similar ones. Then the same model is trained with GRPO, group-relative policy optimization, on these self-generated tasks. To understand the method, it helps to separate the two phases of data generation: specification and expansion. For reasoning tasks, LongZero creates a fictional world made up of entities and facts. The facts are organized into chains of questions, where each question may require multiple hops of reasoning and may include distractor facts that look similar to the relevant ones. The world is built top-down. The model first writes a strict JSON specification containing named entities, atomic facts, distractors, and questions with their answers and supporting facts. This specification is short enough that it can be generated and checked reliably. It also fixes the answer before any long context exists. Then comes expansion. The facts are assigned across multiple documents, spread so that the supporting facts for a given question are split across different documents, while distractors are placed in nearby but separate locations. The model writes each document in a chosen genre, such as a report or biography, and each fact is stated exactly once. After that, the documents are shuffled into a long context. A verification step keeps only questions whose answer still appears verbatim, or as a valid alias, in the expanded text. That gate matters because it removes samples that broke during expansion. The result is a long-context reasoning example where the answer is determined by construction, but the model still has to retrieve and combine evidence from across the context. For retrieval tasks, LongZero follows the general shape of the MRCR benchmark. In these tasks, a conversation contains many similar requests, like asking for poems or other short outputs, and later the model is asked to reproduce one specific earlier response, identified by position and a random prefix. Instead of using real conversations, LongZero has the model write the conversational content itself. It starts from a small set of formats and common nouns, generates many responses to prompts like “write a poem about tigers,” and then a program assembles a long conversation by mixing in those responses at random positions among other responses. The target answer is simply the selected earlier response with the random prefix attached. So again, the task is correct by construction, but it still requires tracking order and distinguishing similar pieces of text over a long context. There’s one more important ingredient: difficulty filtering. GRPO only gives learning signal when a prompt is answered inconsistently within a group — not always right, not always wrong. If the model always solves a question, there’s no gradient. If it always fails, that’s also unhelpful, and in this setting those always-failed examples are often defective anyway, for example because the expansion introduced conflicting facts. So LongZero has the model test its own questions and keeps only the unstable middle band: questions that are sometimes answered correctly and sometimes incorrectly. That gives a more useful training set. The paper evaluates this on two base language models and five long-context reasoning benchmarks. The benchmarks include realistic long-context reasoning tasks, not just synthetic retrieval probes. The authors compare LongZero against two baselines that also use synthetic data but rely on external corpora. The exact details of every benchmark are less important than the overall design: they want to know whether self-generated long-context tasks can transfer to real tasks, and whether this zero-data approach can beat synthetic data built from outside resources. The main result is that it can. LongZero generalizes from its self-written tasks to real long-context reasoning benchmarks, and it outperforms both external-corpus baselines. That is the strongest claim in the paper: not just that the model gets better on the kind of tasks it generated for itself, but that the improvement transfers to more realistic long-context reasoning. In other words, the self-generated training signal is not merely overfitting to a toy world. It appears to teach the model something broadly useful about long-context evidence gathering, distractor rejection, and retrieval over extended text. What do these results actually show? First, they support the paper’s core hypothesis that the order of generation matters. By writing a compact specification before expanding into long text, the model avoids having to reason over a long context just to create the training example. Second, they suggest that external data may not be necessary to create effective long-context RL training, at least for this kind of task. Third, they show that combining reasoning-style tasks with retrieval-style tasks is useful, since long-context ability is not just about answering questions from documents; it also includes following structure and locating exact earlier content in long sequences. The paper also positions LongZero relative to prior work. Many earlier long-context RL methods rely on existing datasets, real documents, knowledge graphs, or stronger teacher models. LongZero is different because both the questions and the contexts come from the model being trained. That makes it complementary to improvements in reward design or RL algorithms. It also avoids some confounds of using real-world text, such as overlap with evaluation data or the model answering from memorized knowledge instead of the context. There are still limitations to keep in mind. The training worlds are fictional, so even though that reduces leakage and reliance on parametric knowledge, there is still a gap between synthetic worlds and messy real documents. The tasks are designed to be verifiable and structured, which is a strength for training, but real-world long-context reasoning may involve more ambiguity, more implicit evidence, and less cleanly separable facts. The retrieval tasks are also a particular style of long-context challenge, focused on repeated similar responses and order tracking. That is useful, but it’s not the whole story of long-context understanding. Another limitation is that the method depends on the model’s own ability to generate reasonably good specifications and expansions. The paper’s filtering helps, but it doesn’t eliminate the possibility of defective samples or narrow task distributions. And since the approach is built around GRPO and verifiable rewards, it is most naturally suited to tasks where correctness can be checked automatically. So the takeaway is straightforward but important: LongZero shows that a language model can bootstrap its own long-context reasoning training data without external corpora, by first writing a short structured world and only then expanding it into a long context. That simple change in generation order makes zero-data long-context RL feasible. The result is a promising path toward improving long-context reasoning in a way that is scalable, self-contained, and less dependent on curated datasets or stronger teachers.
Also spotted that day
Previous daily papers