arXiv:2611.08699cs.DSNov 2026

Manuscript Offprint

arXiv:2611.08699

Adaptive Data Analysis and Adversarial Robustness on Insertion-Deletion Streams

Elena Gribelyuk, Honghao Lin, Xin Lyu, Mahbod Majid, David P. Woodruff, Huacheng Yu, Samson Zhou

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 kk adaptively chosen statistical queries to within additive error α\alpha using O~(kα+1α2)\tilde{\mathcal{O}}(\frac{\sqrt{k}}{\alpha} + \frac{1}{\alpha^2}) samples, nearly matching the lower bounds of Hardt and Ullman [FOCS 2014] and Steinke and Ullman [COLT 2015] while improving upon the classic O~(kα2)\tilde{\mathcal{O}}(\frac{\sqrt{k}}{\alpha^2}) bound of Dwork et al. [STOC 2015] and Bassily et al. [STOC 2016]. For known finite domains U\mathcal{U}, we combine our mechanism with private multiplicative weights to improve the sample complexity to O~(1α2+min⁡(kα,log⁡∣U∣α2))\tilde{\mathcal{O}}\left(\frac{1}{\alpha^2} + \min\left(\frac{\sqrt{k}}{\alpha}, \frac{\sqrt{\log |U|}}{\alpha^2}\right)\right). Building on our ADA mechanism, we construct a fixed linear sketch with a stateful decoder that answers O~(1ε2)\tilde{\mathcal{O}}(\frac{1}{\varepsilon^2}) adaptive F2F_2 moment estimation queries to within a (1±ε)(1 \pm \varepsilon)-multiplicative factor using O~(1ε2)\tilde{\mathcal{O}}(\frac{1}{\varepsilon^2}) 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 F2F_2 estimation on insertion-deletion streams. Our algorithm uses 1ε2⋅polylog(n)\frac{1}{\varepsilon^2} \cdot \text{polylog}(n) bits of space, improving upon the O~(1ε4)\tilde{\mathcal{O}}(\frac{1}{\varepsilon^4}) 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 ε\varepsilon 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 nn and stream length mm. 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 ftf_t 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 mm updates ut=(at,Δt)u_t = (a_t, \Delta_t) to the frequency vector x∈Zn\mathbf{x} \in \mathbb{Z}^n, where at∈[n]a_t \in [n] is an index and ∣Δt∣≤poly(n)|\Delta_t| \leq \text{poly}(n) denotes the increment or decrement to index ata_t. The update sequence induces an intermediate frequency vector x(t)\mathbf{x}^{(t)}, where each entry is given by xi(t)=∑s≤t:as=iΔs\mathbf{x}_i^{(t)} = \sum_{s \leq t: a_s = i} \Delta_s. Then, at each time t∈[m]t \in [m], the algorithm should return an accurate estimate of a given statistic f(x(t))f(\mathbf{x}^{(t)}), even when updates may be selected adaptively based on prior algorithm outputs.

Definition 1.1 ([BJWY22]). Let f:Rn→Rf : \mathbb{R}^n \to \mathbb{R} be a fixed function, and let x(t)\mathbf{x}^{(t)} denote the frequency vector at time t≤mt \leq m. A streaming algorithm A\mathcal{A} is adversarially robust if, for any accuracy parameter

ε∈(0,1)\varepsilon \in (0,1), failure probability δ∈(0,1)\delta \in (0,1), and an adaptively chosen stream length m=poly(n)m = \mathrm{poly}(n), the algorithm A\mathcal{A} returns a sequence of outputs {Zi}i∈[m]\{Z_i\}_{i \in [m]} satisfying

Pr⁡[∃  t∈[m]:∣Zt−f(x(t))∣>εf(x(t))]≤δ.\Pr\left[\exists\;t\in[m]:|Z_t-f(\mathbf{x}^{(t)})|>\varepsilon f(\mathbf{x}^{(t)})\right]\leq \delta.

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 t∈[m]t \in [m], the adversary chooses an update utu_t to insert into the stream; utu_t may depend arbitrarily on the transcript of previous updates {ui}i<t\{u_i\}_{i<t} and algorithm responses {Zi}i<t\{Z_i\}_{i<t}.

