Abstract
Maintaining accurate counts of distinct elements in dynamic data streams while preserving differential privacy (DP) is a critical challenge for privacy-preserving analytics. This paper addresses the problem in the turnstile model, where elements can be both added and removed. We introduce an efficient algorithm based on the Sparse Vector Technique (SVT) that achieves tight error bounds parameterized by the total flippancy of the stream. Furthermore, we establish a theoretical link between event-level and item-level privacy for a broad class of algorithms, providing new insights into the fundamental limits of private streaming.
Introduction
Counting distinct elements is a fundamental task in network monitoring, database management, and machine learning. In many real-world applications, the underlying data is sensitive, necessitating the use of Differential Privacy (DP) to protect individual privacy. While counting distinct elements in insertion-only streams is well-studied, the problem becomes significantly more complex in the "turnstile model," where items can be deleted (e.g., a user un-liking a post or removing a file).
In this work, we provide a significant upgrade to private distinct counting in turnstile streams. We move away from complex tree-based mechanisms and instead leverage the Sparse Vector Technique (SVT) to achieve optimal error bounds. Additionally, we explore the theoretical relationship between event-level privacy (protecting a single update) and item-level privacy (protecting a user's entire history).
The Turnstile Model and Flippancy
In the turnstile model, each element in the universe has an associated count that increases with insertions and decreases with deletions. An element is considered "active" if its net count is greater than zero. The goal is to report the number of active elements at each time step.
A key challenge in this model is "flippancy"—the frequency with which an element's status changes between active and inactive. Previous research focused on the maximum flippancy of any single element. We argue that a more holistic metric is the total flippancy ($K$), which is the sum of all status changes across all elements in the stream. This metric better captures the overall volatility of the data.
Algorithmic Approach: Sparse Vector Technique
Our primary algorithmic contribution is a simple and efficient mechanism based on the Sparse Vector Technique (SVT). The core strategy is "lazy reporting," which minimizes the amount of noise injected into the stream.
The algorithm operates in four main stages:
- Estimate: It begins by generating an initial noisy estimate of the number of distinct elements.
- Wait: It continues to report this fixed estimate as long as the true count does not deviate significantly.
- Detect: Using SVT, the algorithm privately monitors the stream to detect when the true count crosses a predefined threshold of change.
- Update: Once a significant change is detected, the algorithm draws a new noisy estimate and resets the monitoring process.
By carefully balancing the detection threshold with the noise added during updates, we achieve additive error bounds that are optimal for both $\epsilon$-DP and $(\epsilon, \delta)$-DP.
Theoretical Results and the Privacy Bridge
Beyond the algorithm itself, we introduce the concept of $\gamma$-output-determined algorithms. These are algorithms whose output distribution depends solely on the sequence of true distinct counts, rather than the specific sequence of insertions and deletions that led to those counts.
We use this framework to prove a "privacy bridge": for output-determined algorithms, achieving event-level privacy in a general turnstile model is as difficult as achieving item-level privacy in a restricted "likes-only" (insertion-only) model. This result suggests that for many practical algorithms, we should not expect significant accuracy gains when moving from item-level to event-level protection in the general turnstile model.
Key Results
Our work establishes new state-of-the-art bounds for private distinct counting. For $\epsilon$-DP, we achieve an additive error of $O(\sqrt{K})$, and for $(\epsilon, \delta)$-DP, we achieve $O(K^{1/3})$. These bounds are proven to be tight, meaning no algorithm can achieve better performance under these privacy constraints.
As shown in the table above, our results provide a comprehensive set of upper and lower bounds across various privacy levels and stream models. Notably, our algorithm is more space-efficient than prior methods, requiring $O(d)$ space (where $d$ is the universe size), and it significantly outperforms previous work when flippancy is distributed across many items.
Conclusion
This research simplifies the complex problem of private distinct counting in turnstile streams. By identifying total flippancy as the correct metric and adapting the Sparse Vector Technique, we provide a practical, high-performance solution with optimal theoretical guarantees. Our work also clarifies the relationship between different privacy levels, paving the way for more robust and efficient private streaming analytics. Future work may explore whether "non-output-determined" algorithms—those that utilize the raw counts of individual items—can bypass the lower bounds established here for event-level privacy.
Summary updated