Manuscript Offprint
arXiv:2611.08699Adaptive Data Analysis and Adversarial Robustness on Insertion-Deletion Streams
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Classical streaming algorithms and statistical mechanisms frequently fail when future inputs or queries depend adaptively on prior outputs. In this work, we resolve central open questions in both adaptive data analysis (ADA) and adversarially robust turnstile streaming by introducing a unified hierarchical estimator-corrector-learner framework. For adaptive data analysis over an unrestricted domain, we design a randomized mechanism that answers adaptively chosen statistical queries to within additive error using samples, nearly matching the lower bounds of Hardt and Ullman [FOCS 2014] and Steinke and Ullman [COLT 2015] while improving upon the classic bound of Dwork et al. [STOC 2015] and Bassily et al. [STOC 2016]. For known finite domains , we combine our mechanism with private multiplicative weights to improve the sample complexity to . Building on our ADA mechanism, we construct a fixed linear sketch with a stateful decoder that answers adaptive moment estimation queries to within a -multiplicative factor using bits of space. Finally, by embedding this sketch into a binary-tree recursion that preserves child states across parent updates via multiplicative rescaling, we obtain the first nearly space-optimal adversarially robust algorithm for estimation on insertion-deletion streams. Our algorithm uses bits of space, improving upon the bound of Gribelyuk et al. [STOC 2026] and matching the insertion-only bound of Woodruff and Zhou [FOCS 2021]. This demonstrates that no asymptotic space overhead in is required to achieve adversarial robustness in the turnstile model. Our results have been verified in Lean.
*Princeton University and Google Research. eg5539@princeton.edu. Supported in part by an NSF CAREER award CCF-2339942. †Google Research. honghaol3010@gmail.com. ‡ByteDance. lyuxin1999@gmail.com. §MIT. mahbod@mit.edu. Supported by the 2026 Apple Scholars in AI/ML PhD fellowship. ∇Carnegie Mellon University and Google Research. dwoodruf@andrew.cmu.edu. Supported in part by Office of Naval Research award number N000142112647 and a Simons Investigator Award. ¶Princeton University. hy2@cs.princeton.edu. Supported in part by an NSF CAREER award CCF-2339942. ||Texas A&M University. samsonzhou@gmail.com. Supported in part by NSF CCF-2335411.
1 Introduction
Over the past three decades, the streaming model has emerged as a central paradigm for studying algorithms which process massive amounts of data. Specifically, updates to an underlying dataset arrive sequentially, and the task of the algorithm is to maintain a compact summary (or a sketch) which supports dynamic updates and allows the user to recover various statistics about the dataset. Typically, the algorithm is only given a single pass over the data stream and must use space which is sublinear in both the universe size and stream length . As the streaming model effectively captures data-processing pipelines in practical systems, there have been numerous works aimed at achieving optimal space streaming algorithms for a variety of problems.
It is a core assumption in the design and analysis of randomized algorithms that the input sequence is fixed in advance and independent of the internal parameters of the algorithm. However, in many applications, the intermediate responses of the algorithm may influence the distribution of future inputs to the system. For example, optimization procedures update intermediate iterates based on prior estimates, future queries to a database often depend on previous query outputs, and investors respond to changes in financial markets, which in turn shape future transactions. A special case of this paradigm is studied in adaptive data analysis, where a randomized mechanism is given a sample of i.i.d. points from an unknown distribution before the query sequence arrives, and the task of the algorithm is to return an accurate estimate for the population mean of each query on the underlying distribution, where queries may depend adaptively on prior estimates. While a common technique in the non-adaptive setting would be to return the empirical average of the sample points, an adaptive analyst can select queries which overfit to the sample, causing a significant deviation from the population mean. Likewise, the correctness analyses of classical streaming algorithms are completely invalidated when the update sequence may depend on the internal random bits (or sample points) used by the algorithm, necessitating the development of new approaches to reason about and ensure correctness. To this end, our work focuses on both settings simultaneously, developing techniques which are broadly applicable to both adaptive data analysis and adversarial streaming. Next, we describe each problem setting and motivation separately, beginning with the adversarially robust streaming model.
Adversarially robust streaming. Motivated by known limitations, in recent years there has been a large body of work exploring new algorithmic and lower bound techniques for algorithms in the adaptive setting [BJWY22, KMNS21, HKM+20, CNSS23, CGS22, LSW+25, CGNS26]. This paradigm has previously received significant attention in other settings, such as statistical queries in adaptive data analysis [HU14, SU15, DFH+15b, DFH+15a, DSWZ23], dynamic graph algorithms and data structures [BvdBG+22, AvdB24, Waj20, CN20, AY26], and adversarially robust machine learning [AEIK18, GSS15, HPG+17]. Concretely, the data stream consists of updates to the frequency vector , where is an index and denotes the increment or decrement to index . The update sequence induces an intermediate frequency vector , where each entry is given by . Then, at each time , the algorithm should return an accurate estimate of a given statistic , even when updates may be selected adaptively based on prior algorithm outputs.
Definition 1.1 ([BJWY22]). Let be a fixed function, and let denote the frequency vector at time . A streaming algorithm is adversarially robust if, for any accuracy parameter
, failure probability , and an adaptively chosen stream length , the algorithm returns a sequence of outputs satisfying
Alternatively, the adversarial streaming setting is represented by the following two-player game between the bounded-space algorithm and a computationally-unbounded adaptive adversary.
(1) At each time , the adversary chooses an update to insert into the stream; may depend arbitrarily on the transcript of previous updates and algorithm responses .
(2) The algorithm receives update , updates its internal state, and returns the current estimate for .
(3) The adversary records the algorithm's output and proceeds to the next round.
The last few years have seen significant progress in the design of new algorithmic techniques for robustness, as well as strong lower bounds against common classes of streaming algorithms. For the special case that the stream contains only insertions of universe elements, the initial works of [BJWY22, HKM+] presented general frameworks to “robustify” classical streaming algorithms for a large class of statistical estimation problems with only a small poly overhead in the space complexity. This was subsequently improved by [WZ21] to obtain tight bounds with respect to the accuracy parameter; for instance, their algorithm for moment estimation uses bits of space, nearly matching the space complexity of in the classical streaming model [AMS99, KNW10]. From the other perspective, some works have uncovered space complexity separations between adaptive and non-adaptive streaming [CGS22, KMNS21]; in particular, [KMNS21] gave an exponential separation for the “streaming” version of the adaptive data analysis problem, formally connecting these two areas.
In the general case where the stream may contain both insertions and deletions, the situation was much more challenging. As space-optimal turnstile streaming algorithms are equivalent to linear sketches [LNW14, JLY26], many works have focused on designing efficient adaptive attacks against linear-sketching based algorithms [HW13, CNS+, GLW+, ACS25, GLW+], as well as for specific sketches [CNSS23, AC24]. In fact, these adaptive attacks against algorithms which use persistent randomness are conceptually equivalent to lower bounds for adaptive data analysis and interactive fingerprinting codes [HU14, SU15]. For counting distinct elements, [GLW+] used fingerprinting-based techniques to show that any streaming algorithm which remains accurate under adaptive insertions and deletions and uses linear sketching-based methods must store at least bits of space. Similarly, [GLW+] showed that an adaptive adversary can essentially learn the underlying sketch matrix used by an estimation linear sketch after poly adaptive queries, implying an space lower bound. Meanwhile, all known robust algorithms for estimation required space polynomial in the stream length [BJWY22, HKM+, BEO22]. Very recently, several works [GLW+, GLW+] circumvented this barrier for linear sketches and designed the first robust algorithms for estimation for all which store only poly bits of
The moment of the frequency vector is defined as . For , the moment is .
space. To overcome prior lower bounds, these algorithms are crucially non-linear and introduce new random bits during the execution of the algorithm.
moment estimation. In this work, we return to the moment estimation problem in the adversarial streaming model. The seminal work of [AMS99] gave an space algorithm for , which was later shown to be exactly optimal [KNW10, BZ25]. Since then, the estimation problem has become particularly significant in both theory and practice. Theoretical techniques developed for estimation have inspired efficient streaming algorithms for a host of other estimation tasks, and streaming lower bounds for estimation were the first to be proved via reductions from communication complexity [AMS99, IW03, Woo04], sparking a beautiful line of works which has further explored the connections between these models. On the practical side, the moment roughly represents the repeat rate of the input stream, and algorithms for are often used in network traffic monitoring [KSZC03] and database query optimization [AGMS99].
In the adaptive setting, the space complexity of estimation is far from being well understood. Note that for insertion-only streams, [WZ21] gave an space adversarially robust algorithm for , nearly matching the classical streaming lower bound of . While the recent robust algorithm [GLW+26b] achieves poly space, the dependence on the accuracy parameter in the space complexity scales as . To this end, we study the following central question:
Is there a separation in the space complexity of moment estimation in the adversarially robust and classical turnstile streaming models?
To address this question, we first focus on a question of independent interest in adaptive data analysis, which we describe next.
Adaptive data analysis. Motivated by statistical analyses in natural sciences, an earlier line of work has explored the adaptive data analysis problem, where a finite sample is drawn from an unknown distribution , and several analyses are then performed to uncover properties of the underlying distribution . In this setting, the outcome of an analysis is viewed as statistically significant if the outcome is unlikely to occur due to just random chance. However, practical data analysis processes are often inherently adaptive: analysts may elect to run certain tests after inspecting the sample set itself, thus increasing the chance of overfitting and false discovery [HU14, SU15, DFH+15b]. Indeed, this has been identified as a major concern in the statistics community over the past few years [GL16].
To this end, adaptive data analysis studies a theoretical formulation of this problem, where the mechanism is given an i.i.d. sample from an unknown distribution with support , and the task of the mechanism is to answer adaptive statistical queries about . Formally, at each time , a data analyst provides a statistical query , and the mechanism should return an accurate estimate for the population mean with high probability, such that for some accuracy parameter . Importantly, each query requested by the analyst may depend on all prior mechanism estimates and queries . For non-adaptive queries, the standard approach is to take the empirical average of samples, which suffices by concentration and a union bound. For adaptive queries, this argument breaks down, since an analyst can gradually select queries that exploit the samples. Note that using a fresh sample block for each query restores independence, but requires samples.
Over the past decade, there has been substantial progress on designing improved mechanisms and sample lower bounds for adaptive data analysis in various settings [HU14, DFH+15b, BNS+16, BF16, FS18, NST23, RCS26, LT25]. Known mechanisms broadly fall into one of two categories, which are distinguished by whether the sample complexity depends on the support size of the distribution . In the unrestricted domain setting, the differential privacy approach of [DFH+15b], with the improved generalization analysis of [BNS+21], requires samples. To see the dependence on , consider adding noise to each empirical answer. With samples and total privacy parameter , composition gives noise of magnitude approximately . To ensure that the empirical answers remain within additive error of the population answer , the standard generalization bound requires setting the total privacy budget to . Requiring the noise to have magnitude then gives . Alternatively, in the setting that the unknown distribution has bounded support , one approach uses private multiplicative weights [HR10, BNS+21] to achieve sample complexity roughly . This mechanism maintains a hypothesis distribution, checks its predictions privately, and updates it when a query exposes an error. Note that this logarithmic dependence on can give a smaller sample bound when the number of queries is sufficiently large. On the lower bound side, [HU14, SU15] showed that any mechanism which can accurately estimate statistical queries must maintain samples. As answering a single statistical query requires samples, this implies a lower bound of . A central question [Ste16, BNS+21] has therefore been to resolve this gap in the sample complexity of adaptive data analysis for both settings:
Is there a statistically accurate mechanism for adaptive data analysis which answers adaptive statistical queries using samples?
Theorem 1.2 (Adaptive data analysis). Given an accuracy parameter and failure probability , there exists a randomized mechanism that answers adaptively chosen queries to additive error with respect to any unknown distribution on a finite domain , simultaneously with probability at least , using independent samples from .
On the path to obtain our nearly-optimal estimation algorithm in the adversarial streaming setting, we consider the adaptive query model, where the algorithm samples a sketch matrix before the input arrives, and for each time the algorithm must provide a -approximation for the moment of a query vector , which may be chosen adaptively based on prior algorithm outputs. Importantly, the algorithm can only access the query by observing the sketch . This adaptive query model has previously been studied by [ACS25, CS26], which showed that any linear sketch with rows can be broken using adaptive queries. Specifically, when , their attack uses adaptive queries. In fact, our next corollary gives an algorithm which exactly matches the query complexity of their attack for the case that . As optimal space linear sketches use bits of space, this exactly characterizes the power of linear sketches under adaptivity.
Corollary 1.3 (Adaptive queries). Given an accuracy parameter and failure probability , there exists a fixed linear sketch with a stateful decoder that answers adaptively chosen queries on vectors in with polynomially bounded coordinates, simultaneously to within a factor of with probability at least , using bits of space.
As an adversarially robust streaming algorithm must return an estimate of the moment at each time for an input stream of length , Corollary 1.3 does not immediately imply any improvement over the previous space algorithm of [GLW+]. Our main insight is a way to carefully combine the sketch in Corollary 1.3 with an improved algorithmic framework for robust estimation which uses each linear sketch for at most adaptive queries throughout the stream of length . We design a nearly-optimal space algorithm for in the adversarial streaming model under insertions and deletions. In particular, this shows that no losses in are necessary to achieve robustness up to polylogarithmic factors in .
Theorem 1.4 (Adversarially robust streaming). Given an accuracy parameter and a turnstile stream of length on a universe of size , with polynomially bounded integer frequencies, there exists an adversarially robust algorithm that, with probability at least , outputs -approximation to the moment at all times and uses bits of space.
Finally, by combining our improved mechanism for the unrestricted domain setting in Theorem 1.2 with the private multiplicative weights framework of [BNS+], we obtain the following improved mechanism for the bounded universe setting of adaptive data analysis.
Theorem 1.5 (Adaptive data analysis on a bounded universe). Given an accuracy parameter and failure probability , there exists a randomized mechanism that answers adaptively chosen queries to additive error with respect to any unknown distribution on a known finite domain , simultaneously with probability at least , using independent samples from .
1.2 Technical Overview
1.2.1 Adaptive Data Analysis
Recall that in adaptive data analysis, we receive independent samples from an unknown distribution over a finite domain and must answer adaptively chosen queries . Writing , our goal is to return answers satisfying for all . We describe how to achieve this using samples. In particular, the sample complexity is when .
Overview. Our first observation is that a good estimate to the population answer need not be a good estimate to the empirical average. Instead, our approach uses differential privacy to show that a set of samples admits a set of “reference weights” whose weighted empirical averages accurately answer all the adaptive queries. Although the algorithm does not know these reference weights, it maintains candidate weights and uses successive corrections to guide them toward an accurate reference weighting. The existence of such a reference weighting allows us to upper bound the total number of corrections across the queries.
We first explain this idea through a simplified estimator-corrector-learner framework: an estimator answers queries using its current weights, a corrector detects inaccurate predictions, and a learner updates the weights in response. We then explain why protecting a single corrector is too expensive, and replace it with a hierarchy in which intermediate blocks also learn. The main step in the analysis shows that corrections become progressively rarer toward the top of the hierarchy, allowing these blocks to maintain stronger privacy guarantees without requiring more samples.
Existence of reference weights, i.e., accurate answers by reweighting samples. Consider a block of samples whose interaction transcript is -private. We first show that for , there exists a near-uniform probability vector such that
for every query in the realized interaction. The vector consists of the reference weights and is fixed across the queries, although it may depend on the completed transcript. Although the algorithm does not know or compute this vector, it nevertheless certifies that a “near-uniform” weighting of the observed points can answer all the selected queries accurately, which will ultimately be used to upper bound the total number of corrections made by the learner.
To see why such reference weights should exist, reveal the completed transcript after the queries and then reveal the samples one at a time. Let be the conditional distribution of given the transcript and the previously revealed samples. Then, weighting a value by would undo the conditional bias. Pure differential privacy would ensure that these ratios lie in , but result in a sub-optimal sample complexity. Instead, we use approximate differential privacy to give a better sample bound through advanced composition and then to upper bound the resulting bias in expectation, after clipping the ratios to the interval .
While this controls the expected bias, we also need the reweighting to be accurate with high probability, simultaneously for all queries. This can be shown using a standard martingale concentration inequality. Finally, we normalize the correction factors to obtain reference weights that sum to one. Observe that clipping keeps every correction factor within , so after normalization each reference weight differs from the uniform by at most . Thus the total quadratic deviation from uniform is and can be sharpened appropriately.
A simplified estimator-corrector-learner. To explain how to find useful weights without knowing , we consider the following core components:
(1) An estimator maintains a probability vector on and outputs the prediction .
(2) A corrector checks whether this prediction differs “substantially” from . If so, it supplies a sign indicating the direction in which the prediction should move.
(3) A learner uses this failed prediction to update , so that the same sample can support future queries.
The learner stores scores , initially zero. On a correction it adds to each score, and chooses
For example, when the prediction is too small, points with larger query values receive larger score increments. The quadratic penalty limits how aggressively the weights move, while the cap prevents a few sample points from carrying excessive mass.
Suppose the corrector detects that the estimator's prediction is inaccurate, and returns the correction sign . Since the reference prediction is accurate, the chosen accuracy margins give
Thus, the corrector identifies a query on which the estimator's current weights and the reference weights give substantially different predictions. The learner responds by updating and recomputing its weights. To quantify the progress made by this correction, let
and consider the potential
This potential is non-negative because the reference weights are feasible for the maximization defining . Initially, and the learner uses uniform weights, so .
When the learner updates the scores, the objective evaluated at the fixed reference weights increases by . If the estimator kept its old weights , its objective would increase by . The former increase exceeds the latter by at least . The learner also recomputes the maximizing weights, which can further increase . However, the quadratic regularizer limits this additional increase to at most , which implies that the potential changes by
Thus, every error detected by the corrector leads to a learner update that decreases the potential by . Since the potential starts at most and remains nonnegative, at most corrections can occur in this simplified setting.
Why one corrector is not enough. The remaining difficulty is to implement a corrector that can be trusted over the entirety of the adaptive interaction. A natural attempt uses an independent hidden “holdout” block, keeps its weights uniform, and privately checks whether the estimator disagrees with its empirical average. ABOVETHRESHOLD allows many unsuccessful checks without paying separately for each one. However, the holdout still needs enough privacy to remain accurate throughout the corrections.
For intuition, take and constant privacy for the learned estimator. The previous argument shows that the number of corrections is at most , and so it suffices to have a holdout protected with privacy and noise with magnitude , which gives overall sample complexity . Thus a single holdout block results in an expensive number of samples to ensure correctness. Our solution is to let the corrector learn as well, and protect it using another block with fewer corrections.
A hierarchy of estimators, correctors, and learners. We use independent sample blocks , where , and set the error threshold at each level to . Each block maintains scores , weights , and a prediction . Each intermediate block checks the block below it and is itself checked by the block above it. The final block is a uniformly weighted anchor, and the output to each adaptive query is given by the first block.
For each query, we compare neighboring predictions using private ABOVETHRESHOLD tests. If a discrepancy of at least is reported between levels and , the learner adjusts the scores and , which causes the resulting predictions to move toward each other. Since the disagreement does not identify which prediction is inaccurate, both learned blocks are updated, with the upper block receiving a smaller adjustment, though the anchor is never changed. After each correction, we recompute the affected weights and restart the scan from the first block , since changing one prediction may have invalidated an earlier comparison. The scores and weights persist across corrections and queries, and once a complete scan finds no disagreement, the algorithm releases , i.e., the prediction by the first block, along with some added noise to maintain privacy.
Progress and privacy across the hierarchy. To avoid a larger number of necessary samples, the key property is that blocks with stronger privacy guarantees undergo fewer corrections. Recall that in the simplified setting, a learner with privacy budget has reference weights whose quadratic distance from uniform is at most . This bounds the initial potential, while each correction decreases it by , giving at most corrections. To extend this relationship to the hierarchy, we analyze progress jointly: although neighboring predictions may both be inaccurate, their reference predictions approximate the same population answer. The coupled updates therefore decrease a shared potential, even when one block's update is unhelpful in isolation. This yields correction bounds decreasing by a factor of four as privacy budgets decrease by a factor of two per level.
Moreover, the regularized predictor has sensitivity , while ABOVETHRESHOLD makes the privacy cost depend on the number of corrections. For an intermediate block, we restrict the number of corrections to be at most and privacy budget . Then by advanced composition, the necessary sample complexity is , since and . We choose the depth so that the anchor only has a constant number of corrections, so the same sample bound gives privacy and error for its uniform averages. The first block additionally releases numerical answers; its privacy budget gives an additional sample cost of .
We remark that there is a slight concern about circular reasoning, since privacy depends on the number of corrections and vice versa. We circumvent this issue by first imposing deterministic limits on the number of corrections and establishing privacy for the resulting mechanism. We then obtain the reference weights and use the progress analysis to show that these limits are never reached with high probability.
Once a scan succeeds, adjacent predictions differ by , and the anchor has population error . Telescoping across the hierarchy gives error for the first block; the chosen constants ensure error at most , including output noise and rounding. The correction bound guarantees that every query finishes. Summing over the logarithmic number of blocks gives samples, as desired.
1.2.2 A Toy Problem: Adaptive Queries
We first isolate a toy problem connecting our ADA result to adversarially robust streaming. Starting from , we process turnstile updates and answer only queries for . Both the updates and the query times may depend on previously reported answers, and there can be up to updates between queries, so that . The adversary sees the previous algorithm outputs but not its internal state. We show that to answer all queries within a multiplicative factor of , simultaneously with probability at least , it suffices to use bits of space.
A standard approach for this toy problem would be to reserve a separate accurate sketch for each query, maintaining all of them from the start of the stream. Robustness is immediate since each sketch is only used once, but with any standard streaming algorithm such as AMS [AMS99], this requires space. The usual differential privacy approach improves the dependence to . Our ADA mechanism removes the remaining loss by reusing the same measurements across adaptive queries.
From adaptive statistical queries to norm estimates. For a random sign vector , we have . Thus, we can view independently sampled sign rows as the samples of our ADA mechanism, and a vector as specifying a query on these rows. The streaming algorithm maintains the linear measurements , which suffice to evaluate the query without storing . The difficulty is that squared measurements are unbounded, whereas the ADA mechanism requires bounded queries . To this end, we use a constant-factor approximation of to find a good scale. Namely, we set , where . Moment bounds for random signs show that this clipping only introduces bias. However, the benefit is that additive error for this query translates to -multiplicative error for the norm. To acquire the constant-factor approximation , we maintain a separate sketch for each query. This uses space, so that along with the samples from our ADA mechanism, the total space is
1.2.3 Adversarially Robust Streaming
Unfortunately, the full streaming problem requires an answer after every update, i.e., a stream of length has adaptive queries, which can be much larger than . Applying the toy problem directly with would introduce a polynomial dependence on the stream length. We also cannot simply restart the problem after each batch of queries, since a newly formed sketch does not have access to the previous stream updates. We instead provide a reduction to the toy problem using the estimator-corrector-learner framework of [GLW+].
The estimator, corrector, and learner. Suppose that , where is the frequency vector at some earlier time and contains the subsequent updates. An older sketch has seen the prefix and maintains both and . An independent sketch , initialized at that earlier time, can maintain from zero, but cannot recover . The goal is to use the newer sketch to answer most queries while requesting few numerical estimates from the older sketch. To do so, the learner maintains an iterate , initially zero, representing its current approximation to . The three components operate as follows:
(1) The estimator submits an approximation of as an estimate of . The first term is estimated using and cached until changes. The second is obtained from the newer measurements , using the recursion described below.
(2) The corrector uses to check the proposed output by the estimator. If the discrepancy is small, the estimator's answer is released. Otherwise, the corrector supplies an accurate answer for the current time-step and notifies the learner that the proposed estimate was too large or too small.
(3) The learner uses an incorrect notification to update and refresh the cached estimate of . The updated iterate is retained for subsequent queries.
All vectors are represented through their linear measurements. In particular, we maintain and , rather than storing explicitly.
Why an inaccurate estimate permits learning. The estimator omits exactly one cross term,
and so if the cross-term is small, the estimator is already accurate. Otherwise, gives a direction correlated with the remaining error . Let be the local accuracy parameter, chosen below to accommodate the recursion depth. The threshold for the corrector is chosen so that a rejection certifies a cross term of magnitude with the indicated sign. The learner then takes a step
where has this sign and magnitude proportional to , computed from the available estimates. Expanding the squared residual shows that a sufficiently small step gives
Thus every correction removes a fixed fraction of the remaining squared error, after which we can conclude that the learner only requires corrections.
The cost of restarting recursive estimators. Estimating is itself a streaming norm-estimation problem, so it can be handled by implementing the estimator-corrector-learner framework recursively, i.e. by approximating using the estimator , where and is the iterate for this estimation instance. However, the difficulty is that the child node's input changes whenever its parent updates . The construction of [GLW+26b] handles such changes by starting a new child node each time that the parent's iterate changes. Its recursion uses a branching factor , and each corrector serves possible targets for the learner, each requiring possible corrections, leading to corrections. Applying the differential privacy robustification technique of [HKM+20] in tandem with a standard sketching algorithm such as AMS gives a total space of bits. We emphasize that replacing the statistical mechanism alone would still leave this larger request budget in place, leading to sub-optimal space.
Preserving the child when the parent learns. Our first improvement is to retain the recursion in the child node when a parent node's iterate is updated. In fact, the update rule above has the useful property that
Thus the child's entire current input is multiplied by one known positive factor. We apply this factor to its prefix, suffix, and learned iterate, and its square to the cached residual estimate of . These changes can be performed directly on the stored measurements and propagated to the active descendants in the recursion. After dividing out the accumulated rescaling from its ancestors, the child is still learning the same fixed prefix. In particular, this means that the progress it has already made toward learning is preserved, and only updates to its own iterate will affect the total number of adaptive queries which the sketch must handle. Note that these rescalings act on these virtual states; future physical updates retain their original values.
We can consequently use a binary tree of time intervals fixed before the stream begins, with depth . Each block has one child for each half of its interval, and corrections never create additional child nodes. A block uses its parent's sketch to check its incoming vector, and initializes its own sketch to track , which starts at zero. This sketch then serves as the corrector for its two children. Hence, each corrector handles only corrections in total. Since only one root-to-leaf path is active, and the sparse vectors at the leaves can be evaluated explicitly; by applying the previous differential privacy robustness approach, this reduces the total space to .
Troubleshooting the toy problem: precision and space. Our second improvement replaces this differential privacy-based robustness framework with the ADA mechanism for the toy problem. Each sketch now needs only corrections, which is precisely the regime in which the solution to the toy problem uses space. There is one additional requirement: the corrector checks a proposal after every update, and accepted checks also reveal information about its sketch. We therefore use the verification extension of the ADA mechanism, so that persistent ABOVETHRESHOLD phases allow many accepted checks while charging privacy to rejections and numerical releases. Since each correction requires a constant number of numerical estimates, then this verification extension uses sketching dimension, as desired.
Finally, to translate to bit complexity, we round all maintained vectors to precision after every step. However, we must then control rounding errors under the repeated rescalings which appear in the update rule . Note that each level will experience such rescalings, and lower levels of the recursion will potentially be affected by rescalings from all higher levels. To ensure that all maintained vectors have polylog() bit complexity, we introduce tiny auxiliary coordinates that cancel between the residual and outgoing vector. Their magnitudes track subsequent rescaling, allowing the residual-energy bound to control error amplification. These coordinates also provide the lower bounds on recursive norm scales needed to bound the number of corrections. Together, these guarantees give corrections per learner and polylogarithmically many bits per stored scalar.
Taking leaves room for errors from recursion, verification, and rounding. By induction over the hierarchy, we conclude that the algorithm returns a -approximation for all estimates simultaneously throughout the stream with probability at least . Since only sketches are active at any given time , the total space is bits, as desired.
2 Preliminaries
Definition 2.1 (Differential privacy). Given a privacy parameter and , we say a randomized mechanism is -differentially private if, for every ordered pair of neighboring datasets differing in one sample and every output event ,
If , the mechanism satisfies pure privacy, otherwise it satisfies approximate privacy. For an interactive mechanism, the output is its completed transcript, and the inequality must hold for every fixed analyst rule.
Definition 2.2 (Laplace distribution). For , the Laplace distribution has probability density . In particular, if , then for all , we have .
Definition 2.3 (Global sensitivity). A function has global sensitivity at most if for every pair of datasets differing in one sample.
Lemma 2.4 (Laplace mechanism [DR14, Theorem 3.6]). If has global sensitivity at most , then the mechanism that releases for with drawn independently, is -differentially private.
Lemma 2.5 (Post-processing and independent mixtures [DP20, Definition 3 and Proposition 1]). The following properties hold.
(1) If is -differentially private, then any computation using only and independent randomness is also -differentially private. In particular, clipping and rounding preserve privacy.
(2) Suppose is -differentially private for every fixed . Sampling independently of the dataset and then running with fresh randomness also gives an -differentially private mechanism.
The second property allows us to prove a uniform privacy guarantee after fixing auxiliary randomness independent of the protected samples, and then average over that randomness.
AboveThreshold. Fix a threshold and a noise scale . Draw once. For each test function , draw fresh noise and release 1 if , and 0 otherwise. The procedure stops at the first 1. The analyst may choose each test function and may stop earlier using previous outputs and independent randomness. All noise draws are independent; the same is reused throughout the procedure.
Lemma 2.6 (Privacy of ABOVETHRESHOLD [DR14, Theorem 3.23]). If every test function has global sensitivity at most for every fixed preceding history, then the completed transcript of ABOVETHRESHOLD is -differentially private, regardless of the number of tests.
Composition. We use the following form of advanced composition, which also permits interleaved interactions: one mechanism may remain active while another produces outputs.
Lemma 2.7 (Advanced and concurrent composition [BS16, VW21]). Suppose at most mechanisms access the same dataset, use independent randomness, and each is -differentially private against every adaptive analyst. Their interactions may be interleaved. The choice of mechanism, its inputs, and when to stop may depend on previous outputs and independent randomness, with no other access to the dataset. For every , the combined transcript is -differentially private.
3 Adaptive Data Analysis
Given independent blocks of samples from an unknown distribution , for each , let be the samples for the -th block. We give each sample point a weight , which corresponds to the scaling of for an output estimate by our mechanism, as illustrated in Algorithm 1.
Algorithm 1 ADA mechanism for adaptive queries
Input: sample blocks , query budget , disagreement threshold , Laplace noise scale 1: Initialize for all , 2: for do 3: Receive query 4: UPDATEWEIGHTS() \nrightarrow Algorithm 2 updates the weights 5: Draw and 6: Clip to , round to the grid of spacing 7: return
The weights of each block sum to one, i.e., for all . We specify the last block to be the anchor, whose weights shall remain uniform throughout the course of the queries. We shall set a threshold for the allowable discrepancy between outputs by blocks in the hierarchy, as well as a noise scale . When the discrepancy exceeds , we use Algorithm 2 to update the weights.
Weight computation in Algorithm 2. For each , let . We use the update rule
Here, is a score vector that informally keeps track of which sample points should receive more or less weight, to bring the answer of block into better agreement with those of its neighboring blocks. We also have a penalty term to enforce that the weights should remain near-uniform.
Algorithm 2 UPDATEWEIGHTS(f)
Input: (initialized to 0 before first query) and for
1:
2: while do
3: 4: if then ; continue
5:
6: if then
7: Update all weights using Equation (2)
8: Draw ;
▷Refresh this edge, then restart the scan
Private comparison. We also use a subroutine COMPARE() to privately test whether the discrepancy between two adjacent blocks exceeds the threshold . The approach is essentially the standard ABOVETHRESHOLD procedure from differential privacy, which adds Laplacian noise to both the difference between the output of the adjacent blocks and the threshold. Formally, it tests in that order, drawing fresh for each test and returning the first sign that satisfies
or 0 if both tests fail.
3.1 Reference Weights
We first show the existence of accurate reference weights, which are near-uniform weights that enable the sample to simultaneously answer all queries correctly. Although we will not compute these weights explicitly, we will use the existence of these reference weights to show convergence and correctness of our adaptive data analysis mechanism.
Lemma 3.1 (Existence of accurate reference weights). Let and . Let on a finite domain. Fix an adaptive analyst, and let be the (finite-valued) completed transcript of a -private mechanism interacting with this analyst. Let . For , there exists sample complexity such that with probability at least , there exists a single vector such that
and for every ,
Proof. It suffices to take samples, for . We first draw and run the mechanism, obtaining the joint distribution of . We then analyze this distribution by revealing followed by . This order of analysis does not change how the samples or transcript are generated.
Controlling the bias from conditioning. Let and . For each possible value of , define
whenever ; define arbitrarily otherwise. For ease of notation, we abbreviate , so that is the conditional distribution of the next sample, given the transcript and the samples already revealed. Note that unlike , the distribution of may depend on both the transcript and samples.
We use differential privacy to upper bound how far can deviate from . Our goal is to construct weights that undo the bias introduced by conditioning on the transcript. Ideally, we would assign each value the correction factor , since multiplying its conditional probability by this factor recovers whenever . Unfortunately, this ratio may be arbitrarily large or small. To obtain reference weights close to uniform, we will clip these correction factors to the interval before normalizing. However, clipping leaves some bias uncorrected when or . Thus, we now show that approximate differential privacy upper bounds the total excess in each of these inequalities by on average. To do this, we compare the original samples with one in which the -th sample is independently replaced with a random sample.
Draw an independent sample , and let be obtained by replacing with . Run the mechanism on with fresh randomness and the same analyst rule, producing a transcript . The queries in need not be the same as those in . Let denote the distribution of and denote the distribution of .
For fixed and define to be the dataset where the -th sample is replaced by so that the datasets and are neighboring. Thus for any event , differential privacy gives
and the same inequality in the other direction. Thus, averaging over gives
For each possible value and sample value x, let
Thus and denote the probabilities of individual outcomes under the two experiments. By the definition of conditional probability, . Since is an independent draw, then the pair has the same distribution as , but is independent of the original , we have .
Write . Applying the first inequality in Equation (4) to , we have
(5)
Similarly, applying the second inequality to , we have
We remark that although we require privacy for the output transcript of the overall mechanism, the resulting bounds on conditional bias hold in expectation over , rather than separately for every transcript and prefix.
Constructing the reference weights. Now, if we could multiply the conditional mass by , we would recover the original mass . To achieve near-uniform weights, we instead use a bounded version of this correction:
where when . Importantly, the error remaining after this correction is
by Equations (5) and (6).
Condition on . This fixes the query and the correction function , while has conditional distribution . Writing , we have
because . Thus upper bounds the conditional bias of the corrected contribution for each of the queries.
Concentration and normalization. Although the transcript fixed the queries, the sample values may not be fixed and thus it remains to upper bound the deviation of the weighted values from the conditional expectation. To that end, for each , define
so that conditioned on , the random variable has mean zero and magnitude at most , since . By similar reasoning, we have
Thus by Freedman's inequality,
By our choice of and a union bound, we have that simultaneously for all ,
Hence, by combining with the previous conditional bias analysis, we have that with probability at least , simultaneously for all ,
It remains to normalize the weights. For the constant query , the previous bound gives , for . Thus the initial weights already have sum close to one. Moreover, after normalizing , we have by triangle inequality,
Thus, concentration holds for the normalized weights.
Bounding the deviation from uniform weights. It remains to bound the deviation of from uniform weights, as measured by . We show that . By construction of the clipping, we have . Hence,
Also, implies . Thus by averaging across all , we similarly have . Since and , then by completing the square,
Finally, convexity of on gives
Thus , completing the proof.
3.2 Progress and Convergence
Although we do not compute the reference weights established in Section 3.1, their existence will help us establish a bounded non-negative potential function so that each update to the weights maintained by the algorithm will make progress, by decreasing the potential. To avoid a circular argument where we need privacy to bound the number of corrections and a bound on the number of corrections to establish privacy, we first analyze a version with predetermined correction limits. These limits allow us to establish privacy first; the progress analysis then shows that they are not reached with high probability.
Let be the accuracy and failure parameters. Choose to be the smallest integer with , and set the threshold to be , so that and . For every , including the anchor, let and be the feasible set and quadratic penalty in Equation (2). Let be the current prediction, including the uniform anchor. Define edge so that it joins blocks and .
For each block , we allocate total privacy budget over the course of the adaptive interactions. For the anchor, we set the total privacy budget to be . Since Lemma 3.1 shows the reference weights satisfy , the choice of provides upper bounds on the initial potential induced by . The anchor's smaller privacy budget will ensure that its accurate reference weights are sufficiently close to uniform that the uniform weights themselves are accurate.
To establish privacy before proving an upper bound on the number of corrections, we analyze an auxiliary version with predetermined correction limits. Let count the corrections between blocks and , and for , set to be the correction limit for . That is, whenever a correction makes , the auxiliary version performs the correction and then stops accessing the data, thus allowing us to establish privacy. We will show that with high probability for all . For the analysis, let record all internal comparison outcomes together with the rounded answers. This augmented transcript is finite-valued because the correction limits upper bound the number of comparisons and the answers lie on a finite grid.
Proposition 3.2 (Reference accuracy under bounded privacy). Suppose that, for every , the transcript is -private with respect to block , and that and satisfy the assumptions of Lemma 3.1 with accuracy and failure probability . Suppose also that the probability of any noise draw having magnitude greater than is at most . Then, with probability at least , the following properties hold simultaneously:
(1) For each , there exists a single vector such that
(2) The uniform anchor satisfies
(3) Every noise draw during the execution has magnitude at most .
Moreover, these reference vectors satisfy
Proof. Apply Lemma 3.1 to each block with accuracy , privacy parameter , and failure probability . By hypothesis, the required sample-size bound holds and
When applying the lemma to block , we regard the other independent blocks as part of the mechanism's randomness. This gives the claimed reference weights for every .
For the anchor, the lemma gives a reference vector with error at most and . The anchor uses uniform weights, so . Since both weight vectors sum to one, . Thus subtracting from each query value does not change the difference between their predictions:
Here, the first inequality uses , and the second is Cauchy-Schwarz. Thus by triangle inequality, the anchor's error is at most for every selected query.
Each application of the lemma fails with probability at most . By assumption, the same bound holds for the event that any noise draw exceeds in magnitude. A union bound over the p blocks and the noise event therefore gives all three properties simultaneously with probability at least . Finally, the reference weights satisfy
Let denote the event that all conclusions of Proposition 3.2 hold, so that under the corresponding hypotheses, . Fix an execution of the auxiliary mechanism in , and choose one reference vector for each satisfying Proposition 3.2. We use these same reference vectors throughout the execution. The argument below is deterministic.
One block. For a block of size , let be its feasible set, be its penalty term, and be the weights chosen from scores . Define the maximization objective
Fix a reference vector throughout the updates. For a correction , compare with the current weights before updating them. Holding both vectors fixed, their scores increase by and , respectively, while their penalties remain unchanged. We call this difference the reference vector's score advantage. We now upper bound the sum of these advantages as the algorithm updates its weights, with remaining fixed. We remark that in the following statement, the index counts the number of updates to the weights, rather than the number of queries.
Lemma 3.3 (One update and accumulated reference advantage). For all ,
where . For any sequence , , write for the weights before update s. Then every fixed satisfies
Proof. Let and . The feasible segment from to and optimality of give
Expanding the quadratic penalty and completing the square, we have
which gives the first claim.
Now, to obtain Equation (10), sum Equation (9) over the updates. The left-hand side telescopes, and because the uniform weights are feasible and have zero penalty. Hence, we have
Finally, by the definition of and the feasibility of u, we have
Putting these inequalities together, rearranging, and multiplying by gives the desired claim of
Combining the blocks. We now define a potential to track progress across all learned blocks. Let denote Equation (8) for block . The weights maintained by the algorithm have objective value , while the reference weights have objective value . Define to be the weighted sum of these objective differences:
Observe that each difference is non-negative because is the maximum over all feasible weights, including and thus . We remark that the multipliers compensate for the factor in the update rule for the scores of the neighboring block, so that the two updated blocks have equal coefficients in the linear part of the progress calculation.
Initially , so the uniform weights have objective value zero, the reference weights have value . Thus the difference in their objective values is initially , giving
The next proposition shows that every correction decreases by at least some fixed amount. Since starts at most one and remains non-negative, this will upper bound the number of corrections.
Proposition 3.4 (Progress and correction bounds). Conditioned on the event , every correction on edge in the auxiliary execution decreases by at least . Consequently, every prefix satisfies
In particular, , the total number of corrections is at most , and no correction limit is reached. Moreover, block 1 receives at most weight updates and each block receives at most .
Proof. Consider a correction on query with sign at edge , using the weights before the correction. A positive test and the assumption on the magnitude of the noise imply
First, suppose . The outputs of the two reference weights differ by at most , since each is within of . Hence their combined advantage over the current weights satisfies
We change the scores by the increments and , respectively. By Equation (9), the change in is at most
For the last edge , only block is updated. By Proposition 3.2, its reference prediction differs from the uniform anchor by at most , so
Thus, the change in is at most
Summing the decrease over all corrections performed so far and using and , we have
proving Equation (12). Each term gives , and the total correction bound follows because every multiplier is at least one. If a first correction limit were reached, the prefix including that correction would contradict
Thus no limit is reached.
Finally, block 1 is updated only on edge 1. For , block j is updated only on its two incident edges, giving at most
weight updates.
Run the auxiliary and original mechanisms with the same sample blocks and random choices. Their executions agree until a correction limit is reached. Since no limit is reached on , their executions agree on this event, and the correction bounds also hold for the original mechanism.
Proposition 3.5 (Accuracy on the good event). Conditioned on the event , the original mechanism completes all queries, and every public answer has population error less than .
Proof. The correction bound in Proposition 3.4 ensures that every query finishes. During the final scan, the weights remain unchanged and both signed tests fail at every edge. The assumption on the magnitude of the noise thus gives
Clipping cannot increase error relative to . Combining the adjacent discrepancies, the anchor bound from Proposition 3.2, and the errors from output noise and rounding, we obtain
3.3 Privacy
We now verify the hypotheses of Proposition 3.2 using only the predetermined correction limits. This argument applies to every execution, including those that reach a limit; it does not assume the event or the progress bound.
Sensitivity of the weighted predictions. The global sensitivity is the largest change in a function's value when one sample is replaced. We upper bound the global sensitivity, accounting for changes in both the query values and the weights.
Lemma 3.6 (Projection and sensitivity). For a block of size , the weights in Equation (2) satisfy
where and is chosen so that the weights sum to one. For fixed functions and , the weighted prediction computed from scores has global sensitivity at most .
Proof. The sum of the weights in Equation (14) is continuous and non-decreasing in , with limits zero and eight, so there exists for which the weights sum to one. To prove that these weights solve Equation (2), let be any vector satisfying the constraints of that maximization, i.e., and . We will show that the objective at is at least its value at . To verify that these weights maximize the objective
observe that its partial derivative with respect to is . For the weights in Equation (14), this derivative equals when , is at most when , and is at least when . A feasible satisfies when and when . Thus
where the equality uses that both and sum to one. Expanding gives
Hence every feasible has objective value at most that of . Thus the weights given by Equation (14) solve the maximization in Equation (2).
Now replace sample . Let denote the original and recomputed weights, with respective normalizing shifts . For every , the score is unchanged, so the formula for differs from that for only by replacing with . Since clipping is non-decreasing, the weights with all move in the same direction. Their total gain or loss must be balanced by the change in weight at coordinate , because both weight vectors sum to one. Thus
Since query values lie in , the combined contribution of these unchanged samples changes by at most . Finally, at coordinate , both the old and new weighted query values lie in , so their difference has magnitude at most . Adding these two bounds, it follows that the global sensitivity is at most .
We remark that for any fixed history, the current query and each score function are fixed. Thus Lemma 3.6 gives sensitivity at most for each block and the same bound holds for the uniform anchor, with sensitivity at most .
Privacy of releases and threshold phases. It is well-known that the Laplace mechanism, i.e., adding noise to a function with global sensitivity is -private, c.f., Lemma 2.4. Clipping and rounding preserve this guarantee by post-processing of differential privacy, c.f., Lemma 2.5.
A phase on edge begins when its threshold noise is drawn. During the phase, every signed test for on that edge reuses and draws fresh noise ; these tests may span multiple queries. The phase ends at the first test that triggers a correction or when the execution ends. Refreshing after a correction starts a new phase. Each phase is therefore an instance of ABOVETHRESHOLD. Holding the other blocks fixed, a phase on an edge incident to block is therefore -private with respect to that block [DR14, Theorem 3.23]. This guarantee allows adaptively chosen test functions and termination without a successful test.
For privacy composition, we count each noisy answer as one application of the Laplace mechanism and each phase as one application of ABOVETHRESHOLD. Each edge starts one phase initially and another after each correction, except that reaching a correction limit stops the execution before the threshold is refreshed. Thus edge uses at most phases. Counting the phases on edges incident to each block and, for block 1, the at most noisy query answers, the number of private components accessing each block is at most
Choose failure probability , a logarithmic term to account for advanced composition, and noise parameter . Choose integer block sizes
with sufficiently large constants so that . The first term ensures privacy; the second supplies enough samples for Lemma 3.1.
Theorem 3.7 (Privacy and the hypotheses for progress). With these parameter choices, the auxiliary transcript is -private with respect to replacing one sample in , for every . Then the hypotheses of Proposition 3.2 hold, so .
Proof. Fix a block and assign independent randomness to all potential phases and numerical releases in advance. Fix the other sample blocks, the analyst's independent randomness, and the randomness of components that do not directly access . All this information is independent of . Observe that any fixed history determines every other block's weighted query estimate. Thus the choice of component and its input function uses only previous outputs and this fixed information.
Now, there are at most components accessing , each -private. A phase may remain active while other components produce outputs, so we use concurrent composition [VW21, Corollary 1.11], which permits the usual composition bounds for pure differential privacy even when the interactions are interleaved. The sharpened advanced composition bound [BS16] gives -privacy because
The inequalities follow from the choice of , , and . Averaging over the fixed information preserves this guarantee by closure under data-independent mixtures, c.f., Lemma 2.5.
It remains to verify the sample-size and noise assumptions of Proposition 3.2. Our choice of satisfies , so
Thus Lemma 3.1 applies with accuracy and failure probability .
Each time the mechanism begins checking from edge 1, it is either starting a query or restarting after a correction. There are at most queries and corrections, so this happens at most times. Before the next correction or the end of the query, it checks at most edges, with at most two signed tests per edge. Thus the comparisons use at most draws of test noise. There are also at most threshold draws and at most draws for the noise added to query answers. Thus the total number of noise draws is at most . Every fresh draw has scale at most , so its probability of exceeding in magnitude is at most . By the setting of and a union bound, the conditional probability that any noise draw has magnitude greater than is at most . Hence all hypotheses of Proposition 3.2 hold.
Combining this theorem with Propositions 3.4 and 3.5 gives the correction and accuracy guarantees for the original mechanism with probability at least .
3.4 Putting privacy, progress, and accuracy together
We combine privacy of the auxiliary mechanism with the progress and accuracy bounds to obtain the following guarantee for the original mechanism.
Theorem 3.8 (Accurate answers to adaptive queries). For any accuracy parameter and failure probability , there exists a randomized mechanism using independent samples from any unknown distribution on a finite domain . Against any adaptive analyst submitting queries , with probability at least , the mechanism returns all answers satisfying
Proof. Consider the mechanism in Algorithms 1 and 2, with the hierarchy and parameter choices specified above. By Theorem 3.7, the auxiliary mechanism satisfies . Run the auxiliary and original mechanisms with the same samples and random choices. Their executions agree until a correction limit is reached. Conditioned on the event , no limit is reached by Proposition 3.4, so their executions agree throughout all queries. Thus Propositions 3.4 and 3.5 give the claimed termination, accuracy, and correction bounds for the original mechanism.
For the sample complexity, summing the choices of in Theorem 3.7 gives
where the second equality uses .
We remark that up to logarithmic factors, the term comes from composing privacy over the noisy query answers, while the term supplies enough samples for accurate reference weights and the weight corrections. In particular, when , the sample complexity is .
We also observe that for storage, each learned block maintains one score and one weight per sample. Recomputing its weights requires at most additional scalars. The remaining state consists of the threshold noise for each edge, the current indices, and the current answer. Neither reference vectors nor previous queries need to be stored. This gives the total bound of stored scalars, where N is defined in the proof of Theorem 3.8.
As a corollary, we note that the randomized ADA mechanism can also be used to perform the following conditional release task: for an interval request at time , the analyst provides a statistical query and an interval , where may vary with and depend on previous responses. The mechanism privately tests whether the population mean of lies in this interval, up to additive error , and returns Accept, High, or Low. Additionally, after a High or Low response, the analyst may request a value approximating to additive error , provided that the mechanism has not halted.
Corollary 3.9 (Adaptive conditional release). Fix an accuracy parameter , a failure probability , and integer budgets and . Suppose an adaptive analyst submits at most requests in total for queries , where each request is either an interval request for adaptively chosen or a numerical request (at most such requests). There exists a randomized mechanism using independent samples from any unknown distribution on a finite domain that answers an interval request with Accept, High, or Low, answers a numerical request with a value , and halts immediately after the -th High or Low answer. With probability at least , all answers issued by the mechanism simultaneously satisfy the following:
(1) If the mechanism returns Accept, then .
(2) If the mechanism returns High, then .
(3) If the mechanism returns Low, then .
(4) All answers satisfy .
The main point is that interval requests can be handled using a standard ABOVETHRESHOLD mechanism, allowing arbitrarily many Accept responses in a single phase and refreshing the threshold noise only after a High or Low response. Thus, the additional privacy composition involves at most threshold phases and numerical releases, rather than the total number of requests. The mechanism's hierarchical structure remains unchanged, and ensuring accuracy simultaneously over all requests only incurs logarithmic overheads. This explains the term in the sample complexity, with the term supplying the samples needed for the reference weights and internal corrections, as before.
4 Robust Algorithm
In this section, we describe our adversarially robust estimation algorithm for insertion-deletion streams, which crucially relies on the improved ADA sample complexity shown in the previous section. Recall that in the classical streaming model, it is known that estimating the moment up to -multiplicative error requires bits of space [KNW10]. As our algorithm uses only bits of space throughout the stream of length , this shows that there is essentially no separation in the space complexity of estimation in the oblivious and adaptive settings, up to polylog() factors.
4.1 Overview of [GLW+26b]
Before we present our optimal algorithm, we briefly give an overview of the techniques developed in [GLW+26b], which designed a space adversarially robust algorithm in the turnstile setting. Suppose that is the frequency vector, and the algorithm maintains and for independent sketches . Additionally, the algorithm maintains sketch in the background. The algorithm is centered around three components:
(1) The estimator computes an approximation of via , where is the current iterate. Notably, the first term is estimated using and is estimated using sketch .
(2) The corrector maintains sketch , and before the estimator releases an approximation of , the algorithm checks that the estimator's value is within . If the estimator is inaccurate, the corrector releases an estimate of using and flags the estimator as inaccurate.
(3) The learner maintains an iterate , which is initialized as . If the corrector flags the current estimate as inaccurate, the learner updates the current and passes the updated iterate to the estimator.
We emphasize that all vectors are only accessible in the sketch space. In fact, [GLW+26b] gave a strategy to update so that each time the estimator is not accurate, the squared distance between and the new iterate decreases by a factor of : if is updated to , we have . Since , this implies that will be used to flag the estimator as inaccurate and subsequently to release a new estimate at most times throughout the stream. To limit the adaptive interactions of the adversary with each sketch and , the key insight is that estimating is a task of precisely the same form as the original problem. Thus, the algorithm recursively computes by subdividing and using the estimator , where each term is estimated using an independent sketch for .
More generally, the algorithm maintains a -ary recursive tree of height over the stream of length , such that there is only a single active block in each level of the tree at a given time. Each block has child blocks and uses an independent sketch to maintain intermediate vectors and compute estimates. Importantly, note that the recursive computation of is only well-defined for a fixed iterate of the parent block. To handle this, the algorithm of [GLW+26b] initializes a new block each time that the iterate of the parent block changes, or child blocks have passed, so that . At a high-level, this means that each corrector sketch (and estimator sketch) must handle adaptive updates. Then, by applying the differential-privacy robustification framework of [HKM+20], it follows that the sketch in each block uses
bits of memory. As the full algorithm stores sketches at any given time, it follows that the total space is bits overall.
Toward an optimal space algorithm. To improve the robust algorithm described above, we first present an alternate recursive algorithm which allows us to maintain a binary tree; namely, unlike the previous algorithm, we do not need to initialize a new block each time that the parent block's iterate changes. This means that by setting and applying the robustification framework of [HKM+20] to ensure that each sketch can handle adaptive queries, this modified recursive algorithm already yields an improved space adversarially robust algorithm. To obtain the final space algorithm, observe that it suffices to devise a mechanism that, given a linear sketch with rows, maintains and can be used to output estimates for adaptive queries. To this end, we use our new mechanism for adaptive data analysis to circumvent the dependence incurred by the naive DP-robustification, and obtain an algorithm with the optimal dependence on the accuracy.
The following subsections are organized as follows. In Section 4.2, we describe a linear sketch for estimation which answers adaptive queries using rows. This subroutine will be used within each block of the recursive hierarchy described above. Then, in Section 4.3 we present the full algorithm under adaptive insertions and deletions by combining this subroutine with a modified recursion, which maintains a binary tree of sketches over the stream.
4.2 Optimal Linear Sketch for Adaptive Queries
We now establish the existence of a linear sketch which uses rows and outputs a -approximation to the moment for adaptive queries. First, we recall the classical AMS sketch of [AMS99] which provides a -approximation to the moment in the classical streaming setting.
Theorem 4.1 (AMS Algorithm for estimation [AMS99]). Let be an accuracy parameter and be a failure probability. Let . There exists a turnstile streaming algorithm that maintains a linear sketch , where is drawn from an explicit distribution over random matrices, uses bits of space, and with probability , outputs a -approximation to the moment on streams of length . Specifically, each entry is drawn from a s-wise independent distribution for , and the space overhead is multiplied by .
For the final estimator, the algorithm needs to draw entries such that signs are 2s-wise independent, where . In the following lemma, we give the precise moment bounds for this variant of the AMS sketch with limited-independence.
Lemma 4.2. Let be an integer, and let be 2s-wise independent uniform random signs. For any fixed vector , define
Then
Proof. Expanding the 2s-th moment gives
For each tuple , let denote the number of occurrences of index . Since , we have
By 2s-wise independence and the fact that each sign has mean zero,
Therefore,
We bound this sum by counting pairings. A pairing of [2s] is a partition of its elements into s unordered pairs. The number of such pairings is
Every tuple appearing in (17) is compatible with at least one pairing: since each index occurs an even number of times, its occurrences can be paired among themselves.
Fix a pairing . Summing over all tuples whose indices agree within each pair gives
Every summand in (17) is nonnegative, because all indices occur with even multiplicity. Thus summing over all pairings can only overcount the surviving terms. It follows that
□
Adaptive query model. We consider the adaptive query model for linear sketching, defined as follows.
(1) At each time , the adversary selects a query vector , which may depend on the sequence of previous queries and previous outputs of the sketch .
(2) The sketching algorithm observes and returns an estimate for .
We remark that an algorithm for the adaptive query model can be implemented in the streaming model by feeding turnstile updates defining an adaptive query to the algorithm sequentially, under the promise that the sketch will output an estimate at most times throughout the stream.
In fact, our algorithm for answering adaptive estimation queries using a linear sketch crucially relies on our improved adaptive data analysis mechanism for statistical queries, as described in the previous section. Concretely, suppose is initialized as an independent AMS sketch with 2s-wise independent signs using Theorem 4.1. Then, for a given query vector , the standard AMS algorithm computes
While this resembles a statistical query, the main issue is that is not necessarily in the interval . To handle this, we initialize independent AMS sketches with rows for each , such that with probability . Then, we define the -th statistical query by normalizing,
where . For the case that we define . The final algorithm is summarized below.
Algorithm:
(1) Initialize a 2s-wise independent AMS sketch with rows, with accuracy parameter for , and failure probability . For each , let be a 4-wise independent AMS sketch with rows.
(2) Initialize an instance of the ADA mechanism, with sample of rows of , where .
(3) For each query vector for
-
Compute estimate . Let be the capped query.
-
Feed query to for and obtain estimate .
-
Return .
Fig. 1: Adversarially robust sketch for queries.
Algorithm analysis. We now verify the correctness guarantees of our sketch.
Lemma 4.3. For any , let be the estimate produced by sketch , for each . Then, the query satisfies
and
where each entry of is drawn from a 2s-wise independent distribution over .
Proof. Let where , where each entry is 2s-wise independent. Conditioned on the correctness of sketch , we have that , so by Lemma 4.2 we have
Note that , so it follows that the difference overall. Moreover, note that the difference between and satisfies
for each input, so the claim follows.
Observation 4.4. For each , represents a valid adaptive statistical query to the ADA mechanism , and with high probability,
In particular, note that at each time , the linear sketch observes sketches and (where is adaptively chosen), and forms the statistical query , which is fed to the ADA mechanism.
Lemma 4.5 (Adversarially robust sketch). Let . There is an estimator in the adaptive query model such that, for every simultaneously, with probability at least , the estimator's outputs satisfies
The sketch matrix has most rows.
Proof. We first show the accuracy guarantee of our algorithm. Conditioned on the correctness of the and sketches for all , and recalling that , it follows that
As the independent sketches provide a 2-approximation to the squared norm with probability , by a union bound it follows that all sketches provide accurate estimates with probability . Additionally, the ADA mechanism outputs all answers satisfying with probability , so the overall sketch is -approximate at all times with probability at least .
Next, we consider the space complexity of the algorithm. Recall that and . The algorithm maintains sketches for , each of which uses bits of space. Also by construction and Theorem 3.8, has rows which are generated by a 2s-wise independent hash function, so the total space is
bits of memory for storing and all sketches for , and the claimed space complexity follows.
Remark 4.6. The adaptive conditional release task in Corollary 3.9 with m queries, R numerical requests, and R High or Low outputs can be solved using a linear sketch and estimator with rows. Concretely, the algorithm stores 2-approximation sketches for which are used to determine the scale of the estimate, and a new sketch is used once has been used during a High or Low outcome followed by a numerical release.
4.3 An Improved Recursive Algorithm
We now present our modified recursive algorithm for moment estimation which enables the final nearly-optimal space complexity. In order to reduce the dependence on in the prior robust algorithm [GLW+26b], we must ensure that each sketch in the hierarchy only needs to serve as a corrector for child blocks. To this end, we reframe the estimator-corrector-learner framework to enable a binary tree of sketches over the stream.
Algorithm:
(1) Maintain a tree structure over the stream of length . The bottom level 1, each block contains a single update.
(2) Each new node in level is formed when two blocks in level have passed in the stream.
(3) For each block , use sketch matrix to sketch all necessary vectors, such as the frequency vector in the block and the iterate vectors, as required by the subroutines.
(4) Let be the height of the tree and let be a sketch matrix at the top.
(5) Output , where is the frequency vector for the stream.
Fig. 2: Adversarially robust norm estimation algorithm on insertion-deletion streams
Reformulated update rule. For now, let us focus on the following simplified setting: suppose the frequency vector is as before, and and are independent sketches via Lemma 4.5. Furthermore, suppose the algorithm maintains and , as well as an iterate (maintained using both and ) which approximates the prefix . Recall that the estimator computes
and the corrector sketch maintains an estimate of . Suppose the estimator is not accurate for the current suffix ; then, the learner updates to , which is defined by for step-size parameter , where the sign is given by . Let be the iterate initially, and let be the first suffix for which the estimator above is inaccurate. This implies
so the sketch will subsequently be used to sketch . Let denote this scalar factor at the -th update. Now, suppose that represents the vector of new updates received after the first flagged suffix ; as before, the new iterate is defined as
and the sketch will be updated to maintain . For defined as above, the sketch must compute . It follows that at the -th step, the input to sketch B can be expressed as
EstLevel and Maintainler subroutines. For the complete algorithm, we maintain a binary tree of sketches over the stream of length , such that a single block is active at each level of the tree at any given time. The subroutine then recursively computes an estimate of the current moment of its input substream by estimating using and computing recursively via . Before returning , the estimator compares its estimate to the value of the corrector sketch , and invokes if the estimate is not sufficiently accurate. Importantly, propagates the scalar multiplier to its child blocks but re-uses cached estimates for for , which are simply multiplied by when an estimate is requested from the lower levels. For instance, suppose that the child blocks partition this frequency vector such that the left child maintains and the right child maintains , where and is an independent sketch. Then, when the iterate is updated to in the parent node, we simply multiply the sketched values and by , and multiply the cached estimate of by . By factoring out the product from the sketched vector, we note that this multiplicative scaling does not interfere with the progress already made by the learner in the child node.
Algorithm 3 EstLevel(i, B_i z) for moment estimation
1: Let be the active block at level 2: Let be the sketch matrix for 3: -approximation for moment for via Lemma 4.5, robust to adaptive queries 4: Let be a -approximation to 5: if then 6: 7: is defined as , where contains all additional coordinate updates. 8: 9: else 10: 11: Let be the active part of the query in 12: 13: if then 14: return 15: else 16: 17: return
Bounded bit complexity. While the description above allows us to avoid restarting the estimator-learner-corrector framework at child sketches B and C each time that the parent node's iterate is
Algorithm 4 Maintainer(i) for moment estimation
1: Initialize at the beginning of the active block at level 2: 3: if then Implement interval check via Corollary 3.9 4: 5: Step-size is the minimizer of regularized optimization. 6: 7: Update all child blocks: re-use cached estimates for for and multiply by 8: return truncated to precision All operations performed in the sketch space
updated, it remains to ensure that the bit complexity of values stored by sketches can be bounded by polylog(). Naively, it may seem that the product may be as large as , requiring us to track bits of precision in each of the dimensions of the sketched vector. In the following, we show a way to modify our algorithm to enable storing just polylog() bits of precision, while still achieving the desired -multiplicative error.
Consider the vectors and sketched by and after the -th update to the iterate , and suppose and that for all . As before, let denote the maximum number of updates to the iterate. To overcome the precision issue described earlier, we instead imagine that before each query, the vectors sketched by and are extended to have a larger universe of size , and add to to obtain sketches of and , where is a previously unused index of the frequency vector and for some small enough ; we show that these modified frequency vectors admit a -bit representation. In the following analysis and algorithm description, we instead implement the above argument as solving a regularized optimization problem to compute the appropriate step-size in each step which (1) ensures that for all and , and (2) the learner makes sufficient progress toward .
Regularized optimization. Let be the prefix, be the -th iterate, and let be the vector containing -scaled coordinates. Then, the squared norm of the imaginary sketched vector is precisely . Now, suppose we insert a new -coordinate in an unused index in . For current suffix , the iterate is updated as . To compute the chosen step-size , we consider the objective
Lemma 4.7. Consider the minimization problem . The minimizer is given by
Proof. Note that
By viewing the above as a quadratic optimization with respect to , the unique minimizer is as claimed.
The remaining argument proceeds by induction: suppose that at all times , where . First, we will argue that the bit-complexity of various scalars maintained by the algorithm is bounded; Using this, we will then conclude that the learner's new update will shift the modified iterate closer to .
Lemma 4.8 (Bounded Products). Let be a uniform upper bound on the maximum possible value of , and let be the active block in level . Let denote the scalar multiplying all sketched vectors in the -th iterate vector in . Suppose that is satisfied at all times . Then, for each , we have .
Proof. Let be the iterate with the added -updates in previously unused coordinates (which will only be used at most once), and let . By assumption, it holds that at all update times . Since we inject a new coordinate in an unused index before each query, there is an added -coordinate that will be multiplied by , and we have
In particular, this implies that . By setting it follows that .
In the next few lemmas, we show the accuracy guarantees of our algorithm.
Lemma 4.9. Let be a fixed iterate in active block for . Suppose is computed using sketch , which is robust for adaptive updates. With high probability,
Proof. Recall that is an -approximation sketch for estimation designed via Lemma 4.5, which is equipped to answer adaptive queries. Also, recall that the input to is , where for added-coordinates . Since and produces a -approximation to the input, we have
as desired.
Lemma 4.10. Let be a fixed iterate in active block for . Suppose is computed using sketch , which is robust for adaptive updates, and is computed by recursively. With high probability,
Proof. We proceed by induction on the level . For , observe that and , so
where is the vector of added small coordinate values at level 1. Now, suppose by induction that the hypothesis holds for level , meaning produces an estimate of up to multiplicative error . In level , recall that we have
by Lemma 4.9, conditioned on the accuracy of sketches. By union bounding over all levels , the induction step follows.
As in the original robust algorithm [GLW+26b], our framework ensures that the following invariant holds throughout the execution of the algorithm, at each level .
Invariant 4.11. For level let denote the active block in level . Let be the part of the query which is tracked in and let be the prefix. Then, with high probability
Finally, we show that the total number of updates to the iterate is upper bounded by for . Specifically, we argue that the potential satisfies , thus completing the induction defined at the beginning of Lemma 4.8. Importantly, we note that the algorithm returns an estimate for by re-using the cached estimate for ; if the parent node's iterate is updated, this cached value is simply multiplied by scalars induced by the higher levels, thus ensuring that the progress at level does not re-start each time that the iterate at the parent node is updated.
Lemma 4.12 (Bounded Updates). Let be the active block at level , and let be the number of times that the iterate in is updated. With high probability, for for all over the entire stream of length .
Proof. Consider a fixed level , and let and represent the active blocks at levels and . Let be the vector of added coordinates at level . Conditioned on the accuracy guarantees of in Lemma 4.10, it holds that
Now, if the current iterate v is updated, it must be that
Recall that we add auxiliary tiny -coordinates with at each time , where is a uniform upper bound on the possible value of the at any time. This means that over the entire stream, the contribution of these extra coordinates will be at most , so the progress analysis is unaffected by these additional coordinates. Thus, we analyze the progress assuming that is the iterate vector without the new -valued coordinates which were added after the last update to . Now, recalling that contains added coordinates from before the last update (which appear in ), this means that
Suppose that ; as we show later, the other case is symmetric. By rearranging the inequality above, we have that
Finally, let denote the updated iterate which is defined as , for for any constant in the range . Observe that .
Thus, we have
Next, consider the remaining case when
By expanding the right side, we have that
and after combining terms, we see that
As before, let be the step-size with any constant in the range , and observe . Thus, it follows that
So, we have shown that the potential with extra coordinates drops by a multiplicative factor of . As initially, it follows that , as desired.
Theorem 4.13 (Robust Estimation). For any , there exists an adversarially robust insertion-deletion streaming algorithm on a stream of length that, with high probability, returns a -approximation of the at all times of the stream. For a frequency vector of universe size and stream length , the algorithm uses bits of space.
Proof. We show the robustness and space complexity guarantees of our algorithm separately.
Robustness. We first track the adaptive interactions of the adversary with the corrector sketch in each level . Consider the transcript of symbols , where denotes that no update is made to the iterate , while signals that the current estimator is not accurate; this outcome is followed by an update to and causes the corrector sketch to release its current estimate . Note that each adaptive query is precisely an interval query with interval . By Lemma 4.12, we know that the outcome occurs at most times over the course of the stream. As each corrector sketch is precisely the robust sketch from Lemma 4.5 for the adaptive query model which is accurate with probability , we know that by setting the number of rows to be and running the ADA mechanism in Algorithm 1, we know that the algorithm will return a robust -approximation to the adaptive queries (by Corollary 3.9 and Remark 4.6). Similarly, to track the adaptive interactions with the estimator sketch, we examine the outputs produced by ( is then handled by induction). At each time, the estimator produces an estimate of using the sketch . If is accurate, then the estimator releases the same value for ( ), otherwise the iterate is updated and in the next step a re-computed value of is released ( ). As the total number of times that is updated is , we again conclude that the sketch needs to be robust to only adaptive queries, and thus the robustness again follows from Corollary 3.9 and Remark 4.6 with interval queries .
Space and Bit Complexity. We next examine the total space complexity of the algorithm. To start, note that by the above, the total number of rows in each sketch is , and since , each sketch has
rows. At this point, it suffices for us to bound the bit-complexity of the vectors and scalars stored throughout each active block in level of the algorithm. To this end, consider the time frame that is active, and group the scalar multipliers according to which parent level induced them. For each parent level, we have that the product of the multipliers is bounded by by Lemma 4.8, thus the total scaling at level can be at most . As we set the height of the binary recursive tree to be , it follows that the total scaling is . We remark that the values at level are also lower-bounded by , as a fresh auxiliary coordinate is added at each time-step, and this is scaled by at least in the -th level of the tree.
We now argue that the rounding error is sufficient to obtain a -approximation at each level . Concretely, let denote the vector maintained by any sketch in the hierarchy after the -th time that the parent node updates its iterate. Recall that the algorithm maintains un-factored sketches of relevant vectors and rounds to -precision after each operation. Each sketched vector satisfies
where denotes the sketched vector containing new updates after the most recent rescaling by . Let denote the rounded vector, such that
Suppose the rounded version of the frequency vector incurs error per operation. It then follows that
where denotes the stream length. Thus, by setting , this ensures that the total rounding error is bounded by , which is negligible compared to the norms of integer-valued vectors. Note that we choose the constant in the exponent to be sufficiently large such that this error is bounded by , as needed for relative accuracy at each level. Since the unscaled vectors of underlying stream updates have coordinates bounded by , we have that the total bit-complexity for each sketch is .
Finally, since we store a single sketch at each level of the recursive tree of height , it follows that the algorithm uses at most bits of space overall, as desired.
5 Adaptive Data Analysis with Bounded Universe
The mechanism developed in Section 3 makes no assumption about the support of the underlying distribution on the overall population. In this section, we show that when the universe U is finite, we can achieve better sample complexity for adaptive data analysis. Whereas the previous approach attempted to learn an unknown but accurate reference weight, we instead attempt to learn the population distribution D itself.
To simplify intuition (at the cost of polylogarithmic factors in the sample complexity), we use Corollary 3.9 as a black-box corrector for an additional top level of the hierarchical estimator-corrector-learner framework. At this level, we maintain a set of weights to estimate the population distribution , with the prediction serving as the estimator's proposed release for the true answer . For each query , we ask the corrector to check the prediction against a reasonably accurate estimate of . Following the same pattern as in Section 3, we release the prediction if accepted. Otherwise, we obtain a numerical answer from the corrector and use its correction sign to update by multiplicative weights, which is an entropy-regularized analogue of the preceding learner, with progress measured by the KL divergence between and the true distribution ,
Relative entropy is useful here because initializing uniformly gives for every population distribution , even if is highly concentrated. The main benefit is that the number of corrections can be much smaller than the number of queries. Namely, we show that each correction decreases this potential by , and thus the learner makes at most corrections. The bounds then follow immediately by plugging in in the statement of Corollary 3.9.
Finite-universe ADA mechanism
Initialize to the uniform distribution on . For each query :
(1) Compute and submit the interval request
to , an instance of Corollary 3.9 with the parameters above.
(2) If the response is Accept, output and proceed to the next query.
(3) Otherwise, set for High and for Low, and update
(4) If has halted, answer the current and all remaining queries with zero, making no further requests. Otherwise, request a numerical answer for from and output .
Fig. 3: Mechanism for adaptive data analysis on bounded universe.
Parameters and mechanism. Fix accuracy parameter , failure probability , and a query budget . For , we set parameters
where is the required accuracy from a single instance of the mechanism in Corollary 3.9 and represents an upper bound on the number of corrections the mechanism will ultimately need. Let be an instance Corollary 3.9 with accuracy , failure probability , and budgets , , and , i.e., it will undergo at most interactions, and it will both correct and subsequently release a numerical value at most times. Hence, will halt after the -th response of High or Low.
Corrector guarantees. All access to the samples occurs through the same instance , which is never restarted. On every execution, the mechanism makes at most interval requests and numerical requests, hence at most requests in total. Indeed, a numerical request follows a High or Low response only if has not halted. Each request to is determined by the previous responses, which does not have direct access to the samples (even though the responses are not independent of the samples). Thus, the request budgets and adaptivity assumptions of Corollary 3.9 are satisfied.
Progress of the learner. The distribution has full support throughout the interaction, since it is initialized to the uniform distribution, and after each subsequent multiplicative-weights update, all weights still have positive values. Hence, remains finite. Thus, by non-negativity of relative entropy and the fact that is the uniform distribution, we have
We remark that as in Section 3, the potential is used only in the analysis, as the mechanism does not have access to either or .
Lemma 5.1 (Progress of a correction). Let denote the event that all responses issued by , including any stopping response, satisfy the guarantees of Corollary 3.9, so that . Conditioned on , every update in Figure 3 decreases by at least .
Proof. Let and be the query and correction sign, and let be the distributions before and after the update, respectively. Conditioning on the event , the High and Low guarantees imply either or , respectively. In either case,
Write . Recalling that and expanding the potential, we have
To bound the normalization term, set and define and . Differentiating the finite sums expresses the first and second derivatives as a mean and variance under :
At , we have , so and . Moreover, the variance is at most the expected squared distance from the midpoint . Since ,
Then integrating this curvature bound twice gives
Consequently,
as desired.
We now use Lemma 5.1 to bound the number of corrections and obtain the sample complexity from Corollary 3.9.
Theorem 5.2 (Adaptive data analysis on a bounded universe). Let be a known finite nonempty universe, and fix accuracy parameter , failure probability , and an integer query budget . For every distribution on , the mechanism in Figure 3 answers adaptively chosen queries to additive error , simultaneously with probability at least , with sample complexity
Proof. Condition on the event . We first show that never reaches its stopping limit. Since the initial potential is at most , Lemma 5.1 implies that after any corrections,
This bound also applies to a correction that causes to halt, since the corresponding update to is performed before checking whether has halted.
Suppose that issues responses of High or Low. If , this is impossible because there are at most interval requests. Otherwise, , so setting in the preceding inequality gives
which is a contradiction. Thus, does not halt on , and the mechanism answers all queries without using the zero-answer fallback.
We next analyze the accuracy of the outputs of the mechanism. If a prediction is accepted, the interval guarantee gives
Otherwise, the output has error at most . Clipping to cannot increase its distance from , so the released answer also has error at most . Since , all answers are simultaneously accurate with probability at least .
Finally, all samples are used by the single instance . Applying Corollary 3.9 with the chosen parameters gives a total sample complexity of
where we used and . If , then , which gives the claimed bound. For , the assumption gives , which then gives the desired sample complexity bounds after substituting back into .
6 AI Methodology
We used ChatGPT Sol 6.1, Astra as part of our research: this materially affected the ideas and algorithms in Section 3 and Section 5. The improved recursive algorithm for was developed solely by the authors, and the authors had previously identified that an improved ADA mechanism would enable obtaining nearly-optimal bounds for . No AI-generated text appears in the paper, as authors formulated and wrote all mathematical statements and proofs themselves. The authors take full responsibility for all content in this work.
All results in this paper were independently proved with an end-to-end Gemini 4 harness [LWD+26]. See https://github.com/samsonzhou/ada-stream for the full paper and Lean verification of the main results.
References
[AC24] Sara Ahmadian and Edith Cohen. Unmasking vulnerabilities: Cardinality sketches under adaptive inputs, 2024. 2
[ACS25] Sara Ahmadian, Edith Cohen, and Uri Stemmer. The cost of compression: Tight quadratic black-box attacks on sketches for norm estimation, 2025. 2, 5
[AEIK18] Anish Athalye, Logan Engstrom, Andrew Ilyas, and Kevin Kwok. Synthesizing robust adversarial examples. In Proceedings of the 35th International Conference on Machine Learning, ICML, pages 284–293, 2018. 1
[AGMS99] Noga Alon, Phillip B. Gibbons, Yossi Matias, and Mario Szegedy. Tracking join and self-join sizes in limited storage. In Proceedings of the Eighteenth ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, PODS '99, page 10–20, New York, NY, USA, 1999. Association for Computing Machinery. 3
[AMS99] Noga Alon, Yossi Matias, and Mario Szegedy. The space complexity of approximating the frequency moments. J. Comput. Syst. Sci., 58(1):137–147, 1999. 2, 3, 9, 29
[AvdB24] Anastasiia Alokhina and Jan van den Brand. Fully dynamic shortest path reporting against an adaptive adversary. In Proceedings of the 2024 ACM-SIAM Symposium on Discrete Algorithms, SODA, pages 3027–3039, 2024. 1
[AY26] Sepehr Assadi and Helia Yazdanyar. Fully dynamic algorithms for coloring triangle-free graphs, 2026. 1
[BEO22] Omri Ben-Eliezer, Talya Eden, and Krzysztof Onak. Adversarially robust streaming via dense-sparse trade-offs. In 5th Symposium on Simplicity in Algorithms, SOSA@SODA, pages 214–227, 2022. 2
[BF16] Raef Bassily and Yoav Freund. Typical stability, 2016. 4
[BJWY22] Omri Ben-Eliezer, Rajesh Jayaram, David P. Woodruff, and Eylon Yogev. A framework for adversarially robust streaming algorithms. J. ACM, 69(2):17:1–17:33, 2022. 1, 2
[BNS+16] Raef Bassily, Kobbi Nissim, Adam D. Smith, Thomas Steinke, Uri Stemmer, and Jonathan R. Ullman. Algorithmic stability for adaptive data analysis. In Proceedings of the 48th Annual ACM SIGACT Symposium on Theory of Computing, STOC, pages 1046–1059, 2016. 4
[BNS+21] Raef Bassily, Kobbi Nissim, Adam D. Smith, Thomas Steinke, Uri Stemmer, and Jonathan R. Ullman. Algorithmic stability for adaptive data analysis. SIAM J. Comput., 50(3), 2021. 4, 5
[BS16] Mark Bun and Thomas Steinke. Concentrated differential privacy: Simplifications, extensions, and lower bounds. In Theory of Cryptography - 14th International Conference, TCC 2016-B, Proceedings, Part I, pages 635–658, 2016. 13, 25
[BvdBG 22] Aaron Bernstein, Jan van den Brand, Maximilian Probst Gutenberg, Danupon Nanongkai, Thatchaphol Saranurak, Aaron Sidford, and He Sun. Fully-dynamic graph sparsifiers against an adaptive adversary. In 49th International Colloquium on Automata, Languages, and Programming, ICALP, pages 20:1–20:20, 2022. 1
[BZ25] Mark Braverman and Or Zamir. Optimality of frequency moment estimation. In Proceedings of the 57th Annual ACM Symposium on Theory of Computing, STOC, pages 360–370, 2025. 3
[CGNS26] Edith Cohen, Elena Gribelyuk, Jelani Nelson, and Uri Stemmer. Adaptively robust resettable streaming. CoRR, abs/2601.21989, 2026. 1
[CGS22] Amit Chakrabarti, Prantar Ghosh, and Manuel Stoeckl. Adversarially robust coloring for graph streams. In 13th Innovations in Theoretical Computer Science Conference, ITCS, pages 37:1–37:23, 2022. 1, 2
[CN20] Yeshwanth Cherapanamjeri and Jelani Nelson. On adaptive distance estimation. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems, NeurIPS, 2020. 1
[CNS 24] Edith Cohen, Jelani Nelson, Tamás Sarlós, Mihir Singhal, and Uri Stemmer. One attack to rule them all: Tight quadratic bounds for adaptive queries on cardinality sketches. CoRR, abs/2411.06370, 2024. 2
[CNSS23] Edith Cohen, Jelani Nelson, Tamás Sarlós, and Uri Stemmer. Tricking the hashing trick: A tight lower bound on the robustness of countsketch to adaptive inputs. In Thirty-Seventh AAAI Conference on Artificial Intelligence, AAAI, pages 7235–7243, 2023. 1, 2
[CS26] Edith Cohen and Uri Stemmer. No escape from the quadratic barrier: Adaptive attacks on linear sketches, 2026. 5
[DFH 15a] Cynthia Dwork, Vitaly Feldman, Moritz Hardt, Toniann Pitassi, Omer Reingold, and Aaron Roth. Generalization in adaptive data analysis and holdout reuse. In Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems, pages 2350–2358, 2015. 1
[DFH 15b] Cynthia Dwork, Vitaly Feldman, Moritz Hardt, Toniann Pitassi, Omer Reingold, and Aaron Leon Roth. Preserving statistical validity in adaptive data analysis. In Proceedings of the Forty-Seventh Annual ACM on Symposium on Theory of Computing, STOC, pages 117–126, 2015. 1, 3, 4
[DP20] Damien Desfontaines and Balázs Pejó. Sok: Differential privacies. Proc. Priv. Enhancing Technol., 2020(2):288–313, 2020. 12
[DR14] Cynthia Dwork and Aaron Roth. The algorithmic foundations of differential privacy. Found. Trends Theor. Comput. Sci., 9(3-4):211–407, 2014. 12, 13, 24
[DSWZ23] Itai Dinur, Uri Stemmer, David P. Woodruff, and Samson Zhou. On differential privacy and adaptive data analysis with bounded space. In Advances in Cryptology - EUROCRYPT 2023 - 42nd Annual International Conference on the Theory and Applications of Cryptographic Techniques, Proceedings, Part III, pages 35–65, 2023. 1
[FS18] Vitaly Feldman and Thomas Steinke. Calibrating noise to variance in adaptive data analysis. In Conference On Learning Theory, COLT, pages 535–544, 2018. 4
[GL16] Andrew Gelman and Eric Loken. The statistical crisis in science. The best writing on mathematics (Pitici M, ed), 102:305–318, 2016. 3
[GLW+24] Elena Gribelyuk, Honghao Lin, David P. Woodruff, Huacheng Yu, and Samson Zhou. A strong separation for adversarially robust estimation for linear sketches. In 65th IEEE Annual Symposium on Foundations of Computer Science, FOCS, pages 2318–2343, 2024. 2
[GLW+25] Elena Gribelyuk, Honghao Lin, David P. Woodruff, Huacheng Yu, and Samson Zhou. Lifting linear sketches: Optimal bounds and adversarial robustness. In Proceedings of the 57th Annual ACM Symposium on Theory of Computing, STOC, pages 395–406, 2025. 2
[GLW+26a] Elena Gribelyuk, Honghao Lin, David P. Woodruff, Huacheng Yu, and Samson Zhou. Adversarial robustness for small frequency moments and a weak equivalence theorem for turnstile streams, 2026. 2
[GLW+26b] Elena Gribelyuk, Honghao Lin, David P. Woodruff, Huacheng Yu, and Samson Zhou. Adversarial robustness on insertion-deletion streams. In Proceedings of the 58th Annual ACM Symposium on Theory of Computing, STOC, 2026. 2, 3, 5, 10, 11, 27, 28, 33, 37
[GSS15] Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In 3rd International Conference on Learning Representations, ICLR, Conference Track Proceedings, 2015. 1
[HKM+20] Avinatan Hassidim, Haim Kaplan, Yishay Mansour, Yossi Matias, and Uri Stemmer. Adversarially robust streaming algorithms via differential privacy. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems, NeurIPS, 2020. 1, 2, 11, 28
[HPG+17] Sandy H. Huang, Nicolas Papernot, Ian J. Goodfellow, Yan Duan, and Pieter Abbeel. Adversarial attacks on neural network policies. In 5th International Conference on Learning Representations, ICLR, Workshop Track Proceedings, 2017. 1
[HR10] Moritz Hardt and Guy N. Rothblum. A multiplicative weights mechanism for privacy-preserving data analysis. In 51st Annual IEEE Symposium on Foundations of Computer Science, FOCS, pages 61–70, 2010. 4
[HU14] Moritz Hardt and Jonathan R. Ullman. Preventing false discovery in interactive data analysis is hard. In 55th IEEE Annual Symposium on Foundations of Computer Science, FOCS, pages 454–463, 2014. 1, 2, 3, 4
[HW13] Moritz Hardt and David P. Woodruff. How robust are linear sketches to adaptive inputs? In Symposium on Theory of Computing Conference, STOC, pages 121–130, 2013. 2
[IW03] P. Indyk and D. Woodruff. Tight lower bounds for the distinct elements problem. In 44th Annual IEEE Symposium on Foundations of Computer Science, 2003. Proceedings., pages 283–288, 2003. 3
[JLY26] Cheng Jiang, Yinchen Liu, and Huacheng Yu. Turnstile streaming algorithms might (still) as well be linear sketches, for polynomial-length streams, April 2026. 2
[KMNS21] Haim Kaplan, Yishay Mansour, Kobbi Nissim, and Uri Stemmer. Separating adaptive streaming from oblivious streaming using the bounded storage model. In Advances in Cryptology - CRYPTO 2021 - 41st Annual International Cryptology Conference, CRYPTO, Proceedings, Part III, pages 94–121, 2021. 1, 2
[KNW10] Daniel M. Kane, Jelani Nelson, and David P. Woodruff. On the exact space complexity of sketching and streaming small norms. In Proceedings of the Twenty-First Annual ACM-SIAM Symposium on Discrete Algorithms, SODA, pages 1161–1178, 2010. 2, 3, 27
[KSZC03] Balachander Krishnamurthy, Subhabrata Sen, Yin Zhang, and Yan Chen. Sketch-based change detection: methods, evaluation, and applications. In Proceedings of the 3rd ACM SIGCOMM Conference on Internet Measurement, IMC '03, page 234–247, New York, NY, USA, 2003. Association for Computing Machinery. 3
[LNW14] Yi Li, Huy L. Nguyen, and David P. Woodruff. Turnstile streaming algorithms might as well be linear sketches. In Symposium on Theory of Computing, STOC, pages 174–183, 2014. 2
[LSW+25] Honghao Lin, Zhao Song, David P. Woodruff, Shenghao Xie, and Samson Zhou. sampling in distributed data streams with applications to adversarial robustness, 2025. 1
[LT25] Xin Lyu and Kunal Talwar. Fingerprinting codes meet geometry: Improved lower bounds for private query release and adaptive data analysis. In Proceedings of the 57th Annual ACM Symposium on Theory of Computing, STOC '25, page 2374–2385, New York, NY, USA, 2025. Association for Computing Machinery. 4
[LWD+26] Honghao Lin, David P. Woodruff, Yuan Deng, Jieming Mao, Song Zuo, and Vahab Mirrokni. Stellar colosseum: A many-agent harness for long-horizon research in mathematics and theoretical computer science, 2026. 43
[NST23] Kobbi Nissim, Uri Stemmer, and Eliad Tsfadia. Adaptive data analysis in a balanced adversarial model. In Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems, NeurIPS, 2023. 4
[RCS26] Emma Rapoport, Edith Cohen, and Uri Stemmer. Tight bounds for answering adaptively chosen concentrated queries. In Proceedings of the 39th International
Conference on Neural Information Processing Systems, NIPS '25, Red Hook, NY, USA, 2026. Curran Associates Inc. 4
[Ste16] Thomas Alexander Steinke. Upper and Lower Bounds for Privacy and Adaptivity in Algorithmic Data Analysis. Doctoral dissertation, Harvard University, 2016. 4
[SU15] Thomas Steinke and Jonathan R. Ullman. Interactive fingerprinting codes and the hardness of preventing false discovery. In Proceedings of The 28th Conference on Learning Theory, COLT, pages 1588–1628, 2015. 1, 2, 3, 4
[VW21] Salil P. Vadhan and Tianhao Wang. Concurrent composition of differential privacy. In Theory of Cryptography - 19th International Conference, TCC, Proceedings, Part II, pages 582–604, 2021. 13, 25
[Waj20] David Wajc. Rounding dynamic matchings against an adaptive adversary. In Proceedings of the 52nd Annual ACM SIGACT Symposium on Theory of Computing, STOC, pages 194–207, 2020. 1
[Woo04] David Woodruff. Optimal space lower bounds for all frequency moments. In Proceedings of the Fifteenth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA '04, page 167–175, USA, 2004. Society for Industrial and Applied Mathematics. 3
[WZ21] David P. Woodruff and Samson Zhou. Tight bounds for adversarially robust streams and sliding windows via difference estimators. In 62nd IEEE Annual Symposium on Foundations of Computer Science, FOCS, pages 1183–1196, 2021. 2, 3