Abstract
Traditional learning-to-rank (LTR) systems often score documents independently, neglecting the contextual relationships between items in a list. This paper presents attn-DIN (Self-Attentive Document Interaction Networks), a novel architecture that leverages self-attention to capture cross-document interactions. By design, attn-DIN ensures permutation equivariance, meaning the final ranking is invariant to the initial document order. Experimental results on large-scale datasets like MSLR Web30k, Gmail Search, and Google Drive show that attn-DIN outperforms existing multivariate models in both accuracy and computational efficiency.
Introduction: The Contextual Ranking Problem
In standard Information Retrieval (IR), "Learning-to-Rank" (LTR) models typically employ a "score-and-sort" paradigm. These univariate models process a query and a single document to produce a score, repeating the process for each candidate. However, this approach ignores cross-document interactions. In practice, the relevance of a document is often relative; for instance, a result might be redundant if a similar, higher-quality result is already present.
While Groupwise Scoring Functions (GSFs) attempt to model these interactions by scoring small subsets of documents together, they face significant challenges:
- Computational Complexity: Scoring all combinations leads to a combinatorial explosion.
- Training-Serving Discrepancy: Models trained on small groups may struggle when ranking hundreds of documents during inference.
- Permutation Sensitivity: Many models are biased by the initial input order of documents.
Methodology: attn-DIN Architecture
The authors propose attn-DIN based on two fundamental principles: permutation equivariance and self-attention.
Permutation Equivariance
A ranking function is permutation equivariant if swapping the positions of two documents in the input list results in a corresponding swap of their scores, without changing the score values themselves based on their initial indices. This property is crucial for unbiased ranking.
Self-Attention as a Set Operator
To model interactions efficiently, attn-DIN utilizes the Transformer’s self-attention mechanism. By omitting positional encodings, self-attention treats the input as a set rather than a sequence, making it naturally permutation equivariant. This allows each document to "attend" to every other document in the candidate set, generating context-aware "interaction embeddings."
The architecture consists of:
- Deep Component: A stack of self-attention layers producing interaction embeddings ($e_i$).
- Wide Component: Raw query ($q$) and document ($d_i$) features.
- Scoring Layer: A standard feed-forward network (FC-BN-ReLU) that concatenates wide and deep features to produce a final scalar score ($s_i$).
Experimental Setup and Datasets
The model was evaluated across three diverse environments:
- MSLR Web30k: A public benchmark with 30,000 queries and dense features.
- Quick Access (Google Drive): A large-scale private dataset for zero-state file recommendations.
- Gmail Search: A massive dataset (200M queries) featuring both dense and sparse (n-gram) features, presenting a significant scaling challenge.
Key Results and Discussion
The attn-DIN model demonstrates superior performance across accuracy, speed, and efficiency metrics.
Accuracy and Real-World Impact
On the Web30k benchmark, attn-DIN achieved an NDCG@5 of 46.62, surpassing the best-reported GSF (45.59). In production environments like Gmail Search and Google Drive, the model yielded statistically significant improvements in Mean Reciprocal Rank (MRR).
Computational Efficiency
A major advantage of attn-DIN is its efficiency. Previous multivariate approaches like RankProb required ~2,240ms per query for exact bivariate inference. In contrast, attn-DIN achieved inference in just 13ms, representing a ~170x speedup.
As shown in the figure above, attn-DIN maintains a constant, low parameter count and inference time compared to GSFs, which scale poorly as group size increases. This efficiency stems from the attention mechanism's ability to capture high-order interactions without the combinatorial overhead of groupwise sampling.
Conclusion and Future Directions
attn-DIN effectively bridges the gap between univariate efficiency and multivariate accuracy. By utilizing self-attention as a set operator, it captures vital document interactions while maintaining permutation equivariance.
While the model outperforms other neural baselines, it still trails behind Gradient Boosted Decision Trees (GBDTs) like LightGBM on purely dense, tabular data. However, attn-DIN's ability to handle sparse features at scale makes it ideal for modern, large-scale search applications. Future research may explore hybrid models that combine the interaction modeling of self-attention with the robust performance of boosted trees.
Summary updated