DiffuGR: Generative Document Retrieval with Diffusion Language Models

Xinpeng Zhao, Zhaochun Ren, Yukun Zhao, Zhenyang Li, Mengqi Zhang, Jun Feng, Ran Chen, Ying Zhou, Zhumin Chen, Shuaiqiang Wang, Dawei Yin, Xin Xin

TL;DR

Generative Document Retrieval (GR) traditionally relies on auto-regressive, left-to-right token generation to predict document identifiers (DocIDs), making it highly sensitive to early-stage errors. DiffuGR flips this paradigm by modeling retrieval as a discrete diffusion process, generating DocID tokens in parallel and iteratively refining them. This approach not only eliminates cascading decoding errors but also introduces a flexible runtime "knob" to dynamically balance retrieval speed against accuracy.

What Problem Does This Paper Address?

Traditional search engines rely on index-based pipelines (like dual-encoders or BM25) to match queries to documents. Generative Retrieval (GR) simplifies this by training a single sequence-to-sequence language model to directly generate a unique document identifier (DocID)—such as a title or a semantic code—given a query.

However, current GR models generate these DocIDs auto-regressively (one token at a time, from left to right). This introduces two major flaws:

  1. The Cascading Error Problem: Unlike natural language, where a typo or a poor word choice can be corrected by subsequent context, an incorrect DocID token generated early in the sequence completely derails the search, leading to an entirely wrong document.
  2. Inflexible Latency Control: Auto-regressive models must run for a fixed number of steps proportional to the DocID length. They cannot easily adapt to real-world production environments where a system might need to sacrifice a bit of accuracy for faster response times during peak traffic.
Figure 1: In contrast to auto-regressive generative retrieval (above), which generates the DocID from left to right, DiffuGR (below) efficiently generates multiple tokens in par- allel and then re-masks uncertain tokens. The generation is progressively refined over controllable denoising steps.

Methods

The authors introduce DiffuGR, which formulates DocID generation as a discrete masked diffusion process. The framework operates in three distinct stages:

  1. DocID Construction: DiffuGR supports two types of identifiers: text-based DocIDs (using document titles or leading tokens) and learnable DocIDs (constructed via residual quantization of dense document embeddings).
  2. Training (Forward & Reverse Processes): During the forward process, the model stochastically replaces DocID tokens with a [MASK] token based on a random noise schedule. In the reverse process, a diffusion language model (built on architectures like LLaDA or Dream) learns to predict the original tokens given the query and the remaining unmasked context.
  3. Inference (Parallel Denoising): Instead of generating left-to-right, DiffuGR starts with a completely masked sequence and predicts all tokens in parallel. It then uses a denoising strategy (such as Maskgit plus, which evaluates token confidence) to re-mask the most uncertain tokens and iterate.

To handle the lack of a traditional beam search in non-autoregressive models, the authors introduce a Diffusion Beam Search and Candidate Trajectory Extraction (CTE) to surface multiple diverse document candidates from intermediate denoising states.

Overview of the DiffuGR framework showing construction, training, and inference stages

Datasets

The model was evaluated on two primary document retrieval benchmarks:

  • NQ320K: A widely used dataset based on Natural Questions, downsampled to approximately 100k Wikipedia documents with well-formulated titles.
  • MS MARCO: A large-scale, real-world web search dataset sampled from Bing queries, which presents a harder challenge due to noisier document titles and ambiguous queries.
  • BEIR (Arg, SciDocs): Used specifically for zero-shot evaluation to test the model's generalization capabilities.

Key Insights and Ideas

  • Bidirectional Context Matters: Because diffusion models look at the entire sequence simultaneously, they can use later tokens to correct earlier mistakes. This breaks the rigid dependency chain of auto-regressive models.
  • Text Beats Learnable Codes: Surprisingly, text-based DocIDs (titles) consistently outperformed learnable quantized codes. The authors note that text-based IDs seamlessly inherit the pre-existing semantic space of large language models, whereas learnable codes require the model to expand its vocabulary and map entirely new semantic relationships.
  • Mitigating Catastrophic Forgetting: When continually trained on new documents, GR models usually forget old ones. DiffuGR's bidirectional attention and non-autoregressive nature make it significantly more resilient to this "catastrophic forgetting" than its auto-regressive peers.

Key Results

DiffuGR achieved massive performance leaps over existing state-of-the-art generative retrievers:

  • NQ320K Performance: DiffuGR (using the Dream-Text variant) achieved a 69.73% Recall@1 and 74.65% MRR@10, drastically outperforming the strong auto-regressive baseline DDRO, which only hit 48.10% Recall@1.
  • MS MARCO Performance: On the noisier MS MARCO dataset, DiffuGR maintained its lead, hitting 45.72% Recall@1 (LLaDA-Text) compared to DDRO's 37.76%.
  • The Efficiency Knob: As shown in the quality-speed tradeoff curves, reducing the number of diffusion denoising steps by half cut down latency significantly while maintaining highly competitive accuracy—a feat impossible with standard auto-regressive decoding.

Limitations and Future Work

Despite its strong performance, DiffuGR has a few limitations that the authors plan to address:

  • No Constrained Decoding Support: Unlike auto-regressive models that can use prefix trees (tries) to ensure only valid DocIDs are generated, DiffuGR can occasionally generate invalid or duplicate tokens. Currently, it relies on a post-hoc Hamming distance check to map invalid outputs to the nearest valid DocID.
  • Catastrophic Forgetting: While DiffuGR handles continual learning better than previous GR models, performance on old documents still degrades noticeably when new documents are introduced.
  • DocID Optimization: This work focused entirely on the generation mechanism; optimizing how the DocIDs themselves are constructed remains an open challenge.

Summary updated

BibTeX
@misc{zhao2025diffugr,
  author = {Xinpeng Zhao and Zhaochun Ren and Yukun Zhao and Zhenyang Li and Mengqi Zhang and Jun Feng and Ran Chen and Ying Zhou and Zhumin Chen and Shuaiqiang Wang and Dawei Yin and Xin Xin},
  title = {{DiffuGR: Generative Document Retrieval with Diffusion Language Models}},
  year = {2025},
  eprint = {2511.08150},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.08150},
}
Figure