Residual Trajectory Distillation for Generative Retrieval
Weihao Shen, Wei Chen, Fuwei Zhang, Guojun Liu, Qingsong Hua, Wei Lin, Fuzhen Zhuang
cs.IR
2026-09-30
ResTD distills residual trajectories discarded by RQ indexing into generative retrieval training, first on all 15 ESCI metrics across three languages at zero inference cost.
Generative retrieval treats search as sequence generation: given a query, the model autoregressively writes out a discrete Semantic ID (SID) for the target product or document. Most systems build these IDs with residual quantization (RQ), which picks the nearest codeword at each level and passes the remaining residual to the next. Training then supervises only the final code sequence. That argmin step flattens real information: two items can land on the same codeword through very different residuals, with different orderings and margins over competing codewords, and each residual also determines the input to the next quantization level. The indexer computes all of this and then throws it away. The paper calls this the gap between indexing and retrieval training.
ResTD turns the frozen RQ indexer into a process teacher. The deployed index never changes.
The auxiliary loss enters through a linear warmup and is capped at 5% of the SID loss. At inference the teachers and heads are removed; the index, decoding distribution, and trie-constrained beam search (beam 100) are untouched.
On ESCI product search in English, Spanish, and Japanese (T5-base / mT5-base; 4 RQ levels, 256 codewords each):
| Setting | Metric | Best baseline (CaLIR) | ResTD |
| ESCI-US | Recall@5 | 7.50 | 9.28 (+23.7% rel.) |
| ESCI-US | Recall@10 | 12.69 | 14.34 (+13.0%) |
| ESCI-US | NDCG@10 | 11.12 | 12.99 (+16.8%) |
| ESCI-JP | Recall@5 | 6.05 | 7.61 (+25.8%) |
| ESCI-ES | NDCG@10 | 12.43 | 14.22 (+14.4%) |
It ranks first on all 15 metrics (3 languages by 5 metrics) against BM25, BGE-M3, TIGER, MERGE, HGRec, and others. Gains concentrate at early ranks; the relative gain on Recall@100 shrinks to 3.6-6.4%.
The matched controls are more informative than the leaderboard. From the same reproduced CaLIR checkpoint, a 1,200-update budget, and three paired seeds: plain continued training reaches R@10 12.82, current-level distillation only 13.23, full multi-horizon 14.34. Swapping future soft targets for future hard labels drops it to 13.56; codebook-only soft targets give 13.48; a shuffled teacher gives 12.86, indistinguishable from doing nothing. So the gain tracks the residual geometry itself, not soft targets in general. Probes on frozen retrievers back the mechanism: future codebook preferences become 5.3-13.8% more recoverable from early decoder states, while current-level targets move only 0.1-0.3%.
Transfer holds up elsewhere. On NQ320K, Recall@10 on unseen queries is 4.79 against CaLIR's 0.51. Plugged into TIGER-style recommendation, Yelp Recall@10 reaches 4.87 (ETEGRec 4.15) and Beauty 7.28 (best baseline 6.15). Training cost is 1.12x per update, +31.8 MB peak memory, and 0.09 GB of precomputed residuals; inference overhead is zero.
For teams already running RQ-based generative retrieval or recommendation, this is a low-risk, training-side change: keep the deployed index and decoder, add a few projection heads and one auxiliary loss. The supervision signal was already computed during indexing and then discarded. It is an incremental improvement rather than a new paradigm, but the controls are unusually thorough, and the finding that residual-induced preferences beat both hard future labels and codebook-only soft targets is a useful data point for anyone designing SID training.