Token-Level Credit Assignment Optimization for Generative Document Retrieval

Xinpeng Zhao, Yang Liu, Ran Chen, Xinyu Ma, Daiting Shi, Pengjie Ren, Zhumin Chen, Zhaochun Ren, Xin XinarXiv 2026 · DOI

TL;DR

Generative document retrieval models suffer from a granularity mismatch: they generate document identifiers (DocIDs) token-by-token but only receive feedback at the very end of the sequence. This paper introduces Token-Level Credit Assignment (TCA), a reinforcement learning framework that provides dense, step-by-step rewards by comparing the model's hidden-state trajectory against a gold reference trajectory. By precisely reinforcing early and intermediate routing decisions, TCA significantly boosts top-ranked retrieval accuracy across standard search benchmarks.

What Problem Does This Paper Address?

Traditional search engines rely on dense retrieval, where queries and documents are mapped to vectors and matched via nearest-neighbor search. Generative Retrieval (GR) offers a radical alternative: it directly generates a unique Document Identifier (DocID)—such as a URL or a semantic code—token-by-token, treating retrieval as a sequence-to-sequence problem.

However, GR faces a fundamental training challenge. While the model makes a sequence of token-level decisions during generation, relevance feedback is only available at the document level after the entire DocID is complete. Existing reinforcement learning (RL) approaches handle this by applying a uniform sequence-level reward to every single token in the sequence. This uniform credit assignment creates a "granularity mismatch" (as illustrated in Figure 1). It obscures the impact of individual tokens, making it impossible for the model to distinguish between a brilliant early routing decision and a late token that steers the generation entirely off-course.

Figure 1: Comparison between sequence-level and token- level credit assignment in generative retrieval. Sequence- level rewards assign the same document-level signal to all generated DocID tokens, whereas token-level rewards pro- vide step-wise feedback for individual token decisions.

Methods

To bridge this gap, the authors propose Token-Level Credit Assignment for Generative Retrieval (TCA). The framework operates in two stages:

  1. Supervised Fine-Tuning (SFT): The model is first trained via standard cross-entropy loss to learn the basic syntax of the DocID space and query-to-identifier mapping.
  2. Token-Level Reinforcement Learning: The SFT model is frozen to act as a reference. During the RL rollout phase, the active policy generates candidate DocIDs using trie-constrained beam search.

Instead of a single scalar reward at the end, TCA computes a dense Trajectory Reward at each decoding step. It measures the cosine similarity between the final-layer decoder hidden state of the generated token and the corresponding hidden state from the gold DocID trajectory under teacher forcing. The final token-level reward combines this trajectory similarity with an overflow length penalty (to discourage over-generation) and an exact-match bonus.

Crucially, TCA is optimizer-agnostic. The authors demonstrate its flexibility by implementing it with two distinct RL algorithms:

  • TCA-GRPO: Uses Group Relative Policy Optimization to estimate advantages by comparing a group of candidate DocIDs sampled for the same query.
  • TCA-PPO: Uses a standard Actor-Critic Proximal Policy Optimization setup with a learned value function head.

The complete architecture for the GRPO variant is detailed in Figure 2.

Figure 2: Overview of the proposed Token-Level Credit Assignment for Generative Retrieval with GRPO (TCA-GRPO).

Datasets

The authors evaluated TCA on two widely accepted document retrieval benchmarks:

  • MS MARCO (MS): A large-scale dataset featuring real web search queries from Bing.
  • Natural Questions (NQ): A dataset consisting of Google search queries paired with Wikipedia pages containing the answers.

Experiments were conducted using two distinct DocID formats: Title+URL (TU) (lexical, human-readable identifiers) and Product Quantization (PQ) (discrete semantic codes obtained via vector quantization).

Key Insights and Ideas

  • Dense Trajectory Alignment over String Matching: Rather than relying on rigid string prefix matching to assign rewards, TCA operates in the continuous hidden-state space. This allows the model to receive soft, meaningful gradient signals even if it deviates slightly from the exact gold token sequence, provided it remains semantically aligned.
  • Early Routing is Critical: A key case study revealed that the candidate space drops exponentially after the first few tokens (e.g., from ~9,000 valid choices to just 8 after token one). TCA primarily strengthens the model's confidence at these highly uncertain, early decoding positions where routing mistakes are fatal.
  • GRPO Outperforms PPO for Retrieval: While TCA is compatible with both optimizers, GRPO delivers more stable and consistent gains. PPO struggles because learning a continuous value function over highly discrete, trie-constrained DocID prefix spaces is inherently unstable.

Key Results

TCA-GRPO consistently outperformed both the SFT baseline and state-of-the-art sequence-level RL methods (like DDRO and GenRRL) across both datasets:

  • MS MARCO (TU DocIDs): TCA-GRPO achieved a Recall@1 of 39.60% and an MRR@10 of 51.10%, outperforming the strong DDRO baseline (38.24% R@1, 50.33% MRR@10).
  • Natural Questions (PQ DocIDs): TCA-GRPO reached 50.02% Recall@1 and 56.10% MRR@10, compared to DDRO's 48.10% and 54.32%.
  • Ablation Verification: Replacing TCA's token-level rewards with sequence-level rewards while keeping the GRPO optimizer fixed resulted in a clear performance drop, confirming that fine-grained credit assignment is the primary driver of the model's success.

Limitations and Future Work

The authors acknowledge two main practical limitations of the current framework:

  1. Pipeline Complexity: TCA introduces a multi-stage training pipeline that requires pre-computing and caching gold hidden-state trajectories from a frozen reference model before RL can begin.
  2. Computational Overhead: Generating rollouts via constrained beam search and calculating token-level rewards on the fly adds significant training time and resource costs.

Future research directions include simplifying this two-stage procedure into a more unified framework and optimizing the runtime efficiency of RL-based generative retrieval.

Summary updated

BibTeX
@misc{zhao2026token,
  author = {Xinpeng Zhao and Yang Liu and Ran Chen and Xinyu Ma and Daiting Shi and Pengjie Ren and Zhumin Chen and Zhaochun Ren and Xin Xin},
  title = {{Token-Level Credit Assignment Optimization for Generative Document Retrieval}},
  year = {2026},
  eprint = {2608.12049},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.12049},
}
Figure