Abstract
In large-scale data analysis, summarizing massive datasets with multiple numeric weights per item is a common yet challenging task. Traditional independent sampling methods often fail to capture relationships between different weight assignments, leading to high variance in multi-attribute queries. This paper presents a coordinated weighted sampling framework that utilizes shared random seeds to maximize sample overlap. By leveraging Rank Conditioning (RC) techniques, the authors derive unbiased estimators for complex aggregates such as $L_1$ differences and Jaccard similarities. Empirical evaluations on real-world network traffic, movie ratings, and stock data demonstrate that coordinated sampling can reduce variance by several orders of magnitude compared to independent approaches.
Introduction
Modern data environments, such as high-speed IP networks and large-scale web services, generate volumes of data that exceed storage capacities. To enable retrospective analysis, these systems rely on "sketches" or sample-based summaries. While weighted sampling is well-understood for single-attribute queries (e.g., total bytes per IP), real-world monitoring often requires analyzing multiple attributes simultaneously or comparing data across different time intervals.
The Challenge of Multiple Weight Assignments
Standard approaches often sample different attributes or time periods independently. However, for queries involving multiple weight assignments—such as calculating the $L_1$ difference between traffic on two consecutive days—independent samples may have minimal overlap. This lack of intersection significantly increases the error and variance of the resulting estimates. For instance, if an item is sampled on Monday but not on Tuesday, its contribution to the difference between the two days is difficult to estimate accurately.
Methods: Coordinated Weighted Sampling
To address this, the authors propose Coordinated Weighted Sampling (CWS). The core idea is to use a shared random seed for each item, typically generated via a hash function of the item's key. This ensures that "heavy" items are consistently selected across different sampling instances, maximizing the overlap between summaries.
The framework distinguishes between two data models:
- Dispersed Weights: Weights are observed at different times or locations, where the sampling process for one period cannot access data from another.
- Co-located Weights: All weights for an item are available simultaneously in a single record.
As shown in the figure above, using a consistent shared seed ($u$) leads to ranks ($r^{(j)}$) that favor the same keys across different weight assignments ($w^{(j)}$), whereas independent seeds ($u^{(j)}$) lead to disjoint samples.
Estimators and Rank Conditioning
The authors develop a "template estimator" based on Horvitz-Thompson and Rank Conditioning (RC) techniques. From this, they derive specific unbiased estimators:
- Inclusive Estimators: Designed for co-located data, these estimators use any item sampled for any attribute to improve the estimate of a specific attribute, effectively "recycling" data.
- s-set and l-set Estimators: Designed for dispersed data, these handle aggregates like minimums, maximums, and $L_1$ distances across time periods. The l-set estimator is a more sophisticated version that provides tighter bounds by considering a larger set of ranked items.
The sampling mechanism often relies on calculating a rank $r(i)$ for each item $i$ based on its weight $w(i)$ and a uniform random variable $u(i)$, as illustrated in the table above.
Evaluation and Results
The framework was tested on diverse datasets, including IP network traces, Netflix movie ratings, and stock market data.
- Massive Variance Reduction: Coordinated sampling achieved massive variance reduction. On the Netflix dataset, comparing aggregates across 12 months, the variance was 10 to 40 orders of magnitude lower than independent sampling.
- Estimator Performance: The l-set estimator consistently outperformed the s-set estimator, showing up to a 300% improvement in variance on the Stocks dataset.
- Storage Efficiency: By maximizing overlap, CWS reduces the total number of unique keys that need to be stored, leading to more compact summaries.
Conclusion
Coordinated Weighted Sampling provides a robust solution for multi-attribute data summarization. By ensuring sample consistency through shared seeds and employing advanced RC-based estimators, it enables highly accurate analysis of complex relationships within massive datasets. Future work includes extending this framework to unaggregated data streams and real-time network anomaly detection.
Summary updated