The Importance of Parameters in Ranking Functions
Christoph Standke, Nikolaos Tziavelis, Wolfgang Gatterbauer, Benny Kimelfeld
TL;DR
This work analyzes how much individual ranking-parameter choices (per-column weights) influence ranking outcomes through SHAP scores, adopting Grohe et al."s framework and focusing on fully factorized weight distributions. It systematically characterizes the computational complexity of computing SHAP scores, Shapley values, and related expectations across basic ranking functions (Sum, Min, Max, Lex) and effect notions (global, top-$k$, local). The study provides polynomial-time algorithms for key pairwise and fixed-$k$ cases, proves FP$^{\#P}$-hardness for many other combinations, and shows that exact computations are tractable only in restricted settings (e.g., fixed matrix dimensions or unary-encoded inputs). Additionally, it demonstrates how results extend from parameter SHAP to the Shapley value of whole columns, offering a foundational map of when function-based explanations for rankings are computationally feasible. The findings inform practical attribution efforts and guide future work on broader classes of ranking functions and distributions with potential real-world impact.
Abstract
How important is the weight of a given column in determining the ranking of tuples in a table? To address such an explanation question about a ranking function, we investigate the computation of SHAP scores for column weights, adopting a recent framework by Grohe et al.[ICDT'24]. The exact definition of this score depends on three key components: (1) the ranking function in use, (2) an effect function that quantifies the impact of using alternative weights on the ranking, and (3) an underlying weight distribution. We analyze the computational complexity of different instantiations of this framework for a range of fundamental ranking and effect functions, focusing on probabilistically independent finite distributions for individual columns. For the ranking functions, we examine lexicographic orders and score-based orders defined by the summation, minimum, and maximum functions. For the effect functions, we consider global, top-k, and local perspectives: global measures quantify the divergence between the perturbed and original rankings, top-k measures inspect the change in the set of top-k answers, and local measures capture the impact on an individual tuple of interest. Although all cases admit an additive fully polynomial-time randomized approximation scheme (FPRAS), we establish the complexity of exact computation, identifying which cases are solvable in polynomial time and which are #P-hard. We further show that all complexity results, lower bounds and upper bounds, extend to a related task of computing the Shapley value of whole columns (regardless of their weight).
