NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Improving Search Engine Efficiency through Contextual Factor Selection

Anxiang Zeng, Han Yu, Qing Da, Yusen Zhan, Yang Yu, Jingren Zhou, Chunyan Miao

Abstract

Modern e-commerce search engines rely on complex "Learning to Rank" (LTR) models that incorporate thousands of features to ensure high-quality results. However, the computational overhead of processing these features often leads to significant latency. This paper introduces Contextual Factor Selection (CFS), a deep reinforcement learning approach that dynamically selects the most relevant ranking features for each individual query. By framing feature selection as a sequential decision-making task, CFS optimizes the trade-off between ranking effectiveness and system efficiency. Real-world deployment on the Taobao platform demonstrates a 40% reduction in search latency during normal operations and a 20% reduction during the Single’s Day peak, while maintaining ranking accuracy.

Introduction

In large-scale search systems, providing accurate results in milliseconds is a critical challenge. Modern LTR models use a vast array of "factors"—such as user demographics, historical behavior, and item attributes—to rank billions of products. While increasing the number of factors generally improves effectiveness, it simultaneously increases the computational cost, leading to higher latency.

The Taobao search interface, where CFS was deployed to optimize real-time ranking efficiency.

Traditional approaches to this problem involve static feature selection or manual service degradation during high-traffic periods. These methods are suboptimal because they fail to account for the fact that not all queries require the same set of features. For instance, a common query might be satisfied by a few high-impact features, whereas a rare "long-tail" query might require more granular data to provide a relevant result.

Methodology: Contextual Factor Selection (CFS)

The proposed CFS framework utilizes an Actor-Critic reinforcement learning architecture to perform dynamic, query-specific feature selection.

Reinforcement Learning Framework

The system treats feature selection as a sequence of binary decisions. For a given query and user context, an "Actor" network decides whether to Keep or Skip each factor in a predefined sequence. A "Critic" network evaluates these decisions to guide the learning process based on the resulting ranking quality.

Objective Function and Reward Shaping

The model is trained to minimize a dual-objective loss function:

  1. Effectiveness Loss: Measured as the KL divergence between the ranking produced by the selected subset and the "optimal" ranking produced by the full set of factors.
  2. Efficiency Penalty: A cumulative cost function based on the computational resources required by the selected factors.

To address the challenge of sparse feedback in sequential decision-making, the authors employ reward shaping techniques, providing the agent with intermediate signals to discourage the inclusion of redundant features.

Experimental Evaluation

The CFS model, referred to as RankCFS, was evaluated using both offline datasets and online production traffic.

  • Offline Dataset: 100,000 samples from Taobao, split equally between training and testing. Each sample represents a user-query pair and associated item factors.
  • Online Deployment: The model was trained on a distributed streaming system using over one billion ($10^9$) real-world training samples from Taobao traffic.

Results

Offline results showed that RankCFS achieved an Averaged Pairwise Loss of 0.21, significantly outperforming L1-based and Tree-based selection methods (which scored 0.30 or higher). This indicates that RankCFS more accurately mimics the "full" model's performance with fewer features.

In online A/B testing on Taobao.com:

  • Normal Operations: CFS reduced average search latency by over 40% compared to the previous production approach.
  • Peak Traffic: During the 2017 Single’s Day Shopping Festival, the system reduced latency by 20%, providing a critical buffer against system degradation during extreme load.

Conclusion

Contextual Factor Selection represents a significant advancement in balancing search engine effectiveness and efficiency. By leveraging reinforcement learning to make real-time, context-aware decisions, the system achieves substantial latency reductions without compromising result quality. Future work will focus on incorporating fairness constraints, enhancing user privacy, and exploring dynamic factor sequencing to further optimize performance.

Summary updated

BibTeX
@article{zeng2021improving,
  author = {Anxiang Zeng and Han Yu and Qing Da and Yusen Zhan and Yang Yu and Jingren Zhou and Chunyan Miao},
  title = {{Improving Search Engine Efficiency through Contextual Factor Selection}},
  journal = {AI Mag.},
  year = {2021},
  doi = {10.1609/aimag.v42i2.15099},
}
Figure