Autoregressive Search Engines: Generating Substrings as Document Identifiers

Michele Bevilacqua, Giuseppe Ottaviano, Patrick Lewis, Scott Yih, Sebastian Riedel, Fabio Petroni

SEAL (Search Engines with Autoregressive LMs) redefines document retrieval by training a language model to generate any substring (ngram) found within a document as its unique identifier. By pairing a BART model with a compressed FM-Index to constrain generation to valid corpus strings, the authors achieve state-of-the-art retrieval performance on the KILT benchmark while using up to 7x less memory than traditional dense retrievers.

The Problem with Existing Retrievers

In modern NLP, "Knowledge-Intensive" tasks (like open-domain QA or fact-checking) usually rely on a Retrieve-then-Read pipeline. While autoregressive language models (LMs) have become incredible "readers," they haven't traditionally been used as the "retriever."

Existing generative retrieval methods usually force a document into a rigid structure—for example, by training a model to generate a Wikipedia title or a specific ID in a hierarchical cluster tree. This is problematic because:

  1. Metadata Dependency: Not all documents have clean titles.
  2. Rigid Structure: Forcing documents into clusters can be arbitrary and hard for the model to learn.
  3. Hallucination: Without constraints, LMs might generate "identifiers" that don't actually exist in the corpus.

The authors tackle the challenge of creating a generative retriever that is flexible, doesn't require predefined metadata, and is grounded in the actual text of the corpus.

The SEAL Approach

The core innovation is SEAL, which treats every possible ngram in a document as a potential "search key."

SEAL Architecture
  1. Autoregressive Generation: Using a BART-large model, SEAL is trained so that, given a query, it generates a relevant 10-token span (ngram) found within the target document.
  2. Constrained Decoding via FM-Index: To prevent the model from hallucinating, they use an FM-Index (a compressed full-text substring index based on the Burrows-Wheeler Transform). During beam search, the FM-Index acts as a "white list," ensuring the model only generates strings that actually exist in the retrieval corpus.
  3. LM+FM Scoring: A document's score isn't just based on the LM's probability. The scoring function combines the LM's confidence with the frequency of the ngram in the corpus. Inspired by TF-IDF logic, a rare, distinctive ngram is a better "pointer" to a document than a common one.
  4. Intersective Scoring: Since a single document might contain multiple relevant ngrams, SEAL can aggregate scores from several generated spans to rank a document more accurately, effectively breaking ties between documents that share a top-scoring ngram.

Key Insights and Efficiency

  • The Corpus is the Index: By using ngrams as identifiers, the authors eliminate the need for artificial IDs or titles. The document's own content becomes the map to find it.
  • Generative Retrieval is Memory Efficient: Traditional dense retrievers (like DPR) store massive vector embeddings for every single passage in a corpus. SEAL only needs the model parameters and a highly compressed FM-Index.
Memory Footprint Comparison

As shown above, this results in a memory footprint 2 to 7 times smaller than DPR. On Natural Questions (21M passages), SEAL’s index is only 8.8 GB, compared to 64.6 GB for DPR’s vector index.

  • Better Generalization: Because SEAL learns to generate spans of text rather than just expanding queries with keywords, it generalizes better to "unseen" questions where the answer isn't a simple paraphrase of the training data.
  • Grounded Generation: The use of the FM-Index turns a "black box" generative model into a "grounded" search engine, ensuring that every output is a valid pointer to the source text.

Performance and Results

The authors evaluated SEAL on several high-stakes benchmarks, including Natural Questions (NQ) and the KILT Benchmark (a massive collection of 11 different knowledge-intensive tasks).

  • KILT SOTA: SEAL achieved an average improvement of at least 10 points in passage-level R-precision over established baselines on the KILT benchmark.
  • Downstream Performance: When paired with a "reader" model (Fusion-in-Decoder), SEAL established new state-of-the-art results on 4 out of 7 KILT datasets.
  • Zero-Shot Capabilities: SEAL matches or outperforms competitive models like GENRE and DSI, even on tasks where it wasn't explicitly tuned for page-level retrieval.

Limitations and Future Work

  • Inference Latency: While memory-efficient, autoregressive generation (beam search) is computationally more expensive than a simple vector dot product. Retrieval takes between 16 and 35 minutes for a full test set on a single GPU, which is slower than some "instant" keyword searches.
  • Static Index: The FM-Index used in this paper is static. If the corpus changes (e.g., new Wikipedia articles are added), the index needs to be rebuilt, though the authors suggest "dynamic FM-index" variants could solve this in the future.
  • Scaling: The study used a 400M parameter model. Moving to even larger LMs (like GPT-3 or T5-11B scale) would likely yield even more significant performance gains.

Summary updated

BibTeX
@inproceedings{bevilacqua2022autoregressive,
  author = {Michele Bevilacqua and Giuseppe Ottaviano and Patrick Lewis and Scott Yih and Sebastian Riedel and Fabio Petroni},
  title = {{Autoregressive Search Engines: Generating Substrings as Document Identifiers}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=Z4kZxAjg8Y},
}
Figure