(2) The algorithm receives update utu_t, updates its internal state, and returns the current estimate ZtZ_t for f(x(t))f(\mathbf{x}^{(t)}).

(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+20^{20}] presented general frameworks to “robustify” classical streaming algorithms for a large class of statistical estimation problems with only a small poly (1ε,log⁡n)\left(\frac{1}{\varepsilon}, \log n\right) 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 F2F_2 moment estimation 1^1 uses O~(1ε2)\tilde{\mathcal{O}}\left(\frac{1}{\varepsilon^2}\right) bits of space, nearly matching the space complexity of F2F_2 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+24^{24}, GLW+24^{24}, ACS25, GLW+25^{25}], 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+24^{24}] 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 Ω(no(1))\Omega(n^{o(1)}) bits of space. Similarly, [GLW+25^{25}] showed that an adaptive adversary can essentially learn the underlying sketch matrix used by an FpF_p estimation linear sketch after poly(n)(n) adaptive queries, implying an Ω(n)\Omega(n) space lower bound. Meanwhile, all known robust algorithms for FpF_p estimation required space polynomial in the stream length mm [BJWY22, HKM+20^{20}, BEO22]. Very recently, several works [GLW+26b^{26b}, GLW+26a^{26a}] circumvented this Ω(n)\Omega(n) barrier for linear sketches and designed the first robust algorithms for FpF_p estimation for all p∈[0,2]p \in [0,2] which store only poly (1ε,log⁡n)\left(\frac{1}{\varepsilon}, \log n\right) bits of

1^1The FpF_p moment of the frequency vector x∈Rn\mathbf{x} \in \mathbb{R}^n is defined as Fp:=∥x∥pp=∑i∈[n]∣xi∣pF_p := \|\mathbf{x}\|_p^p = \sum_{i \in [n]} |x_i|^p. For p=0p = 0, the F0F_0 moment is ∥x∥0:=∣{i∈[n]:xi≠0}∣\|\mathbf{x}\|_0 := |\{i \in [n] : x_i \neq 0\}|.

space. To overcome prior lower bounds, these algorithms are crucially non-linear and introduce new random bits during the execution of the algorithm.

F2F_2 moment estimation. In this work, we return to the F2F_2 moment estimation problem in the adversarial streaming model. The seminal work of [AMS99] gave an O(1ε2log⁡n)\mathcal{O}\left(\frac{1}{\varepsilon^2} \log n\right) space algorithm for F2F_2, which was later shown to be exactly optimal [KNW10, BZ25]. Since then, the F2F_2 estimation problem has become particularly significant in both theory and practice. Theoretical techniques developed for F2F_2 estimation have inspired efficient streaming algorithms for a host of other estimation tasks, and streaming lower bounds for FpF_p 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 F2F_2 moment roughly represents the repeat rate of the input stream, and algorithms for F2F_2 are often used in network traffic monitoring [KSZC03] and database query optimization [AGMS99].

In the adaptive setting, the space complexity of F2F_2 estimation is far from being well understood. Note that for insertion-only streams, [WZ21] gave an O~(1ε2)\tilde{\mathcal{O}}\left(\frac{1}{\varepsilon^2}\right) space adversarially robust algorithm for F2F_2, nearly matching the classical streaming lower bound of Ω(1ε2log⁡n)\Omega\left(\frac{1}{\varepsilon^2} \log n\right). While the recent robust F2F_2 algorithm [GLW+26b] achieves poly (1ε,log⁡n)\left(\frac{1}{\varepsilon}, \log n\right) space, the dependence on the accuracy parameter in the space complexity scales as O~(1ε4)\tilde{\mathcal{O}}\left(\frac{1}{\varepsilon^4}\right). To this end, we study the following central question:

