We introduce difference estimators for data stream computation, which provide approximations to F(v)-F(u) for frequency vectors v\succeq u and a given function F. We show how to use such estimators to carefully trade error for memory in an iterative manner. The function F is generally non-linear, and we give the first difference estimators for the frequency moments F_p for p\in[0,2], as well as for integers p>2. Using these, we resolve a number of central open questions in adversarial robust streaming and sliding window models. For adversarially robust streams, we obtain a (1+\epsilon)-approximation to F_p using%DIFDELCMD < \mathcal{O}\left(%%% \frac{\log n{\epsilon^2}}%DIFDELCMD < \right) %%% bits of space for p\in[0,2] and using%DIFDELCMD < \mathcal{O}\left(%%% \frac{1{\epsilon^2}n^{1-2/p}}%DIFDELCMD < \right) %%% bits of space for integers p>2. We also obtain an adversarially robust algorithm for the L_2-heavy hitters problem using%DIFDELCMD < \mathcal{O}\left(%%% \frac{\log n{\epsilon^2}}%DIFDELCMD < \right) %%% bits of space. Our bounds are optimal up to \text{poly(\log\log n+\log(1/\epsilon)) factors, and improve the 1{\epsilon^3} dependence of }  Ben-Eliezer et  al. (PODS 2020, best paper award) and the \frac{1{\epsilon^{2.5}} dependence of Hassidim et}  al. (NeurIPS 2020, oral presentation) . For sliding windows, we obtain a (1+\epsilon)-approximation to F_p for p\in(0,2 , resolving a longstanding question of Braverman and Ostrovsky (FOCS 2007). For example, for p = 2 we improve the dependence on \epsilon from \frac{1{\epsilon^4} to an optimal \frac{1}{\epsilon^2}. For both models, our dependence on \epsilon shows, up to \log\frac{1}{\epsilon} factors, that there is no overhead over the standard insertion-only data stream model for any of these problems. } 
%DIFDELCMD < \mathcal{O}\left(%%% {\epsilon^2}}%DIFDELCMD < \right) %%% %DIFDELCMD < \mathcal{O}\left(%%% {\epsilon^2}n^{1-2/p}}%DIFDELCMD < \right) %%% %DIFDELCMD < \mathcal{O}\left(%%% {\epsilon^2}}%DIFDELCMD < \right) %%% (\log\log n+\log(1/\epsilon)) factors, and improve the 1{\epsilon^3} dependence of } In the adversarially robust streaming model, a stream of elements is presented to an algorithm and is allowed to depend on the output of the algorithm at earlier times during the stream. In the classic insertion-only model of data streams, Ben-Eliezer et . al. (PODS 2020, best paper award) {\epsilon^{2.5}} dependence of Hassidim et} show how to convert a non-robust algorithm into a robust one with a roughly 1/\varepsilon factor overhead. This was subsequently improved to a 1/\sqrt{\varepsilon al. (NeurIPS 2020, oral presentation) , suppressing logarithmic factors. For general functions the latter is known to be best-possible, by a result of Kaplan et. al. (CRYPTO 2021). We show how to bypass this impossibility result by developing data stream algorithms for a large class of streaming problems, with no overhead in the approximation factor. Our class of streaming problems includes the most well-studied problems such as the L_2-heavy hitters problem, F_p-moment estimation, as well as empirical entropy estimation. We substantially improve upon all prior work on these problems, giving the first optimal dependence on the approximation factor. As in previous work, we obtain a general transformation that applies to any non-robust streaming algorithm and depends on the {\epsilon^4} to an optimal \frac{1}{\epsilon^2}. For both models, our dependence on \epsilon shows, up to \log\frac{1}{\epsilon} factors, that there is no overhead over the standard insertion-only data stream model for any of these problems. } so-called flip number. However, the key technical innovation is that we apply the transformation to what we call a difference estimator for the streaming problem, rather than an estimator for the streaming problem itself. We then develop the first difference estimators for a wide range of problems. Our difference estimator methodology is not only applicable to the adversarially robust model, but to other streaming models where temporal properties of the data play a central role. (Abstract shortened to meet arXiv limit.)
D
We introduce difference estimators for data stream computation, which provide approximations to F(v)-F(u) for frequency vectors v\succeq u and a given function F. We show how to use such estimators to carefully trade error for memory in an iterative manner. The function F is generally non-linear, and we give the first difference estimators for the frequency moments F_p for p\in[0,2], as well as for integers p>2. Using these, we resolve a number of central open questions in adversarial robust streaming and sliding window models. For adversarially robust streams, we obtain a (1+\epsilon)-approximation to F_p using
D
\frac{\log n
D
bits of space for p\in[0,2] and using
D
\frac{1
D
bits of space for integers p>2. We also obtain an adversarially robust algorithm for the L_2-heavy hitters problem using
D
\frac{\log n
D
bits of space. Our bounds are optimal up to \text{poly
A
In the adversarially robust streaming model, a stream of elements is presented to an algorithm and is allowed to depend on the output of the algorithm at earlier times during the stream. In the classic insertion-only model of data streams,
A
.
D
and the \frac{1
A
show how to convert a non-robust algorithm into a robust one with a roughly 1/\varepsilon factor overhead. This was subsequently improved to a 1/\sqrt{\varepsilon
D
. For sliding windows, we obtain a (1+\epsilon)-approximation to F_p for p\in(0,2
R
, resolving a longstanding question of Braverman and Ostrovsky (FOCS 2007). For example, for p = 2 we improve
, suppressing logarithmic factors. For general functions the latter is known to be best-possible, by a result of Kaplan et. al. (CRYPTO 2021). We show how to bypass this impossibility result by developing data stream algorithms for a large class of streaming problems, with no overhead in the approximation factor. Our class of streaming problems includes the most well-studied problems such as the L_2-heavy hitters problem, F_p-moment estimation, as well as empirical entropy estimation. We substantially improve upon all prior work on these problems, giving the first optimal dependence on the approximation factor. As in previous work, we obtain a general transformation that applies to any non-robust streaming algorithm and depends on
D
dependence on \epsilon from \frac{1
A
so-called flip number. However, the key technical innovation is that we apply the transformation to what we call a difference estimator for the streaming problem, rather than an estimator for the streaming problem itself. We then develop the first difference estimators for a wide range of problems. Our difference estimator methodology is not only applicable to the adversarially robust model, but to other streaming models where temporal properties of the data play a central role. (Abstract shortened to meet arXiv limit.)