When the Stream Watches Back
Classical streaming analysis often imagines that the stream is fixed before the algorithm’s random coins are drawn. Real systems can violate that picture. A dashboard reveals an estimate, an operator changes the next query, a bot probes which keys collide, or an attacker chooses the next update after observing earlier outputs. The stream now “watches back”: future inputs depend on the algorithm’s transcript.
Privacy asks a different question. If one person’s event—or one person’s entire history—were removed, would the distribution of released outputs change noticeably? Accuracy alone does not prevent leakage, and privacy alone does not ensure that adversarial inputs cannot corrupt an estimate. Robustness and privacy can reinforce each other through stability, but they remain distinct contracts.
Consider a counter with true prefixes $1,2,3,4$. Publishing exact values reveals exactly when an event occurred. Publishing each prefix with fresh noise may protect one release, yet four releases compose and consume more privacy budget. A binary-tree mechanism stores noisy interval sums and answers each prefix from only $O(\log T)$ nodes, improving continual-release accounting compared with independently treating every prefix as a new full query.
Similarly, a hash sketch may be accurate for every fixed key with high probability. An adaptive analyst who repeatedly sees answers can learn collisions and select a later key that fails. A theorem for an oblivious stream cannot simply be reused under that interaction.
Robustness protects correctness when future inputs depend on past outputs; differential privacy limits how much outputs reveal about neighboring streams. Neither guarantee automatically implies the other, and both depend on an explicit transcript, adjacency relation, and adversary model.
| Concept | Intuitive meaning | Exact example | Non-example or boundary | Required assumption | Question answered |
|---|---|---|---|---|---|
| Oblivious stream | Inputs are fixed independently of algorithm coins/outputs | Logged file chosen before sketch seed | Operator changes traffic after viewing dashboard | Independence is part of the model | Is a fixed-input probability bound enough? |
| Adaptive stream | Next update may depend on prior transcript | Probe a hash sketch, then choose a colliding key | Merely processing an unpredictable but output-independent file | Adversary’s observations and power are stated | Can feedback target the randomness? |
| Robust estimator | Maintains accuracy under a declared corruption/adaptivity model | Median of sufficiently many independent estimators | “Works on noisy data” with no contamination bound | Fraction/type of corruption is bounded | Which adversarial behavior is tolerated? |
| Differential privacy | Neighboring datasets induce similar output laws | Event-level $(\varepsilon,\delta)$-DP counter | Encryption without a statistical release guarantee | Adjacency and transcript are fixed | How much can one contribution change disclosure? |
| Continual observation | Publish a sequence of evolving answers | Private prefix count after every time step | One final private count | Horizon/release schedule is defined | How does repeated publication compose? |
| Pan-privacy | Privacy holds even if internal state is inspected | Private state plus output under one intrusion | Output-only DP with raw state exposed | Intrusion timing/count follows theorem | What if memory is compromised? |
| Adversarial hashing | Inputs exploit knowledge or leakage of hash behavior | Chosen keys collide in exposed buckets | Random fixed key independent of seed | Hash secrecy/independence is not assumed | Can chosen inputs defeat concentration? |
When the Stream Watches Back
A service publishes a running count after updates $(1,1,1,1)$.
- Exact prefixes are $1,2,3,4$; their differences reveal every update.
- Suppose four releases each use a mechanism with privacy cost $\varepsilon_0=0.2$. Basic sequential composition gives total cost at most $0.8$.
- If an analyst chooses the fourth query only after observing the first three answers, composition still matters; adaptivity does not reset the budget.
- If one noisy value is cached and reused for the same query, repeated display is post-processing rather than four new mechanisms.
Reflection: which changes protect privacy, which protect accuracy against adaptive choices, and why are those not the same claim?
Adaptivity, Privacy and Continual Observation
An interactive stream is a transcript. At time $t$, an adversary chooses update $u_t$ as a function of its private information and previous releases $y_{1:t-1}$. The mechanism updates state $S_t$ using internal randomness and emits $y_t$. A robust guarantee quantifies over all adversaries in a specified class and bounds error over the mechanism’s coins, usually for all times or all requested times.
Differential privacy begins with adjacency. Event-level adjacency changes one update; user-level adjacency changes all updates belonging to one person. A randomized mechanism $\mathcal M$ is $(\varepsilon,\delta)$-DP if for every adjacent $D,D'$ and measurable event $O$,
$$ \Pr[\mathcal M(D)\in O]\le e^\varepsilon\Pr[\mathcal M(D')\in O]+\delta. $$
The output is the complete observable transcript, not each release viewed in isolation. Post-processing preserves privacy, while multiple mechanisms compose. Group privacy, user-level contribution bounds, and adaptive composition must be accounted for rather than inferred from one-query sensitivity.
Global sensitivity is the largest change in a query over adjacent data. For a bounded event-level counter, sensitivity is $1$. Adding Laplace noise with scale $\Delta_1/\varepsilon$ gives pure DP for one numeric release. Continual observation is harder because one event affects many prefixes. A binary-tree mechanism assigns an update to $O(\log T)$ noisy interval nodes, and any prefix uses at most $O(\log T)$ nodes.
Pan-privacy expands the observable view to internal states plus outputs. It is stronger than output privacy and requires the stored state itself to be protected. Robustness against adaptive streams may use fresh randomness, independent copies, robust aggregation, bounded transcript leakage, or cryptographic/adversarially resistant hashing; each technique has its own domain.
flowchart TD
A[Declare update and query transcript] --> B[Choose adversary model]
A --> C[Choose adjacency event or user]
B --> D[Robustness quantifiers over adaptive choices]
C --> E[Sensitivity of each protected object]
E --> F[Noise or private mechanism]
F --> G[Composition across releases]
G --> H[Continual observation guarantee]
C --> I[Include internal state if pan-private]
I --> J[State plus output privacy]
D --> K[Fresh randomness or robust aggregation]
H --> L[Joint accuracy privacy theorem]
J --> L
K --> L
A --> X[Failure if transcript leaks an unmodeled channel]
classDef navy fill:#17365D,color:#fff,stroke:#17365D;
classDef teal fill:#147D84,color:#fff,stroke:#0D565B;
classDef crimson fill:#C6284D,color:#fff,stroke:#861B35;
classDef purple fill:#6C3BAA,color:#fff,stroke:#472675;
class A,B,C navy;
class D,E,F,G,I,K purple;
class H,J,L teal;
class X crimson;
| Definition or claim | Exact scope | Required assumptions | What it does not imply | Counterexample or consequence |
|---|---|---|---|---|
| Oblivious accuracy | For every fixed stream, failure over coins is at most $\beta$ | Stream independent of hidden randomness | Accuracy under output-dependent updates | Probes reveal a weak seed and target it |
| Adaptive robustness | Accuracy holds against every allowed interactive adversary | Adversary view, horizon, queries, and corruption budget fixed | Differential privacy of data | Correct exact outputs may leak individuals |
| Event-level DP | One update changes between neighbors | Contribution is bounded per event | User-level privacy | One user contributes thousands of events |
| User-level DP | All records of one user may change | User identity and contribution caps defined | Protection against arbitrary group changes | Unbounded user history has unbounded sensitivity |
| Continual observation DP | Entire sequence of releases is private | Horizon and joint mechanism analyzed | One-query noise independently reused forever | Repeated fresh queries compose |
| Pan-privacy | Internal state and outputs satisfy privacy under stated intrusions | Intrusion timing/count and state view specified | Encrypted storage alone | Exact raw state exposed during compromise |
| Post-processing | Data-independent transformation preserves DP parameters | No fresh private-data access | Free repeated access to data | Recomputing with new data-dependent noise is composition |
The protected object is the complete interactive view. Accuracy must hold for the declared adaptive adversary, while privacy compares transcript distributions on adjacent streams; per-release guarantees cannot be pasted together without composition, and output privacy does not cover an exposed internal state.
How Leakage and Reuse Break Guarantees
A fixed-input tail bound may say that for any predetermined key $x$, a sketch estimate is accurate with probability $1-\beta$ over a random hash function. It does not say that one hash function is simultaneously accurate for every key an adaptive analyst can manufacture after seeing outputs. Swapping “for every fixed $x$” with “with high probability, for every adaptively chosen $x$” changes the quantifier order.
Repeated interaction leaks information about hidden randomness. Once enough is learned, an adversary can concentrate updates on collisions or weak directions. Defenses include limiting transcripts, refreshing randomness between epochs, maintaining independent copies and robustly aggregating them, or using pseudorandom/cryptographic hashing under computational assumptions. Freshness alone is not free: resets affect mergeability, continuity, state size, and privacy composition.
Privacy reuse has a parallel failure. If $k$ mechanisms each access the same private stream with pure-DP parameters $\varepsilon_1,\ldots,\varepsilon_k$, basic composition gives $\sum_j\varepsilon_j$. Releasing the same already-private output repeatedly costs nothing extra by post-processing, but rerunning the mechanism with fresh noise is a new access.
For continual counting, a naive mechanism adds independent noise to every prefix. A single event affects up to $T$ releases. A binary tree represents each prefix as a sum of at most $\lceil\log_2 T\rceil$ noisy interval nodes, while each event participates in at most that many nodes. This restructures sensitivity and composition; it does not eliminate noise or the need to declare adjacency.
flowchart TD
A[Fixed-input guarantee] --> B[Expose repeated outputs]
B --> C[Adversary learns about hidden state or randomness]
C --> D[Future update targets a weak direction]
D --> X[Accuracy failure]
B --> E[Each data-dependent release consumes privacy]
E --> F[Compose epsilon and delta]
F --> Y[Budget exhaustion or excess noise]
A --> G[Strengthen threat model]
G --> H[Independent copies or fresh epochs]
H --> I[Robust aggregation and validation]
G --> J[Private transcript mechanism]
J --> K[Binary-tree release and accounting]
I --> L[Joint robust guarantee]
K --> L
classDef navy fill:#17365D,color:#fff,stroke:#17365D;
classDef teal fill:#147D84,color:#fff,stroke:#0D565B;
classDef crimson fill:#C6284D,color:#fff,stroke:#861B35;
classDef purple fill:#6C3BAA,color:#fff,stroke:#472675;
class A,B,C,D,E,F navy;
class G,H,J purple;
class I,K,L teal;
class X,Y crimson;
How Leakage and Reuse Break Guarantees
A dashboard makes $k=10$ fresh releases, each using an $(\varepsilon_0,\delta_0)=(0.1,10^{-6})$-DP mechanism on the same stream.
- Basic composition gives $(\varepsilon,\delta)=(1.0,10^{-5})$ for the transcript.
- Displaying one cached release ten times is post-processing and retains $(0.1,10^{-6})$.
- If the target total budget is $\varepsilon=0.5$, assigning $\varepsilon_0=0.05$ per fresh release meets the basic bound but doubles Laplace scale relative to $0.1$.
- For $T=16$ continual count times, a binary representation uses at most $\log_2 16=4$ interval nodes per prefix and per event path, rather than treating all $16$ prefixes as unrelated full queries.
Assumption-breaking variation: one user can contribute $100$ events, but sensitivity was calibrated as if adjacency changed one event. The mechanism may satisfy event-level privacy yet fail the claimed user-level contract.
| Analytical tool | What it establishes | Assumptions | Tightness or limitation | Representative failure |
|---|---|---|---|---|
| Quantifier audit | Separates fixed-input from adaptive guarantees | Probability space and adversary timing stated | Diagnostic rather than a construction | Swapping “for each stream” with “one seed for all streams” |
| Median/robust aggregation | Tolerates a bounded fraction of bad estimators | Enough independent copies; bounded corruptions | Costs memory and may add bias | All copies share one compromised seed |
| Fresh randomness | Limits information accumulated about one seed | Epoch boundaries and secret coins | Reset cost and cross-epoch queries remain | Seed exposed in logs |
| DP composition | Bounds privacy loss of joint releases | Each conditional mechanism is DP | Basic sum may be loose | Counting each dashboard view as free recomputation |
| Binary-tree mechanism | Supports private prefix releases with logarithmic participation | Known/bounded horizon and counter sensitivity | Noise still accumulates across nodes | Unbounded user contribution |
| Pan-private design | Protects state under stated intrusions | State representation itself is private | Multiple intrusions may need stronger accounting | Raw buffer survives beside private sketch |
| Adversarial hashing | Resists chosen-key collision attacks | Computational or secret-key assumptions stated | Not information-theoretic robustness | Attacker learns the hash key |
Private Counters and Adaptive Dashboards
A school attendance counter illustrates continual observation: daily releases can expose an individual’s arrival day even if the final total is harmless. A private prefix mechanism changes the transcript distribution, while a robust mechanism separately handles operators who adapt later queries to earlier values.
In observability systems, analysts drill into regions, tenants, and error codes based on displayed anomalies. This creates adaptive query selection. If the same sketch randomness serves every drill-down, fixed-query error rates can be misleading. Fresh independent sketches, holdout validation, rate limits, and transcript-aware confidence are engineering responses, not automatic consequences of standard concentration.
In federated analytics, edge summaries are merged and repeatedly released. Privacy must compose across regions, time, and users; robustness must handle poisoned devices and adaptive coordinators. Differential privacy does not stop malicious data poisoning, and a Byzantine-robust mean does not hide honest clients.
Private Counters and Adaptive Dashboards: Robustness, Privacy & Adaptive Streams
A clinic publishes daily cumulative appointment counts over $T=8$ days. One patient contributes at most one appointment.
- Event-level and user-level adjacency coincide under the one-appointment cap.
- Exact prefixes reveal which day a new appointment arrived by differencing.
- A binary tree of height $3$ lets each prefix use at most three noisy interval sums; each appointment influences at most three nodes.
- List the dyadic intervals for prefix day $7$: for example, $[1,4]$, $[5,6]$, and $[7,7]$.
- Explain why publishing exact internal interval sums would defeat output privacy.
Success criteria: draw the tree, express every prefix as disjoint nodes, state adjacency and horizon, and distinguish privacy noise from ordinary sketch error.
Private Counters and Adaptive Dashboards: Robustness, Privacy & Adaptive Streams
A global threat dashboard ingests $5$ million updates per second from $60$ regions. Analysts make up to $10{,}000$ adaptive drill-downs daily. The service must provide continual hourly counts, user-level $(2,10^{-6})$-DP per quarter, tolerate $5\%$ poisoned regional summaries, and keep relative error below $3\%$ for sufficiently large counts.
Design: bound and authenticate per-user contributions; separate regional poisoning controls from privacy; use independent sketch ensembles with robust aggregation; rotate randomness by versioned epochs; use a continual-release tree for scheduled counts; route exploratory queries through a privacy accountant; suppress low-support cells; and keep raw buffers outside any pan-private claim.
Risks: colluding regions exceed the corruption threshold, adaptive queries learn stable hash structure, user identities fragment across regions, late events cross privacy periods, shared seeds correlate copies, and repeated dashboards exhaust budget. Differential privacy will not sanitize poisoned inputs.
Evidence: adversarial collision tests, poisoning sweeps, per-user contribution audits, neighboring-dataset tests, accountant traces, seed independence, alternative merge orders, intrusion tests for stored state, error by support size, and fail-closed behavior on budget/version mismatch.
Decision: deploy only if the joint transcript fits the quarterly privacy budget and robustness tests meet the declared adversary class. Otherwise reduce query freedom, increase aggregation thresholds, refresh state, or narrow the guarantee.
Threat-Model a Streaming Release
Begin with assets and observers: raw events, sketch state, randomness, intermediate summaries, releases, logs, and side channels. Define who chooses updates and queries, what they observe, whether they are computationally bounded, how many users or devices can be corrupted, and when internal state may be inspected.
Then write three separate contracts: statistical accuracy, adversarial robustness, and privacy. Connect them only through proved composition or stability results. A production artifact should also specify adjacency, contribution limits, sensitivity, horizons, randomness lifecycle, budget accounting, release schedule, merge compatibility, incident behavior, and evidence.
Practice: Threat-Model a Streaming Release
Design a dashboard that publishes a running count for $T=16$ intervals and permits eight adaptive drill-down queries.
Tier 1 — Models. Define oblivious/adaptive stream, event/user adjacency, continual observation, pan-privacy, sensitivity, transcript, and adversarial hashing.
Tier 2 — Counter tree. Draw the $16$-leaf binary tree. Show which nodes answer prefixes $7$ and $13$, and verify that a single event participates in at most four released node sums.
Tier 3 — Privacy budget. Allocate total $\varepsilon=1$ between scheduled counts and eight exploratory queries. Under basic composition, calculate a valid per-query allocation and state its noise consequence.
Tier 4 — Robustness. Use five independent estimators and a median. Determine how many corrupted copies the median can tolerate, then explain why shared randomness can invalidate independence.
Tier 5 — Counterexamples. Analyze an exposed hash seed, one user with $1{,}000$ events, replayed releases, two state intrusions, and an analyst selecting queries from prior errors. For each, name the broken assumption.
Tier 6 — Professional artifact. Produce a threat model with actors, assets, adjacency, adversary capabilities, corruption budget, transcript, sensitivity, privacy accountant, state exposure, randomness rotation, accuracy thresholds, audit tests, and shutdown rules.
Debugging prompts: if privacy loss is unexpectedly high, find recomputation and hidden releases; if adaptive error rises, inspect seed reuse and correlated copies; if pan-privacy fails, search state, caches, logs, and crash dumps; if poisoning succeeds, verify identity and contribution gates.
Stretch goal: compare information-theoretic robustness with keyed cryptographic hashing. State what each assumes and what happens if the key becomes public.
Rubric (10 points): precise threat model 2; correct privacy/sensitivity accounting 2; valid robustness design 2; continual-release reasoning 2; measurable tests and limitations 2.
Bridge: mergeable sketches explain distributed state; information-theoretic bounds explain unavoidable leakage and memory limits. Robust private streaming adds interaction, stability, privacy composition, and adversarial systems engineering.
Decision checklist: define transcript, adjacency, contribution bounds, adversary view, adaptivity, corruption budget, horizon, state exposure, randomness lifecycle, sensitivity, composition, and failure behavior; test chosen-input attacks and neighboring streams; and keep robustness, privacy, and accuracy claims separate. Fresh noise is not free, DP is not poisoning defense, and an oblivious-stream theorem is not an adaptive guarantee.
Next in the Series
In Practical Sketch Engineering, we'll explore Turn asymptotic sketches into dependable production components..