Is there a separation in the space complexity of F2F_2 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 D\mathcal{D}, and several analyses are then performed to uncover properties of the underlying distribution D\mathcal{D}. 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 X1,…,Xn∼DX_1, \ldots, X_n \sim \mathcal{D} from an unknown distribution D\mathcal{D} with support U\mathcal{U}, and the task of the mechanism is to answer adaptive statistical queries about D\mathcal{D}. Formally, at each time t∈[k]t \in [k], a data analyst provides a statistical query ft:U→[0,1]f_t : \mathcal{U} \to [0,1], and the mechanism should return an accurate estimate ata_t for the population mean EX∼D[ft(X)]\mathbb{E}_{X \sim \mathcal{D}}[f_t(X)] with high probability, such that ∣at−EX∼Dft(X)∣≤α|a_t - \mathbb{E}_{X \sim \mathcal{D}} f_t(X)| \leq \alpha for some accuracy parameter α∈(0,1)\alpha \in (0,1). Importantly, each query ftf_t requested by the analyst may depend on all prior mechanism estimates {ai}i<t\{a_i\}_{i<t} and queries {fi}i<t\{f_i\}_{i<t}. For non-adaptive queries, the standard approach is to take the empirical average of O~(1α2log⁡k)\tilde{\mathcal{O}}\left(\frac{1}{\alpha^2} \log k\right) 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 O~(kα2)\tilde{\mathcal{O}}\left(\frac{k}{\alpha^2}\right) 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 D\mathcal{D}. In the unrestricted domain setting, the differential privacy approach of [DFH+15b], with the improved generalization analysis of [BNS+21], requires O~(kα2)\tilde{\mathcal{O}}\left(\frac{\sqrt{k}}{\alpha^2}\right) samples. To see the dependence on α\alpha, consider adding noise to each empirical answer. With nn samples and total privacy parameter ε\varepsilon, composition gives noise of magnitude approximately knε\frac{\sqrt{k}}{n\varepsilon}. To ensure that the empirical answers remain within additive error O(α)\mathcal{O}(\alpha) of the population answer EX∼D[ft(X)]\mathbb{E}_{X\sim\mathcal{D}}[f_t(X)], the standard generalization bound requires setting the total privacy budget to ε=O(α)\varepsilon = \mathcal{O}(\alpha). Requiring the noise to have magnitude O(α)\mathcal{O}(\alpha) then gives n=O~(kα2)n = \tilde{\mathcal{O}}\left(\frac{\sqrt{k}}{\alpha^2}\right). Alternatively, in the setting that the unknown distribution D\mathcal{D} has bounded support ∣U∣|\mathcal{U}|, one approach uses private multiplicative weights [HR10, BNS+21] to achieve sample complexity roughly O~(1α3log⁡∣U∣log⁡k)\tilde{\mathcal{O}}\left(\frac{1}{\alpha^3}\sqrt{\log |\mathcal{U}|} \log k\right). 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 kk 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 kk statistical queries must maintain n≥Ω~(min⁡(k,log⁡∣U∣)α)n \geq \tilde{\Omega}\left(\frac{\min\left(\sqrt{k}, \sqrt{\log |\mathcal{U}|}\right)}{\alpha}\right) samples. As answering a single statistical query requires Ω(1α2)\Omega\left(\frac{1}{\alpha^2}\right) samples, this implies a lower bound of Ω~(min⁡(k,log⁡∣U∣)α+1α2)\tilde{\Omega}\left(\frac{\min\left(\sqrt{k}, \sqrt{\log |\mathcal{U}|}\right)}{\alpha} + \frac{1}{\alpha^2}\right). 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 kk adaptive statistical queries using O~(min⁡(k,log⁡∣U∣)α+1α2)\tilde{\mathcal{O}}\left(\frac{\min\left(\sqrt{k}, \sqrt{\log |\mathcal{U}|}\right)}{\alpha} + \frac{1}{\alpha^2}\right) samples?

References (52)