Accelerating Aggregation Queries on Unstructured Streams of Data

Matthew Russo, Tatsunori Hashimoto, Daniel Kang, Yi Sun, Matei Zaharia · DOI

TL;DR

This paper introduces InQuest, a novel system designed to efficiently answer aggregation queries over unstructured data streams (like video or text) in real-time. By cleverly using lightweight "proxy" models to guide sampling and applying expensive "oracle" models only to a carefully selected subset of data, InQuest significantly reduces computational cost while maintaining high accuracy, even for dynamic data streams.

What Problem Does This Paper Address?

In today's data-rich world, we're constantly generating vast amounts of unstructured data from sources like social media feeds, surveillance cameras, and audio recordings. Analysts and scientists want to extract meaningful insights from these streams in real-time – imagine an urban planner monitoring traffic congestion or a social scientist tracking public sentiment during a live event. While deep neural networks (DNNs) are powerful tools for analyzing such data, applying them exhaustively to entire streams is computationally prohibitive, especially in a streaming context where data arrives continuously and the entire dataset isn't available upfront. Existing batch-oriented DNN query systems can't easily adapt to this streaming paradigm. This paper tackles the challenge of performing efficient, accurate, and real-time aggregation queries on these complex, multi-modal data streams.

Methods

InQuest's core innovation lies in its intelligent use of stratified sampling combined with a proxy-oracle paradigm. Here's how it works:

  1. Proxy Models: InQuest uses inexpensive "proxy" DNNs that can process the entire stream quickly. These proxies provide a rough estimate or classification for each data point.
  2. Stratified Sampling: Instead of applying the expensive "oracle" DNN to every data point, InQuest uses the proxy scores to divide the stream into strata (groups). It then strategically samples data points from these strata. This is crucial because it allows InQuest to focus its expensive computations on the most informative parts of the data.
  3. Pilot Sampling & Dynamic Allocation: InQuest starts with a "pilot" phase to establish initial strata. It then dynamically adjusts its sampling strategy for each segment of the stream, learning from past oracle predictions to optimize where to allocate its sampling budget. This is key for handling streams where data characteristics can change over time.
  4. Defensive Sampling: To ensure robustness against extreme shifts or rare events, InQuest incorporates a "defensive" sampling component that guarantees a minimum number of samples are allocated to each stratum.
  5. Real-time Estimation: InQuest processes the stream in segments, updating its stratification and sample allocation at the end of each segment. This allows it to provide query estimates in real-time.

Datasets

The authors evaluated InQuest on six real-world video and text datasets. These include:

  • Video Datasets: archie, customer-support, grand-canal, night-street, rialto, taipei.
  • Text Dataset: A dataset of 3 million+ tweets from customer support interactions.

The paper does not introduce new benchmark datasets but uses existing ones commonly found in video analytics research.

Key Insights and Ideas

  • Proxy-guided sampling is key: The effectiveness of InQuest hinges on using cheap proxy models to intelligently guide the application of expensive oracle models. This is a generalizable strategy for accelerating DNN-based analytics.
  • Dynamic adaptation is crucial for streams: Real-world data streams are rarely static. InQuest's ability to dynamically update its stratification and sample allocation based on recent data history is vital for maintaining accuracy over time.
  • Stratified sampling offers significant gains: By dividing the data into strata based on proxy scores, InQuest can achieve much higher accuracy for a given sampling budget compared to uniform random sampling.
  • Theoretical guarantees matter: The paper provides theoretical analysis showing that InQuest's sample allocation converges to the optimal strategy and its expected error decreases with the oracle budget, providing confidence in its approach.

Key Results

  • Significant Speedup: InQuest achieves the same Root Mean Squared Error (RMSE) as two streaming baselines (uniform and stratified sampling) using up to 5.0x fewer oracle invocations.
  • Competitive with Batch: Compared to a state-of-the-art batch algorithm (ABae), InQuest achieves up to 1.9x lower RMSE at a fixed number of oracle invocations.
  • Robustness: InQuest demonstrates resilience to adversarial shifts in stream parameters, outperforming streaming baselines by an average of 1.13x-1.42x on synthetic datasets with parameter shifts.
  • Cost Savings: InQuest offers substantial speedups and cost savings (up to 5.8x over streaming baselines and 1.6x over ABae) at fixed accuracy levels.
  • Component Importance: A lesion study confirmed that both dynamic strata inference and dynamic sample allocation are critical for InQuest's high performance.

Limitations and Future Work

  • Stationary Stream Assumption: The theoretical analysis relies on assumptions of stationary data distributions, though empirical results show InQuest performs well even with non-stationary streams.
  • Proxy Quality: While InQuest works with any proxy, its performance is significantly influenced by proxy quality. The paper shows that better proxies lead to orders-of-magnitude improvements, but current proxies are still far from perfect.
  • Parameter Tuning: While InQuest performs well with default parameters, advanced users might need to tune parameters like the number of strata (K) and the smoothing parameter (a) for optimal performance on their specific datasets.

Future work could explore more sophisticated proxy learning techniques, investigate how to automatically determine optimal proxy models, and extend InQuest to handle more complex query types beyond aggregations.

Summary updated

BibTeX
@article{russo2023accelerating,
  author = {Matthew Russo and Tatsunori Hashimoto and Daniel Kang and Yi Sun and Matei Zaharia},
  title = {{Accelerating Aggregation Queries on Unstructured Streams of Data}},
  journal = {Proc. VLDB Endow.},
  year = {2023},
  doi = {10.14778/3611479.3611496},
}
Figure