Abstract
Traditional data stream sketches, such as the Count-Min sketch, are designed to track event frequencies while remaining agnostic to the order in which those events occur. However, in many domains—from cybersecurity to financial trading—the sequence of events is the primary signal. This paper introduces "ordered moments," a novel feature set for massive data streams that captures sequential patterns. By integrating algebraic techniques from rough path theory with randomized sketching algorithms, the authors provide a method to summarize complex temporal patterns in logarithmic space with strong theoretical guarantees on universality.
Introduction
In the analysis of massive data streams, such as network logs or stock trades, traditional sketching algorithms excel at answering frequency-based queries (e.g., "How many times did IP address X appear?"). Yet, these methods often fail to distinguish between sequences like $A \to B$ and $B \to A$. Capturing every possible ordered pattern typically leads to a combinatorial explosion, making it impossible to store all pairs or triplets for large alphabets. This research addresses the challenge of efficiently sketching these ordered patterns to preserve the temporal signal within the stream.
Methodology: Bridging Streaming and Rough Path Theory
The core innovation lies in the linearization of order through the lens of rough path theory. The approach consists of four primary components:
- Ordered Moments as Paths: A stream is represented as a path in a high-dimensional space. The "features" of this stream are defined as iterated integrals, or "ordered moments." For instance, while a first-order moment counts occurrences, a second-order moment $\Phi_{ab}$ tracks how often event $a$ preceded event $b$.
- Non-Commutative Algebra: By using formal power series in non-commuting variables, the authors "stitch" events together in a way that respects their sequence. This algebraic structure ensures that the order of operations is preserved.
- Sketching with 2-Universal Hashing: To manage massive alphabets (e.g., IPv6 addresses), the algorithm employs 2-universal hash families to map the large alphabet to a smaller, manageable space. By running multiple independent hashes and taking coordinate-wise minima—analogous to a Count-Min sketch for tensors—the system estimates "heavy hitter" patterns efficiently.
- Universality: The authors prove that these ordered moments are "universal," meaning any continuous function of a stream can be approximated by a linear combination of these features.
Experimental Evaluation
The proposed method was evaluated using synthetic datasets designed to test order-sensitivity and scalability:
- Deterministic Streams: A stream with $10^6$ events and an alphabet size of 100 was used to validate the sketch against a ground-truth calculation.
- Markov Chain Classification: The authors tested the algorithm on random streams with a massive alphabet ($10^5$) where event frequencies were nearly identical, but transition orders differed.
Key Results
- Order Sensitivity: In the Markov chain experiment, order-agnostic features ($M=1$) achieved only 57% accuracy. In contrast, using second-order moments ($M=2$) resulted in 100% accuracy, demonstrating the power of capturing sequential transitions.
- Efficiency and Scalability: The sketching algorithm demonstrated logarithmic complexity relative to alphabet size, making it viable for internet-scale data. The implementation in C++ showed high throughput and minimal memory overhead.
- Theoretical Guarantees: The authors established explicit $(\epsilon, \delta)$ probabilistic bounds on estimation errors, providing a robust mathematical foundation similar to classic sketching techniques.
Discussion and Future Work
The most significant insight is the "linearization of order." By mapping streams into the signature space of a path, complex temporal patterns become linear features, allowing simple classifiers like Logistic Regression to detect sophisticated behaviors.
However, limitations remain. The truncation level $M$ (the maximum pattern length) is a critical hyperparameter; memory costs grow as $O(\epsilon^{-M})$, making very long sequences expensive to track. While the current work focuses on "cash register" streams (increments only), future adaptations for "turnstile" streams (increments and decrements) are possible. Future research should also focus on applying these "universal" features to real-world datasets, such as global BGP routing updates or social media firehoses, to further validate their practical utility.
Summary updated