Abstract
In the field of Information Retrieval (IR), Learning-to-Rank (LtR) models are essential for ordering documents, products, or candidates. However, these models often operate as "black boxes," making their decision-making processes difficult to interpret. Traditional explanation methods, such as standard SHAP (SHapley Additive exPlanations), provide pointwise explanations that focus on individual document scores. This approach fails to capture the contrastive nature of ranking, where an item's position depends on its relationship to others in the list. We present RankingSHAP, a framework that extends SHAP to provide listwise explanations. By masking features across entire query sets and utilizing listwise objective functions, RankingSHAP identifies the features most influential to the relative ordering of a list. Our evaluations on benchmark datasets and synthetic scenarios demonstrate that RankingSHAP offers superior faithfulness and can detect biases that pointwise methods overlook.
Introduction
Ranking is fundamentally a comparative task. A document appears at the top of a search result not merely because it achieves a high absolute score, but because it outperforms its competitors according to the model's internal logic. Despite this, most eXplainable AI (XAI) tools treat documents in isolation. Pointwise methods can miss critical nuances; for instance, a feature used primarily as a tie-breaker between two high-quality candidates might be ignored by a pointwise explanation, even though it is the sole reason for their final relative order.
RankingSHAP addresses this gap by treating the ranking process as a collective outcome. It attributes importance to features based on how they impact the structure of the entire ranked list, providing a more accurate reflection of how LtR models prioritize information.
Methodology
RankingSHAP functions as a wrapper around the standard SHAP algorithm, introducing two primary innovations to adapt it for listwise tasks:
1. Listwise Masking
In standard SHAP, features are "masked" or hidden for a single instance to see how the score changes. RankingSHAP instead masks the same feature across all documents within a query set simultaneously. This allows the framework to observe how the removal of a specific attribute shifts the relative dynamics and eventual ordering of the entire group.
2. Listwise Explanation Objectives
SHAP requires a single numerical output (a scalar) to calculate feature importance. To bridge the gap between a complex ranked list and this requirement, RankingSHAP employs various objective functions to map list changes to a scalar value:
- Kendall’s Tau: Measures the global stability of the list's order.
- Weighted Rank Difference: Focuses on changes occurring at the "top-k" positions, where accuracy is most critical.
- Reciprocal Rank: Analyzes the position of a specific document relative to its peers.
By selecting different objectives, practitioners can tailor explanations to specific questions, such as why the top three results were chosen or why a specific item dropped in rank.
Experimental Setup
The authors evaluated RankingSHAP across three distinct environments:
- MQ2008 (LETOR 4.0): A standard IR benchmark consisting of 800 queries and 46 features.
- MSLR-10k: A large-scale dataset with 10,000 queries and 136 features, used to evaluate scalability and consistency.
- Synthetic "Talent Search" Dataset: A controlled "white box" scenario featuring a model with known intentional biases (e.g., favoring specific universities). This setup served to verify if RankingSHAP could accurately identify the model's underlying logic.
Key Insights
The Importance of Context
A feature may be vital for a document's absolute score but irrelevant to its rank if all other documents in the set possess the same feature value. RankingSHAP identifies this redundancy, whereas pointwise methods often over-report the importance of such features.
Detecting Hidden Bias
In the talent search case study, RankingSHAP successfully identified negative biases against specific universities that influenced the final ranking. Pointwise SHAP failed this test, providing similar attribution values for all candidates and failing to highlight the systemic unfairness affecting lower-ranked individuals.
Results
To measure "faithfulness"—how accurately the explanation reflects the model's true behavior—the authors utilized Preservation and Deletion checks.
- Faithfulness Metrics: In Deletion Checks (removing the most important features identified by the explainer), RankingSHAP caused the model's output to change significantly more than baselines. It produced an exposure difference 3 to 5 times greater than random or pointwise methods.
- Superiority over Pointwise Methods: RankingSHAP consistently outperformed PointwiseSHAP and RankLIME in reconstructing the original ranked list. On the MQ2008 dataset, using only the top 10 features identified by RankingSHAP achieved a 0.7 rank similarity to the original model's full-feature output.
Limitations and Future Work
While effective, RankingSHAP faces challenges regarding computational complexity. As a wrapper around SHAP, its cost grows exponentially with the number of features, making the explanation of lists with hundreds of features time-consuming. Additionally, the current model assumes feature independence; future iterations could integrate SHAP variants designed to handle highly correlated features common in IR (e.g., document length and term frequency).
Finally, while the mathematical faithfulness of the model is proven, further research is required to determine the utility of these listwise explanations for end-users and practitioners in real-world decision-making environments.
Summary updated