Generative Retrieval for Book search

Yubao Tang, Ruqing Zhang, Jiafeng Guo, Maarten de Rijke, Shihao Liu, Shuaiqing Wang, Dawei Yin, Xueqi Cheng

Abstract

Traditional book retrieval systems struggle with the massive scale and hierarchical structure of long-form text. This paper introduces GBS (Generative retrieval for Book Search), a framework that treats retrieval as a text generation task. By leveraging hierarchical data augmentation and a novel outline-oriented encoding mechanism, GBS effectively processes books up to 128,000 tokens. Experimental results on proprietary and public datasets demonstrate that GBS outperforms existing state-of-the-art models by nearly 10% in retrieval accuracy.

Introduction

Traditional search engines typically rely on keyword matching or dense vector embeddings to rank documents. Generative Retrieval (GR) represents a paradigm shift where models are trained to directly generate the unique identifier (ID) of a relevant document in response to a query. While promising, applying GR to the domain of books presents significant challenges due to the sheer length of the content and the complex hierarchical structure inherent in literary works.

The Challenge of Book Retrieval

Books are not monolithic blocks of text; they are structured entities comprising metadata (title, author, publisher), a hierarchical outline (chapters and sections), and extensive main text. Standard GR models often fail to capture this structural context, leading to poor performance on long-form content. Furthermore, training these models requires vast amounts of labeled query-document pairs, which are difficult to obtain for niche or specialized books.

The structural components of a book, including metadata, main text, and the hierarchical outline.

The GBS Framework

To address these issues, the researchers developed GBS, which focuses on two primary innovations: advanced data augmentation and outline-oriented encoding.

Hierarchical Data Augmentation

GBS employs a dual-pronged augmentation strategy to improve model robustness:

  • Indexing Augmentation: The model is trained on various granularities of book content, including keywords, summaries, and specific section/chapter text, all mapped to hierarchical identifiers.
  • Query Augmentation: Large Language Models (LLMs) are used to synthesize pseudo-queries. These include "single-chapter queries" for factual retrieval and "multi-chapter queries" for thematic searches, mirroring real-world user behavior.

Outline-Oriented Book Encoding

To handle sequences up to 128,000 tokens, GBS introduces architectural modifications:

  • Bi-level Positional Encoding: Unlike standard linear encoding, GBS uses a hierarchical system that tracks both section-level and chapter-level positions, preserving the book's "skeleton."
  • Retentive Attention: By replacing standard attention with a retentive module, the model maintains a long-term memory buffer, allowing it to process significantly longer contexts than traditional Transformers.
Detailed breakdown of a book's outline, showing the hierarchy of chapters and section titles.

Experimental Evaluation

The framework was tested on two major datasets:

  1. BBS (Baidu Book Search): A large-scale dataset of Chinese and English books (up to 40,000 titles) with an average length of 225,000 words.
  2. WhatsThatBook: A public dataset containing "tip-of-the-tongue" queries from community forums, representing challenging real-world search scenarios.

Key Results

  • Accuracy: GBS achieved a 9.8% improvement in Mean Reciprocal Rank (MRR@20) over the previous state-of-the-art model, RIPOR, on the BBS 40K dataset.
  • Robustness: The model consistently outperformed dense retrieval baselines (like DPR) and other generative models (NCI, GenRet) on the WhatsThatBook dataset.
  • Length Extrapolation: While competing models saw performance degradation as input length increased, GBS remained stable, with performance peaking at a context window of 128,000 tokens.

Conclusion

GBS demonstrates that incorporating structural information—specifically the table of contents—is crucial for AI-driven book retrieval. By combining hierarchical encoding with LLM-based data synthesis, the framework sets a new benchmark for navigating massive digital libraries. Future work will focus on scaling these models to millions of books and optimizing the computational costs associated with high-fidelity data augmentation.

Summary updated

BibTeX
@inproceedings{tang2025generative,
  author = {Yubao Tang and Ruqing Zhang and Jiafeng Guo and Maarten de Rijke and Shihao Liu and Shuaiqing Wang and Dawei Yin and Xueqi Cheng},
  title = {{Generative Retrieval for Book search}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2025},
}
Figure