Nonparametric Decoding for Generative Retrieval

Hyunji Lee, JaeYoung Kim, Hoyeon Chang, Hanseok Oh, Sohee Yang, Vladimir Karpukhin, Yi Lu, Minjoon Seo

Abstract

Generative retrieval models, which identify documents by generating their identifiers, are traditionally constrained by a "parameter bottleneck"—the requirement to memorize an entire corpus within fixed model weights. We introduce Nonparametric Decoding (Np Decoding), a method that augments generative models with an external memory of contextualized embeddings. By replacing static vocabulary embeddings with a Contextualized Embedding Matrix (CE), we allow models to leverage fine-grained document information without increasing parameter count. Our approach, combined with k-means clustering for efficiency and contrastive learning for better alignment, enables smaller models to outperform significantly larger counterparts. Evaluation across the KILT benchmark and other retrieval tasks demonstrates substantial improvements in accuracy and zero-shot generalization.

Introduction

In modern text retrieval, two dominant paradigms exist: Bi-encoders (e.g., DPR) and Generative Retrieval (e.g., DSI, GENRE). Bi-encoders map queries and documents into a shared vector space but suffer from an "embedding space bottleneck," where complex documents are compressed into single fixed-size vectors. Generative models, conversely, allow for better interaction by generating document identifiers token-by-token but are limited by the "parameter bottleneck," requiring massive models to memorize large corpora.

This research proposes a middle ground: a generative model that retrieves "nonparametric" information from an external memory during the decoding process, effectively breaking the capacity limits of standard generative architectures.

Methodology

The core innovation is the transition from a static vocabulary to a Contextualized Embedding Matrix (CE).

Nonparametric Decoding (Np Decoding)

Instead of using a standard, trainable "vanilla" embedding for each word, the model utilizes embeddings produced by a separate, frozen CE Encoder. These embeddings are contextualized; for instance, the vector for the word "Apple" differs significantly depending on whether the source document discusses fruit or technology. During decoding, the generative retriever references this CE matrix to calculate probabilities over the vocabulary.

Overview of the Np Decoding architecture, illustrating the generation process using the Contextualized Embedding Matrix (CE) compared to vanilla embeddings.

Efficiency and Optimization

Storing every contextualized embedding for a massive corpus is computationally prohibitive (e.g., ~148GB). To address this, the authors employ k-means clustering to retain only a few representative "centroids" (optimally $k=5$) for each token. This reduces the storage footprint to a manageable ~0.47GB. Furthermore, a Contrastive Learning (CONTRA) variant was developed, training the CE Encoder with a token-level loss to ensure query representations align closely with the specific token embeddings of target documents.

Experimental Evaluation

The researchers evaluated Np Decoding across nine diverse datasets, primarily focusing on the KILT Benchmark, which includes tasks such as fact-checking (FEVER), slot filling (zsRE, TREX), and open-domain QA (Natural Questions, TriviaQA). Additional tests were conducted on NQ-320k for document identifier retrieval and HotpotQA for multi-hop reasoning.

Results and Insights

Np Decoding demonstrates that the primary bottleneck in generative retrieval is storage capacity rather than reasoning ability. By offloading knowledge to the CE matrix, a T5-base model can outperform a T5-large model (which has 3.5x more parameters).

Performance comparison across the KILT benchmark. G*-CONTRA denotes the Np Decoding model with contrastive training, showing superior performance over BM25, DPR, and standard GENRE.

Key findings include:

  • Performance Gains: Np Decoding improved R-precision by an average of 4.4% on single-hop tasks and Recall@2 by 5.4% on multi-hop tasks.
  • DSI Integration: On the NQ-320k dataset, applying Np Decoding to the DSI model boosted Hits@1 from 13.3% to 58.7%.
  • Zero-Shot Generalization: Because the nonparametric space can be shared across domains, the model generalizes significantly better to unseen datasets than standard generative models.
  • Data Efficiency: The "CONTRA" variant trained on only 5% of the data performed comparably to standard models trained on the full KILT dataset.

Limitations and Future Work

While powerful, the method currently requires pre-constructing the CE matrix, making the indexing of dynamic corpora (where documents are frequently added) more complex than traditional search. The model's performance is also sensitive to the consistency of the k-means clustering process. Future research aims to extend Np Decoding to models that generate entire document spans or full sequences rather than just short identifiers.

Summary updated

BibTeX
@inproceedings{lee2023nonparametric,
  author = {Hyunji Lee and JaeYoung Kim and Hoyeon Chang and Hanseok Oh and Sohee Yang and Vladimir Karpukhin and Yi Lu and Minjoon Seo},
  title = {{Nonparametric Decoding for Generative Retrieval}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  url = {https://openreview.net/forum?id=mIUvvc7BzCQ},
}
Figure