arXiv:2608.23087cs.DBAug 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2608.23087

Closed-Form Predicate-Level Shapley Attribution for Sliding-Window Aggregates

Pouya Khani, Ira Assent

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Streaming engines report sliding-window aggregates in real time, but they do not explain why an aggregate takes its current value. A natural target is the Shapley value from cooperative game theory, which axiomatically distributes an aggregate among the tuples in the window. Practitioners, however, ask predicate-level questions (e.g., how much a region or customer tier contributed to an average or variance spike). Exact Shapley computation is exponential in the window size, and existing estimators discard the massive overlap between consecutive windows.

We show that for SUM, COUNT, AVG, and population/sample variance, exact predicate-level Shapley values admit closed forms in three additively maintained summaries per predicate (count, sum, and sum of squares), with coefficients that depend only on two running harmonic numbers. Attribution therefore reduces to O(1)O(1) summary updates per slide for registered predicates, with no coalition enumeration. Overlapping and compositional predicates are answered exactly via atomic refinement of Boolean signatures. We further characterize the phenomenon: every moment-polynomial aggregate admits such a form, while MAX, MIN, and quantiles provably do not at any fixed moment order.

Experiments match brute-force Shapley values to floating-point precision on over 10,000 windows, sustain ≈2μs\approx 2 \mu s per slide up to N=106N = 10^6 ( 3,200×3,200 \times faster than per-window recomputation of the same formulas), and explain a nighttime fare spike on 2.9M NYC taxi trips at ≈1.8M\approx 1.8M summary updates per second.

Keywords Explainable AI, Data Streaming, Shapley Values, Predicate Attribution, Sliding Windows

1 Introduction

High-velocity data streams, from algorithmic trading and IoT monitoring to real-time cybersecurity, have made Data Stream Management Systems (DSMS) a standard tool. Modern engines such as Apache Flink and Spark Streaming compute continuous aggregate queries over sliding windows efficiently. These systems can instantly report what is happening (e.g., “the average server latency has spiked by 200 ms”), but they cannot explain why it is happening in real time.

Standard root-cause analysis uses ad-hoc manual queries or post-hoc analysis on data warehouses. These approaches introduce unacceptable latency. To automate this, we turn to the Shapley Value (SV), a concept from cooperative game theory. Unlike heuristic feature importance methods, the Shapley Value distributes the “payout” (the aggregate result) among the “players” (the input tuples) axiomatically. It satisfies properties such as Efficiency, Symmetry, Additivity, and the Dummy axiom.

Example 1 (Running Example: Cloud Latency Monitoring). Consider an operations team monitoring request latency for a cloud service. A streaming engine continuously reports AVG and VAR over the most recent requests. When the average latency spikes, the team asks whether the increase is mainly due to requests from region='EU-West', premium customers, a particular service endpoint, or an intersection such as region='EU-West' AND tier='premium'. The

A PREPRINT

relevant explanation must be produced while the window is still active. It should also distinguish a predicate that increases the average from one that merely contributes many near-average tuples. We use this latency-monitoring scenario throughout the paper. Small numerical examples use normalized latency values such as W={2,4,10}W = \{2, 4, 10\} to keep the arithmetic readable.

References (33)