Generating Query-Relevant Document Summaries via Reinforcement Learning

Nitin Yadav, Changsung Kang, Hongwei Shang, Ming SunarXiv 2025 · DOI

Abstract

ReLSum is a reinforcement learning framework designed to train Large Language Models (LLMs) to generate concise, query-relevant product summaries for e-commerce search. By utilizing a frozen cross-encoder's relevance scores as a reward signal, the system produces summaries that significantly enhance search ranking accuracy (NDCG and Recall) while adhering to the strict latency constraints of real-world production environments.

Introduction

In e-commerce search, engineers face a persistent trade-off between relevance and latency. Modern search architectures typically employ a two-stage process: a high-speed retrieval stage followed by a sophisticated re-ranking stage. Re-rankers often utilize cross-encoders (such as BERT), which provide high accuracy by simultaneously attending to both the query and the document.

However, the computational cost of cross-encoders scales quadratically with input length. Consequently, many production systems are limited to processing only product titles. While titles are concise, they often lack the specific details (e.g., "non-GMO" or "contains taurine") necessary to satisfy complex user intents. Full product descriptions contain these details but are too long for real-time processing. ReLSum addresses this by generating query-relevant summaries that are short enough for low latency yet rich enough to improve ranking.

The trade-off between relevance and latency across different input types: Title, Title + Description, and Title + Summary.

The ReLSum Framework

The authors propose ReLSum, which frames the summarization task as a Reinforcement Learning (RL) problem. Unlike traditional summarization models that optimize for readability or ROUGE scores, ReLSum optimizes directly for downstream ranking performance.

Architecture and Reward Signal

The system utilizes a trainable LLM (Mistral-7B-Instruct-v0.3) to generate summaries and a frozen BERT-based cross-encoder as the "Reward Model." The reward is calculated based on how effectively the [Title + Summary] input allows the cross-encoder to match ground-truth relevance labels.

The ReLSum architecture, showing the interaction between the trainable LLM, the frozen BERT cross-encoder, and the relevance-based reward loop.

Optimization Algorithms

Two primary alignment techniques were evaluated:

  • Group Relative Policy Optimization (GRPO): An iterative approach that samples multiple summaries and optimizes based on their relative performance.
  • Direct Preference Optimization (DPO): A method that optimizes the model directly on pairs of "preferred" and "rejected" summaries.

To ensure the model provides incremental value, the LLM is prompted to identify attributes in the description that are missing from the title, preventing redundant information.

Experimental Evaluation

The study utilized internal Walmart e-commerce data, including a "Golden Dataset" of 4,781 queries and 133k query-product pairs with human-judged relevance scores. A specific focus was placed on the Golden-tail subset (2,450 queries), representing less frequent searches where product details are most critical for surfacing relevant results.

Results

Offline Performance

ReLSum, particularly the GRPO variant, outperformed all baselines. On the Golden-tail dataset, the model achieved a +0.51% gain in R@90P (Recall at 90% Precision) and a +1.03% gain in NDCG@5 compared to the title-only baseline. These results confirm that niche products benefit most from the additional context provided by query-relevant summaries.

Online Impact

In live production environments, the model demonstrated significant business impact:

  • Interleaving: Showed a 0.22% lift in Add-to-Cart (ATC@40) actions.
  • A/B Testing: A 14-day test revealed statistically significant improvements in key metrics, including Units sold (+0.34%), Orders (+0.26%), and Gross Merchandise Value (+0.29%).

Conclusion

ReLSum demonstrates that reinforcement learning can effectively align LLM summarization with the specific needs of search rankers. By decoupling the summarizer from the ranker's architecture, the framework provides a flexible solution for improving e-commerce relevance without sacrificing latency. Future work will explore incorporating multimodal data and co-training the ranker and summarizer in a unified loop.

Summary updated

BibTeX
@misc{yadav2025generating,
  author = {Nitin Yadav and Changsung Kang and Hongwei Shang and Ming Sun},
  title = {{Generating Query-Relevant Document Summaries via Reinforcement Learning}},
  year = {2025},
  eprint = {2508.08404},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.08404},
}
Figure