Adversarial Robustness for Small Frequency Moments and a Weak Equivalence Theorem for Turnstile Streams

Elena Gribelyuk
Princeton University
eg5539@princeton.edu

,

Honghao Lin
Carnegie Mellon University
honghaol@andrew.cmu.edu

,

David P. Woodruff
Carnegie Mellon University
dwoodruf@andrew.cmu.edu

,

Huacheng Yu
Princeton University
hy2@cs.princeton.edu

,

Samson Zhou
Texas A&M University
samsonzhou@gmail.com


Abstract

We study adversarially robust algorithms for insertion-deletion (turnstile) streams, where future updates may depend on past algorithm outputs. While recent work achieved a robust \((1+\varepsilon)\)-approximation for the second moment \(F_2\) in polylogarithmic space, achieving high accuracy for other frequency moments remained a major open question; for \(p \in [0, 2)\), including the fundamental distinct elements problem (\(F_0\)), only constant-factor approximations were known in sublinear space. We close this gap, showing that \((1+\varepsilon)\)-approximate robustness can be achieved in polylogarithmic space for all \(p \in [0, 2]\). Our approach generalizes the estimator-corrector-learner framework to non-Hilbert spaces by dynamically maintaining implicit isometric embeddings into \(L_2\) and performing regularized kernel ridge regression over adaptively discovered hard queries, yielding the first insertion-deletion algorithms that approximate: (1) the \(p\)-th frequency moment \(F_p\) up to a \((1+\varepsilon)\)-factor in \(\text{poly}(1/\varepsilon, \log n)\) space for all \(p \in [0, 2]\), including the support size \(F_0\), (2) metric and information-theoretic quantities, including the Earth Mover Distance (EMD) and \(k\)-median clustering cost over \([\Delta]^d\) up to an \(\mathcal{O}(d \log \Delta)\)-factor, and the Shannon entropy up to an \(\varepsilon\)-additive error, and (3) non-normed symmetric losses defined by Bernstein functions up to a \((1+\varepsilon)\)-factor. For the \(F_p\) moments, our algorithm is optimal up to \(\text{poly}(1/\varepsilon, \log n)\) factors. Furthermore, we establish a weak equivalence between classical oblivious sketching and adversarial robustness. We prove that for any sub-multiplicative norm, the existence of an efficient classical linear sketch is equivalent to the existence of an efficient adversarially robust turnstile algorithm, up to polynomial factors, formalizing \(L_1\) embeddability as the fundamental mechanism governing both models.

1 Introduction↩︎

The streaming model of computation has emerged as a central framework for studying algorithms that process massive amounts of sequential data. In this setting, an underlying dataset is implicitly defined by a stream of updates and an algorithm must maintain a compact summary to approximately answer queries or report relevant statistics about the data. Often, the algorithm is restricted to a single pass over the stream and must use space sublinear in both the stream length \(m\) and the universe size \(n\). This framework has proven remarkably effective for reasoning about large-scale data processing, and has led to a rich body of work spanning algorithm design, lower bounds, and applications.

In the classical streaming setting, a standard assumption in the literature is that the input stream is fixed in advance and independent of the algorithm’s internal randomness. However, this assumption is often violated in modern applications, where the input stream may be generated adaptively based on previous outputs of the algorithm. For instance, queries to a database may depend on previous answers, iterative scientific procedures may update their state using previously computed estimates, and feedback loops may arise in online recommendation platforms and financial systems. In such settings, the input stream may depend on the behavior of the algorithm itself (and on the internal randomness), thus raising the question of whether classical streaming guarantees continue to hold.

1.0.0.1 Adversarially robust streaming.

To capture this phenomenon, [1] introduced the adversarially robust streaming model, where future updates may be chosen adaptively based on previous outputs of the algorithm. Specifically, at each time \(t \in [m]\), the algorithm receives an update \((a_t, \Delta_t)\) to the underlying frequency vector \({\mathbf{x}}\in \mathbb{Z}^n\), where \(a_t \in [n]\) is an index and \(\Delta_t \in \mathbb{Z}\) denotes an increment or decrement to coordinate \(a_t\) of \({\mathbf{x}}\) by \(\Delta_t\). Concretely, the frequency vector \({\mathbf{x}}\) is defined implicitly by \(x_i^{(t)} = \sum_{t' \leq t: a_{t'} = i} \Delta_{t'}\). The algorithm must then output an estimate of a function \(f({\mathbf{x}}^{(t)})\) of the current prefix. Crucially, the algorithm must remain accurate at every step, even when each update \((a_t, \Delta_t)\) is chosen adaptively based on the entire transcript of previous updates and responses of the algorithm.

Definition 1 ([1]). Let \(f: \mathbb{Z}^n \to\mathbb{R}\) be a fixed function. A streaming algorithm \({\mathcal{A}}\) is adversarially robust if, for any accuracy parameter \(\varepsilon\in(0,1)\), failure parameter \(\delta\in(0,1)\), and \(m=\mathop{\mathrm{poly}}(n)\), at each time step \(t \in [m]\) the algorithm outputs an estimate \(Z_t\) such that \[\mathbf{Pr}\left[|Z_t - f({\mathbf{x}}^{(t)})|\le\varepsilon\cdot f({\mathbf{x}}^{(t)})\right]\ge1-\delta.\]

Informally, the model captures an interaction between a randomized algorithm \({\mathcal{A}}\) and an adaptive adversary that constructs a sequence of updates \(\{u_1,\ldots,u_m\}\), where each update \(u_t\) may depend on all previously observed updates and outputs. The interaction proceeds as follows:

  1. For each \(t \in [m]\), the adversary selects an update \(u_t\), where the choice of \(u_t\) may be an arbitrary (possibly randomized) function of \(u_1,\ldots,u_{t-1}\) and \(Z_1,\ldots,Z_{t-1}\).

  2. Upon receiving \(u_t\), the algorithm \({\mathcal{A}}\) updates its internal state to incorporate \(u_t\).

  3. The algorithm then outputs an estimate \(Z_t\) of \(f({\mathbf{x}}^{(t)})\) prior to the next update.

Designing algorithms that remain accurate under such adaptivity, while still using limited space and a single pass, has emerged as a central challenge in recent work [1][33].

1.0.0.2 Norm and distinct element estimation.

A canonical class of problems in the streaming model is the estimation of the frequency moments of the underlying data. These moments capture a variety of fundamental statistics of the data stream and are formally defined as follows. For a frequency vector \({\mathbf{x}}\in \mathbb{Z}^n\), the \(p\)-th frequency moment is given by \(F_p({\mathbf{x}})=\sum_{i\in[n]}|x_i|^p\) for \(p>0\), while \(F_0({\mathbf{x}})=|\{i\in[n] : x_i \neq 0\}|\) denotes the number of distinct elements in the stream. These quantities capture a range of important properties of the data; for example, \(F_1\) corresponds to the total mass of the stream, \(F_2\) is closely related to the collision probability, and \(F_0\) measures the support size of the underlying vector. More broadly, the family of \(F_p\) moments for \(p>0\) provides a rich spectrum of statistics, and via the identity \(\|{\mathbf{x}}\|_p = (F_p({\mathbf{x}}))^{1/p}\), directly corresponds to the problem of estimating \(L_p\) norms.

These problems have been studied extensively in the classical (non-adaptive) streaming model since the seminal work of [34], with tight space bounds known for a wide range of parameters [34][39]. For the distinct elements problem corresponding to \(p =0\), it is known that \(\tilde{\Theta}\left(\frac{1}{\varepsilon^2}\log n\right)\) bits of space is both necessary [34], [37] and sufficient [38]. Similarly for \(p\in(0,2]\), it is known that for all \(\varepsilon\in(n^{-1/2+c},1)\) for any constant \(c>0\), \(\Theta\left(\frac{1}{\varepsilon^2}\log n\right)\) bits of space is both necessary [34], [37] and sufficient [34], [37], [39]. Finally, for \(p>2\), it is known that \(\tilde{\Theta}\left(\frac{1}{\varepsilon^2}\cdot n^{1-2/p}\right)\) bits of space is both necessary [40], [41] and sufficient [42], [43]. Similar bounds are known for \(p\in[0,2]\) and integer \(p>2\) in the adversarially robust model when the adversary is restricted to \(\Delta_t\ge 0\) for all \(t\ge 0\), i.e., the insertion-only setting [44].

In contrast, significantly less is understood in the adversarially robust setting in the presence of deletions. A long line of work has shown that linear sketching, which underlies essentially all known turnstile streaming algorithms in the non-adaptive setting [45][49], is fundamentally limited in this setting, and cannot achieve even a constant-factor approximation to these quantities unless the sketching dimension is \(r=\Omega(n)\), i.e., the sketch requires near-linear space [23], [26], [50]. This has led to a significant gap in our understanding of the power and limitations of turnstile streaming algorithms under adaptive updates.

Recent work has begun to close this gap by demonstrating that it is possible to design sublinear-space adversarially robust algorithms in the turnstile model. In particular, it is now known that a \((1+\varepsilon)\)-approximation for the \(L_2\) norm can be achieved using \(\mathop{\mathrm{poly}}\left(\frac{1}{\varepsilon},\log n\right)\) space [32]. For \(p\neq 2\) and for the distinct elements problem, however, only constant-factor approximations were previously known in sublinear space, leaving a significant gap in our understanding of the achievable approximation guarantees under adversarial updates.

1.1 Our Contributions↩︎

In this work, we significantly advance the understanding of adversarial robustness in the insertion-deletion streaming model. Our main results establish that, despite strong impossibility results for linear sketches [23], [26], [50], accurate estimation of a broad class of frequency moments is still achievable in sublinear space under adaptive updates. We further develop a conceptual connection between adversarial robustness and classical sketching, showing that these two models are, in a weak sense, equivalent up to polynomial losses. We also show that our robust \(F_p\) estimation primitives can be combined with standard metric and norm embeddings to obtain the first adversarially robust sublinear-space algorithms for a variety of other problems. These include geometric and clustering objectives such as Earth Mover Distance and \(k\)-median cost, as well as statistical measures like Shannon entropy.

1.1.0.1 \(F_p\) moment estimation for \(p \in [0,2]\).

Our first main result resolves the approximability of frequency moments and distinct elements in the adversarially robust turnstile model for the entire regime \(p \in [0,2]\). Prior to our work, \((1+\varepsilon)\)-approximation was only known for \(p=2\), while for all other values of \(p \in [0,2)\) (including the distinct elements problem \(F_0\)), only constant-factor approximations were known in sublinear space [32].

theoremthmlpsmall Given a constant \(p\in[0,2]\) and any \(\varepsilon\in(0,1)\), there exists an adversarially robust insertion-deletion streaming algorithm on a stream of length \(m\) that with high probability, outputs a \((1+\varepsilon)\)-approximation to the \(F_p\) moment at all times, for the underlying frequency vector of universe size \(n\). For \(m=\mathop{\mathrm{poly}}(n)\), the algorithm uses \(\mathop{\mathrm{poly}}\left(\frac{1}{\varepsilon},\log n\right)\) bits of space.

[thm:lp:small] provides a unified and nearly optimal guarantee for all \(p \in [0,2]\), matching the space complexity of classical (non-adaptive) streaming up to polynomial factors [34], [37][39]. In particular, [thm:lp:small] gives the first \((1+\varepsilon)\)-approximation for the distinct elements problem in the adversarially robust turnstile model using polylogarithmic space, thereby closing a central open question in the area.

1.1.0.2 Equivalence between robustness and sketching.

Our second main result provides a structural explanation for the power and limitations of adversarially robust streaming algorithms. As previously discussed, linear sketching is known to be inherently non-robust to adaptive inputs, yet it underlies essentially all optimal oblivious streaming algorithms. We show that this tension can be formalized via a general equivalence theorem.

A key conceptual ingredient underlying this result is again the central role of \(L_1\). Building on [thm:lp:small], which gives a robust and accurate estimator for the \(L_1\) norm, we leverage a foundational connection between sketching and metric embeddings. Specifically, a seminal result of [51] establishes that for finite-dimensional normed spaces, admitting an efficient classical linear sketch is mathematically equivalent to admitting a low-distortion embedding into \(L_{1-\varepsilon}\) (and into \(L_1\) for norms closed under sum-product). By this characterization, any normed space that admits an efficient oblivious sketch must embed into such spaces. This allows us to simulate arbitrary linear sketches in the adversarially robust setting by composing these guaranteed embeddings with our robust \(L_p\) estimation primitives. Conversely, any adversarially robust algorithm can be converted into a classical sketch by compressing its interaction transcript. Together, these reductions yield a general equivalence between the two models.

theoremthmequivalence Let \({\mathcal{X}}= (\mathbb{R}^n, \|\cdot\|_{{\mathcal{X}}})\) be a finite-dimensional normed space. Then:

  1. Forward direction (oblivious to robust): If \({\mathcal{X}}\) admits a linear sketch of size \(s\) bits solving the \(D\)-gap norm problem, then \({\mathcal{X}}\) admits an adversarially robust turnstile streaming algorithm in the advice model that achieves an approximation factor of \(\mathcal{O}\left(sD\right)\) while using \(\mathop{\mathrm{poly}}(s, \log n)\) bits of space.

  2. Reverse direction (robust to oblivious): Conversely, suppose \({\mathcal{X}}\) admits an adversarially robust turnstile streaming algorithm that uses \(s\) bits of space and achieves a multiplicative \(D\)-approximation for sufficiently large data streams. Then there exists a linear sketch for \({\mathcal{X}}\) in the classical oblivious setting that uses \(\mathcal{O}\left(s\log n\right)\) bits of space.

[thm:equivalence] establishes a weak equivalence between the adversarially robust and oblivious models: any progress in one model translates moderately to the other. In particular, [thm:equivalence] shows that the existence of efficient adversarially robust algorithms implies new linear sketches, while classical sketching lower bounds extend to the robust setting. Thus, this connection provides a unifying framework for understanding which problems admit efficient robust algorithms, and explains the inherent difficulty of extending linear sketches to the adversarial setting.

A central theme underlying both our algorithms and our structural results is the role of \(L_1\) as a unifying geometry. At a technical level, our \((1+\varepsilon)\)-approximation for \(F_p\) in [thm:lp:small] is obtained by reducing to robust \(F_1\) estimation via suitable transformations. More broadly, rather than \(L_1\) merely serving as a convenient target space for a wide range of embeddings arising in theoretical computer science, the equivalence of [51] demonstrates that \(L_1\) (and \(L_{1-\varepsilon}\)) embeddability is the fundamental and unavoidable mechanism for sketching norms. This perspective is powerfully reinforced by [thm:equivalence], whose proof proceeds by extracting such embeddings from classical sketches and simulating them in the adversarially robust setting. Taken together, these results establish a compelling triad—adversarial robustness, oblivious sketching, and \(L_1\) embeddability are intrinsically tied together—and suggest that robust \(L_1\) estimation is a fundamental primitive from which more general adversarially robust streaming algorithms can be derived.

1.1.0.3 Additional applications.

Building on this viewpoint, we obtain a number of additional applications by combining known embeddings into \(L_p\) with our robust estimation framework. We highlight a few representative examples below.

Our first application is to the Earth Mover Distance (EMD), a central metric for comparing distributions over discrete domains. It is well-known that EMD over the grid \([\Delta]^d\) admits an embedding into \(L_1\) with distortion \(\mathcal{O}\left(d \log \Delta\right)\). By combining this embedding with our robust \(F_1\) estimation primitives, we obtain an adversarially robust approximation algorithm for EMD in the turnstile model.

theoremthmemd There exists an adversarially robust turnstile streaming algorithm of length \(m\) over universe \([\Delta]^d\) that computes a \(\mathcal{O}\left(d\log\Delta\right)\)-approximation to the Earth Mover Distance \(\|{\mathbf{x}}\|_{\mathop{\mathrm{EMD}}}\) over the grid \([\Delta]^d\), using \(\mathop{\mathrm{poly}}(d,\log(m\Delta))\) bits of space.

Our second application is to the \(k\)-median clustering objective, which can also be reduced to \(L_1\) via standard embeddings. Using our framework, we obtain adversarially robust algorithms for maintaining approximate clustering solutions on insertion-deletion streams.

theoremthmkmedian There exists an adversarially robust turnstile streaming algorithm that outputs a set of \(k\) centers that provide a \(\mathcal{O}\left(d\log\Delta\right)\)-approximation to the \(k\)-median clustering cost over \([\Delta]^d\), using \(\mathop{\mathrm{poly}}(k,d,\log\Delta)\) bits of space.

Finally, we consider entropy estimation, which can be reduced to estimating frequency moments. Using our robust \(F_p\) estimators as a black-box primitive, we obtain accurate entropy estimates even in the presence of adversarial updates.

theoremthmentropy Given any \(\varepsilon\in(0,1)\), there exists an adversarially robust insertion-deletion streaming algorithm on a stream of length \(m\) that with high probability, outputs a \(\varepsilon\)-additive approximation to the Shannon entropy, for the underlying frequency vector of universe size \(n\). For \(m=\mathop{\mathrm{poly}}(n)\), the algorithm uses \(\mathop{\mathrm{poly}}\left(\frac{1}{\varepsilon},\log n\right)\) bits of space.

Beyond these examples, our framework applies more broadly to any problem that admits a low-distortion embedding into \(L_1\) or can be reduced to frequency moment estimation. This includes a variety of geometric, statistical, and combinatorial estimation tasks, highlighting the generality of our approach and the central role of \(L_p\) embeddings in the adversarially-robust streaming model.

1.2 Technical Overview↩︎

1.2.1 \(F_p\) Estimation Algorithm for \(p<2\)↩︎

A natural starting point for [thm:lp:small] might be to generalize the existing adversarially robust \((1+\varepsilon)\)-approximate \(L_2\) estimation algorithm that handles insertions and deletions.

1.2.1.1 Estimator-corrector-learner framework.

At a high level, the \(F_2\) algorithm of [32] departs from classical linear sketching by introducing fresh randomness during the execution of the algorithm and organizing the computation around a estimator-corrector-learner paradigm. The stream is conceptually partitioned into blocks, and within each block we decompose the underlying frequency vector as \({\mathbf{x}}={\mathbf{z}}-{\mathbf{q}}\), where \({\mathbf{z}}\) corresponds to the portion of the stream before the block. For convenience, we write \(-{\mathbf{q}}\) as the updates of the block, so that \(\|{\mathbf{x}}\|\) can be interpreted as a metric measuring the distance between \({\mathbf{z}}\) and \({\mathbf{q}}\).

The algorithm maintains multiple sketches that correspond to three ingredients, which play different roles in this decomposition:

  1. The estimator produces a candidate approximation to \(\|{\mathbf{z}}-{\mathbf{q}}\|_2^2\) via \(\|{\mathbf{z}}-{\mathbf{z}}'\|_2^2+\|{\mathbf{z}}'-{\mathbf{q}}\|_2^2\), where \({\mathbf{z}}'\) is a current guess for the vector \({\mathbf{z}}\), which arrived before the current block and is thus unknown from the perspective of the sketches initialized at the beginning of the block.

  2. The algorithm also maintains a corrector, which uses a separate sketch on \({\mathbf{z}}-{\mathbf{q}}\) initialized at the beginning of the data stream, to verify whether the estimator is accurate. If the estimate is correct, the algorithm proceeds using the output of the estimator; otherwise, the corrector overrides the estimator and outputs an estimate for \(\|{\mathbf{z}}- {\mathbf{q}}\|_2^2\), and activates the learner.

  3. Upon detecting an incorrect estimate, the learner updates the internal iterate \({\mathbf{z}}'\), refining its approximation to \({\mathbf{z}}\) using information revealed by the current query \({\mathbf{q}}\), for which the estimator was not accurate.

The key idea is that each time that the estimator is not accurate, this exposes structural information about \({\mathbf{z}}\) to the algorithm, allowing us to update the guess \({\mathbf{z}}'\) to move closer to \({\mathbf{z}}\) in a controlled manner. After the update, subsequent estimators operate with the refined iterate, and the process continues.

A crucial property of the framework is that the number of learner updates is small. Each query \({\mathbf{q}}\) can only correspond to an incorrect output by the estimator if \({\mathbf{q}}\) is aligned with some direction of \({\mathbf{z}}\) not captured by the guess \({\mathbf{z}}'\). For example, when the estimator errs via \(\|{\mathbf{z}}-{\mathbf{z}}'\|_2^2+\|{\mathbf{z}}'-{\mathbf{q}}\|_2^2>(1+\varepsilon)\cdot\|{\mathbf{z}}-{\mathbf{q}}\|_2^2\), this implies \[\begin{align} \langle{\mathbf{z}}-{\mathbf{z}}',{\mathbf{z}}'-{\mathbf{q}}\rangle\ge\varepsilon\cdot\|{\mathbf{z}}-{\mathbf{z}}'\|_2\cdot\|{\mathbf{z}}'-{\mathbf{q}}\|_2. \end{align}\] Thus, it can be shown that updating \({\mathbf{z}}'\) toward \({\mathbf{q}}\) by setting \({\mathbf{z}}''={\mathbf{z}}'+\alpha({\mathbf{z}}'-{\mathbf{q}})\) for some carefully chosen \(\alpha\approx\frac{\varepsilon\cdot\|{\mathbf{z}}-{\mathbf{z}}'\|_2}{\|{\mathbf{z}}'-{\mathbf{q}}\|_2}\) makes quantifiable progress toward \({\mathbf{z}}\): \[\begin{align} \label{eq:progress:L2} \|{\mathbf{z}}-{\mathbf{z}}''\|_2^2\le(1-\varepsilon^2)\cdot\|{\mathbf{z}}-{\mathbf{z}}'\|_2^2. \end{align}\tag{1}\] Since the frequency vector has entries bounded by \(\mathop{\mathrm{poly}}(n)\), it follows that the iterate \({\mathbf{z}}'\) converges to \({\mathbf{z}}\) after only \(\mathcal{O}\left(\frac{1}{\varepsilon^2} \log n\right)\) updates to \({\mathbf{z}}'\). Therefore, the corrector sketch only needs to be accurate for a small number of adaptive queries, which can be ensured with only polylogarithmic overhead in the total space complexity. Then, the final insight is that robustly estimating the second term \(\|{\mathbf{z}}' - {\mathbf{q}}\|_2^2\) is a problem of precisely the same form as the original problem, and thus it can be recursively computed by implementing the estimator-corrector-learner framework with estimator \(\|({\mathbf{z}}' - {\mathbf{q}}_1) - {\mathbf{u}}\|_2^2 + \|{\mathbf{u}}- {\mathbf{q}}_2\|_2^2\), where \({\mathbf{q}}= {\mathbf{q}}_1 + {\mathbf{q}}_2\) is decomposed so that segments \({\mathbf{q}}_1\) and \({\mathbf{q}}_2\) can be sketched using independent sketches.

1.2.1.2 An alternative update rule.

We remark that while [32] analyzed the algorithm for the update rule \({\mathbf{z}}'' \gets {\mathbf{z}}' + \alpha({\mathbf{z}}' - {\mathbf{q}})\), one can show the same convergence as in 1 for a modified update rule, given as follows: let \({\mathcal{L}}= \{{\mathbf{q}}_i\}_{i = 1}^L\) be a list of queries on which the estimator was previously inaccurate. If the estimator is not accurate on the current suffix \({\mathbf{q}}\), we update \[{\mathbf{z}}'' := \mathop{\mathrm{Proj}}_{\mathop{\mathrm{Span}}({\mathcal{L}}\cup \{{\mathbf{q}}\})} ({\mathbf{z}}),\] noting that the projection can be computed by solving a regression problem in the sketch space. In fact, this update rule has the nice (but not strictly necessary) property that once the iterate is updated to \({\mathbf{z}}''\), the new estimator \(\|{\mathbf{z}}- {\mathbf{z}}''\|_2^2 + \|{\mathbf{z}}'' - {\mathbf{q}}\|_2^2\) is precisely equal to \(\|{\mathbf{z}}- {\mathbf{q}}\|_2^2\) by Pythagorean theorem.

1.2.1.3 Possible approaches for \(F_p\) estimation.

In order to generalize the framework of [32] for other \(L_p\) norms, we must determine an appropriate decomposition of \(\|{\mathbf{x}}\|_p^p = \|{\mathbf{z}}- {\mathbf{q}}\|_p^p \approx g({\mathbf{z}}-{\mathbf{z}}') + g({\mathbf{z}}' - {\mathbf{q}})\) for some sketchable function \(g: \mathbb{R}^n \rightarrow \mathbb{R}\) with the following properties:

  • The prefix \({\mathbf{z}}- {\mathbf{z}}'\) and suffix \({\mathbf{z}}' - {\mathbf{q}}\) can be sketched independently. Moreover, for \({\mathbf{q}}= {\mathbf{q}}_1 + {\mathbf{q}}_2\), the function \(g\) should have the property that a sketch for \(g({\mathbf{z}})\) can subsequently be used to track \(g({\mathbf{z}}- {\mathbf{q}}_1)\). Note that this is needed in order to implement the recursion, as described above.

  • This decomposition should allow us to argue that if \(g({\mathbf{z}}-{\mathbf{z}}') + g({\mathbf{z}}' -{\mathbf{q}}) \not \in (1\pm\varepsilon) \cdot \|{\mathbf{z}}- {\mathbf{q}}\|_p^p\), the algorithm can recover more information about \({\mathbf{z}}\) from the current query \({\mathbf{q}}\).

Recall that in the \(L_2\) algorithm of [32], the crucial insight was that due to the Pythagorean properties of Euclidean space and the squared \(L_2\) norm, an inaccurate estimator directly implies that the dot product between \({\mathbf{z}}-{\mathbf{z}}'\) and \({\mathbf{z}}'-{\mathbf{q}}\) must be significant, thus enabling the algorithm to make progress in learning \({\mathbf{z}}\). Unfortunately, it is not clear how to establish a similar claim for \(L_p\) norms. For instance, one might try to write down the binomial expansion of \(\|{\mathbf{z}}- {\mathbf{q}}\|_p^p\) for integer \(p\), but then observe that incorrect outputs by the estimator might be caused by numerous correlations between coordinate-wise powers of \({\mathbf{z}}-{\mathbf{z}}'\), \({\mathbf{z}}'-{\mathbf{q}}\), and \({\mathbf{z}}-{\mathbf{q}}\). Thus, even by considering a more complex potential function of \({\mathbf{z}}-{\mathbf{z}}'\), it is not at all clear how to show convergence.

1.2.1.4 A hard instance: the Hadamard code.

Our first observation is that the iterate \({\mathbf{z}}'\) maintained by the learner of [32] uses a very specific update rule \({\mathbf{z}}'\gets{\mathbf{z}}'+\alpha({\mathbf{z}}'-{\mathbf{q}})\) and so \({\mathbf{z}}'\) can be written as a linear combination of a list \({\mathbf{u}}_1,\ldots,{\mathbf{u}}_L\) of previous queries on which the estimator failed. Hence, \({\mathbf{z}}'\) is contained within the subspace \({\mathbf{U}}\) spanned by the vectors \({\mathbf{u}}_1,\ldots,{\mathbf{u}}_L\). Thus, the distance \(\|{\mathbf{z}}'-{\mathbf{z}}\|_2^2\) between the iterate \({\mathbf{z}}'\) and the target vector \({\mathbf{z}}\) is at least the distance between \({\mathbf{z}}\) and the closest vector \({\mathbf{v}}\) to \({\mathbf{z}}\) contained within the subspace \({\mathbf{U}}\), i.e., \({\mathbf{v}}=\mathop{\mathrm{argmin}}_{{\mathbf{y}}\in\mathbb{R}^L}\|{\mathbf{U}}{\mathbf{y}}-{\mathbf{z}}\|_2^2\). Therefore, we could similarly upper bound the number of iterations required for convergence if at each step, we simply take the closest vector \({\mathbf{v}}\) to \({\mathbf{z}}\) contained within the subspace \({\mathbf{U}}\).

We could try adapting this approach to \(L_p\) norms by maintaining the list of queries \({\mathbf{u}}_1,\ldots,{\mathbf{u}}_L\) on which the estimator failed and iteratively updating \({\mathbf{z}}'\) to be the closest vector to the subspace \({\mathbf{U}}\) in \(L_p\) distance. However, it turns out that this approach fails catastrophically. Suppose \({\mathbf{z}}=\mathbf{1}^n\) and each query \({\mathbf{q}}\in\{-1,+1\}^n\) is a codeword in the Hadamard code not equal to \({\mathbf{z}}\), so that \(\sum_{i=1}^n q_i=0\). Hence, once such a query is added, the maintained subspace \({\mathbf{U}}=\mathop{\mathrm{Span}}({\mathbf{u}}_1,\ldots,{\mathbf{u}}_L)\) is contained in \(\left\{{\mathbf{y}}\in\mathbb{R}^n:\sum_{i=1}^n y_i=0\right\}\). The update step sets \({\mathbf{z}}'\) to be the minimizer of \(\min_{{\mathbf{y}}\in {\mathbf{U}}} \|\mathbf{1}^n - {\mathbf{y}}\|_p^p\). For \(p>1\), the function \(t \mapsto |1-t|^p\) is strictly convex and so by Jensen’s inequality, for any \({\mathbf{y}}\in {\mathbf{U}}\), \[\frac{1}{n}\sum_{i=1}^n |1 - y_i|^p \ge \left|1 - \frac{1}{n}\sum_{i=1}^n y_i\right|^p = 1,\] where we used that \(\sum_i y_i = 0\). Moreover, equality holds if and only if all coordinates of \({\mathbf{y}}\) are equal, which together with the zero-sum constraint forces \({\mathbf{y}}= \mathbf{0}^n\). Thus the unique minimizer is \({\mathbf{z}}' = \mathbf{0}^n\). Note that while \(\mathbf{0}^n\) is also the minimizer for \(p=2\), the algorithm avoids this trap because the initial estimator evaluates to \(\|{\mathbf{z}}-{\mathbf{z}}'\|_2^2 + \|{\mathbf{z}}'-{\mathbf{q}}\|_2^2 = n+n=2n\), which matches the true distance \(\|{\mathbf{z}}-{\mathbf{q}}\|_2^2 = \frac{n}{2}|1-1|^2 + \frac{n}{2}|1-(-1)|^2 = 2n\), meaning the corrector never flags these queries. For \(p \in (1, 2)\), however, the true distance is \(\|{\mathbf{z}}-{\mathbf{q}}\|_p^p = n 2^{p-1}\), which is a constant-factor multiplicative separation from the estimate of \(2n\). Consequently, \({\mathbf{z}}'\) remains \(\mathbf{0}^n\) throughout the process, so that it never progresses toward \({\mathbf{z}}\), even while each query is continuously flagged by the corrector and added to the list.

1.2.1.5 Embedding into \(L_2\) and regularized regression.

We first recall the existence of isometric embeddings \(f\) onto Hilbert spaces [52][54], so that for any \(p\in[0,2)\), we have for all vectors \({\mathbf{u}},{\mathbf{v}}\in\mathbb{R}^n\), \[\|{\mathbf{u}}-{\mathbf{v}}\|_p^p=\|f({\mathbf{u}})-f({\mathbf{v}})\|_2^2,\qquad \|f(\mathbf{0})\|_2=0,\] so that for the \(p\)-th moment of the vector \({\mathbf{z}}-{\mathbf{q}}\), it suffices to estimate \(\|f({\mathbf{z}})-f({\mathbf{q}})\|_2^2\). In the discussion below, we let \(N\) denote the embedding dimension of \(f(\cdot)\). Ideally, if we could apply the embedding on the fly to each arriving element in the data stream, then this problem would directly reduce to \(F_2\) estimation. Unfortunately, these embeddings are non-linear mappings into a higher dimensional space and it is not clear how to maintain embedded vectors in the streaming setting.

In fact, it turns out that we only require the existence of such embeddings to design our robust \(F_p\) estimation algorithm by simulating the estimator-corrector-learner paradigm implicitly in the embedded space. As such, we now describe the algorithm as though we have access to embedded vectors, although the true algorithm will strictly operate on the original vectors. By analogy to the \(L_2\) algorithm, suppose the estimator for \(\|{\mathbf{z}}- {\mathbf{q}}\|_p^p = \|f({\mathbf{z}}) - f({\mathbf{q}})\|_2^2\) is \(\|f({\mathbf{z}}) - {\mathbf{v}}\|_2^2 + \|{\mathbf{v}}- f({\mathbf{q}})\|_2^2\), where \({\mathbf{v}}= \mathop{\mathrm{Proj}}_{{\mathcal{L}}} f({\mathbf{z}})\) is the iterate that approximates \(f({\mathbf{z}})\) and \(\mathcal{L} = \{f({\mathbf{q}}_i)\}\) is the list of previous queries on which the estimator was not accurate 1. Let \(|{\mathcal{L}}| = L\). Since \({\mathbf{v}}\) is a projection onto the span of the previous hard queries \(f({\mathbf{q}}_i)\), we have that \({\mathbf{v}}= \sum_{i = 1}^{L} \alpha_i \cdot f({\mathbf{q}}_i)\) for some coefficients \(\alpha_i \in \mathbb{R}\). Importantly, note that \({\mathbf{v}}\) does not correspond to an explicit vector in the original space, and may not admit a pre-image under the embedding \(f\).

Now, we can estimate the quantity \(\|f({\mathbf{z}}) - {\mathbf{v}}\|_2^2\) in the streaming setting by first observing that \[\begin{align} \label{eq:expansion:first:term} \|f({\mathbf{z}}) - {\mathbf{v}}\|_2^2 = \|f({\mathbf{z}})\|_2^2 - 2\sum_{i = 1}^{L} \alpha_i \cdot \langle f({\mathbf{z}}), f({\mathbf{q}}_i) \rangle + \sum_{1 \leq i,j \leq L} \alpha_i \cdot \alpha_j \cdot \langle f({\mathbf{q}}_i), f({\mathbf{q}}_j) \rangle. \end{align}\tag{2}\]

Then, we can simply estimate all of these right-hand side terms as follows:

  • \(\|f({\mathbf{z}})\|_2^2 = \|{\mathbf{z}}\|_p^p\) can be estimated using an \(F_p\) estimation sketch for \({\mathbf{z}}\).

  • \(\langle f({\mathbf{z}}), f({\mathbf{q}}_i) \rangle\) can be estimated by noting that \[\langle f({\mathbf{z}}), f({\mathbf{q}}_i) \rangle = \frac{1}{2} \left(\|f({\mathbf{z}})\|_2^2 + \|f({\mathbf{q}}_i)\|_2^2 - \|f({\mathbf{z}}) - f({\mathbf{q}}_i) \|_2^2 \right).\]

    Therefore, we can estimate \(\|f({\mathbf{q}}_i)\|_2^2 = \|{\mathbf{q}}_i\|_p^p\) and \(\|f({\mathbf{z}}) - f({\mathbf{q}}_i)\|_2^2 = \|{\mathbf{z}}- {\mathbf{q}}_i\|_p^p\) using \(F_p\) estimation sketches on \({\mathbf{q}}_i\) and \({\mathbf{z}}- {\mathbf{q}}_i\) respectively, so we obtain an estimate of \(\langle f({\mathbf{z}}), f({\mathbf{q}}_i) \rangle\) up to \(\varepsilon\cdot \left(\|{\mathbf{z}}\|_p^p + \|{\mathbf{q}}_i\|_p^p + \|{\mathbf{z}}-{\mathbf{q}}_i\|_p^p \right)\) additive error. We remark that the estimate of \(\|{\mathbf{z}}- {\mathbf{q}}_i\|_p^p\) precisely corresponds to a previous output of our algorithm.

  • By the same reasoning, terms \(\langle f({\mathbf{q}}_i), f({\mathbf{q}}_j) \rangle\) can be estimated using \(F_p\) estimation sketches for previous (fixed) queries \({\mathbf{q}}_i\), \({\mathbf{q}}_j\), and \({\mathbf{q}}_i - {\mathbf{q}}_j\).

As before, the corrector will use an \(F_p\) estimation sketch for \({\mathbf{z}}-{\mathbf{q}}\) to check whether the current estimator is accurate, and to trigger updates to the iterate \({\mathbf{v}}\).

1.2.1.6 Recursion.

At this point, it suffices to show how to recursively estimate \(\|{\mathbf{v}}-f({\mathbf{q}})\|_2^2\) in the next level of the algorithm. However, since the iterate \({\mathbf{v}}\) does not necessarily have a pre-image under \(f\), this significantly complicates the implementation of the recursion. To this end, we let \({\mathbf{q}}= {\mathbf{q}}_L + {\mathbf{q}}_{L+1}\) and expand this quantity as follows: \[\begin{align} \label{eq:recursion:expansion} \|{\mathbf{v}}- f({\mathbf{q}})\|_2^2 &= \left \| \sum_{i = 1}^{L}\alpha_i \cdot f({\mathbf{q}}_i) - f({\mathbf{q}}) \right\|_2^2 \\ &= \sum_{1 \leq i\leq j \leq L} \left( \alpha_i \cdot \alpha_j \cdot \langle f({\mathbf{q}}_i), f({\mathbf{q}}_j) \rangle \right) - 2 \sum_{i= 1}^{L} \alpha_i \cdot \langle f({\mathbf{q}}_i), f({\mathbf{q}}) \rangle + \|f({\mathbf{q}})\|_2^2\nonumber \end{align}\tag{3}\]

We describe how to compute each of the terms above. First, note that since past queries \({\mathbf{q}}_i \in {\mathcal{L}}\) are fixed, inner products of the form \(\langle f({\mathbf{q}}_i), f({\mathbf{q}}_j) \rangle\) can be computed robustly by simply invoking \(F_p\) estimation sketches on \({\mathbf{q}}_i\), \({\mathbf{q}}_j\), and \({\mathbf{q}}_i - {\mathbf{q}}_j\) (as described earlier). Thus, we focus on estimating terms which involve the evolving portion of the stream \({\mathbf{q}}= {\mathbf{q}}_L + {\mathbf{q}}_{L+1}\). In particular, by the properties of the embedding \(f\), the inner products \(\langle f({\mathbf{q}}_i), f({\mathbf{q}}) \rangle\) appearing in the second term can be expressed as

\[\begin{align} \langle f({\mathbf{q}}_i), f({\mathbf{q}}) \rangle &= \frac{1}{2}\left(\|f({\mathbf{q}}_i)\|_2^2 + \|f({\mathbf{q}})\|_2^2- \|f({\mathbf{q}}_i) - f({\mathbf{q}})\|_2^2 \right) \\ &= \frac{1}{2}\left(\|f({\mathbf{q}}_i)\|_2^2 + \|{\mathbf{q}}_L + {\mathbf{q}}_{L+1}\|_p^p - \| {\mathbf{q}}_i - ({\mathbf{q}}_L + {\mathbf{q}}_{L+1})\|_p^p \right) \\ & = \frac{1}{2} \left(\|f({\mathbf{q}}_i)\|_2^2 + \|f({\mathbf{q}}_L) - f(-{\mathbf{q}}_{L+1})\|_2^2 - \|f({\mathbf{q}}_i-{\mathbf{q}}_L) - f({\mathbf{q}}_{L+1})\|_2^2 \right). \end{align}\]

Likewise, the third term can be written as \(\|f({\mathbf{q}})\|_2^2 = \|{\mathbf{q}}_L + {\mathbf{q}}_{L+1}\|_p^p = \|f({\mathbf{q}}_L) - f(-{\mathbf{q}}_{L+1})\|_2^2\). At this point, note that estimating each of the above norms is a problem of precisely the same form as the original problem, and it may seem as though we must then recursively estimate each of these \(\mathcal{O}\left(L^2\right)\) norms arising from inner products in 3 . In fact, it turns out that with some careful algebraic manipulation, we can reduce the problem to only \(\textit{one}\) recursive call on the squared-norm \(\left \|\sum_{i = 1}^L \alpha_i \cdot f({\mathbf{q}}_i - {\mathbf{q}}_L) - f({\mathbf{q}}_{L+1})\right \|_2^2\), and all remaining terms can be robustly computed by directly using \(F_p\) estimation sketches on previous queries \({\mathbf{q}}_i - {\mathbf{q}}_{L}\) or \({\mathbf{q}}_i\) for \(i \in [L]\). 2.

1.2.1.7 Bounding the additive error.

Let us examine the total error incurred by our estimates in the approach described above. Recall that for any \({\mathbf{w}}, {\mathbf{y}}\in \mathbb{R}^n\) and any \(\varepsilon' > 0\), each inner product \(\langle f({\mathbf{w}}), f({\mathbf{y}}) \rangle\) can be estimated up to error \(\varepsilon' \cdot \left(\|{\mathbf{w}}\|_p^p + \|{\mathbf{y}}\|_p^p + \|{\mathbf{w}}- {\mathbf{y}}\|_p^p \right)\). Now, suppose that the underlying frequency vector \({\mathbf{x}}= {\mathbf{z}}- {\mathbf{q}}\) satisfies \(\|{\mathbf{x}}\|_p^p \leq 10 A\) at all times for some fixed parameter \(A\) 3. Furthermore, suppose that the coefficients \(\alpha_i\) appearing in 2 and 3 are bounded by \(\mathcal{O}\left(1\right)\). Then, by setting \(\varepsilon' = \frac{\varepsilon}{L^2}\), this means that the error of estimating the first term \(\|f({\mathbf{z}}) - {\mathbf{v}}\|_2^2\) via dot products in 2 is roughly \(L^2 \cdot \mathcal{O}\left(\frac{\varepsilon}{L^2} \cdot A\right) \approx \mathcal{O}\left(\varepsilon\right) \cdot A\); by the same argument, we can also ensure that the error due to the second term \(\|{\mathbf{v}}- f({\mathbf{q}})\|_2^2\) is \(\mathcal{O}\left(\varepsilon\right) \cdot A\) as well.

However, this analysis relied on the assumption that the projection of \(f({\mathbf{z}})\) onto \(\mathop{\mathrm{Span}}({\mathcal{L}})\), given by \({\mathbf{v}}= \sum_{i = 1}^L \alpha_i \cdot f({\mathbf{q}}_i)\), has coefficients \(\alpha_i\) bounded by \(\mathcal{O}\left(1\right)\). In fact, it turns out that this is not necessarily true for arbitrary list vectors \({\mathbf{q}}_1,\ldots, {\mathbf{q}}_{L}\). To overcome this, we instead imagine that the list vectors are actually \({\mathbf{u}}_i=f({\mathbf{q}}_i)+\nu\cdot{\mathbf{e}}_{N+i} \in \mathbb{R}^{N + L}\), and let \({\mathcal{L}}' = \{{\mathbf{u}}_i\}_{i \in [L]}\). By scaling, suppose that \(\|{\mathbf{u}}_i\|_2 = 1\) for all \(i \in [L]\), and let \({\mathbf{U}}\) be the matrix whose columns are \({\mathbf{u}}_1,\ldots, {\mathbf{u}}_{L}\). First, we observe that \(\sigma_{\max}({\mathbf{U}}) \leq \|{\mathbf{U}}\|_F \leq \sqrt{L} \cdot \sqrt{\mathcal{O}\left(1\right) + \nu^2} = \mathcal{O}\left(\sqrt{L}\right)\). Moreover, since the \(L \times L\) identity matrix scaled by \(\nu\) is appended in the dimensions after \(N\), we have that \(\sigma_{\min}({\mathbf{U}}) \geq \nu\). Thus, it follows that the condition number of \({\mathbf{U}}\) is \(\kappa = \frac{\sqrt{L}}{\nu} = \frac{L \cdot H^2}{\varepsilon^2}\), and thus the projection of \(f({\mathbf{z}})\) (with \(0\)’s in additional dimensions) onto \(\mathop{\mathrm{Span}}({\mathbf{u}}_1,\ldots, {\mathbf{u}}_{L})\) will have coefficients satisfying \(|\alpha_i| \leq \kappa = \frac{\sqrt{L}}{\nu}\).

With the above observation in mind, we are now ready to define our modified update rule. Note that finding the projection of \(f({\mathbf{z}})\) onto the space spanned by \({\mathbf{u}}_1, \ldots, {\mathbf{u}}_L\) is equivalent to computing \(\mathop{\mathrm{argmin}}_{{\mathbf{u}}'\in\mathop{\mathrm{Span}}({\mathcal{L}}')}\|f({\mathbf{z}})-{\mathbf{u}}'\|_2^2\). However, since we appended the \(L \times L\) identity scaled by \(\nu\) in the added dimensions, this actually corresponds to solving the regularized regression \(\mathop{\mathrm{argmin}}_{{\mathbf{u}}' \in \mathop{\mathrm{Span}}({\mathcal{L}})} \left(\|f({\mathbf{z}}) - {\mathbf{u}}' \|_2^2 + \nu^2 \cdot \|\mathbf{\alpha}\|_2^2\right)\), where \(\alpha \in \mathbb{R}^L\) denotes the coefficient vector of \({\mathbf{u}}'\) in the basis \({\mathcal{L}}= \{f({\mathbf{q}}_i)\}_{i \in [L]}\). As before, all computations in this regularized regression take place in the sketch space by estimating dot products of the form \(\langle f({\mathbf{z}}), f({\mathbf{q}}_i)\rangle\) or \(\langle f({\mathbf{q}}_i), f({\mathbf{q}}_j)\rangle\) up to additive error \(\mathcal{O}\left(\varepsilon\right) \cdot A\). Finally, if \({\mathbf{u}}' = \sum_{ i =1}^L \alpha_i \cdot {\mathbf{u}}_i\) for \({\mathbf{u}}_i \in {\mathcal{L}}'\), we output the coefficients of \({\mathbf{u}}_1 + {\mathbf{u}}'\), which we use to represent the linear combination of our new iterate \({\mathbf{v}}\).

Overall, this ensures that the coefficients \(\alpha_i\) in the linear combinations of 2 and 3 are bounded, and thus we ensure that the total error accrued in estimating all \(\mathcal{O}\left(L^2\right)\) dot products is \(\mathcal{O}\left(\varepsilon\right) \cdot A\) by setting \(\varepsilon' = \frac{\varepsilon}{\kappa \cdot L^2}\) to be the error parameter for each sketch.

1.2.1.8 From additive error to multiplicative error.

We now describe how to convert a robust additive error algorithm \({\mathcal{A}}\) to a robust multiplicative error algorithm \({\mathcal{A}}'\) by stratifying the estimation process across multiple scales.

Recall that the algorithm above outputs estimates with error \(\varepsilon\cdot A\) when the underlying frequency vector \({\mathbf{x}}\) satisfies \(\|{\mathbf{x}}\|_p^p \leq 10 A\). To obtain multiplicative error, we initialize \(K = \mathcal{O}\left(\frac{1}{\varepsilon}\log n\right)\) independent copies \({\mathcal{A}}_1,\ldots, {\mathcal{A}}_K\) of the robust additive-error algorithm, where \({\mathcal{A}}_i\) achieves error \(\varepsilon\cdot (1+\varepsilon)^i\) when \(\|{\mathbf{x}}\|_p^p \leq 10 \cdot (1+\varepsilon)^i\). If we could maintain the property that input vectors to the robust algorithm \({\mathcal{A}}_i\) for scale \(S_i = [(1+\varepsilon)^i, (1+\varepsilon)^{i+1})\) satisfies \(\|{\mathbf{x}}\|_p^p = \Theta{((1+\varepsilon)^i)}\), then at scale \(S_i\), the additive error of the estimator is \(\varepsilon\cdot \Theta((1+\varepsilon)^i)\), which corresponds to a multiplicative \((1+\varepsilon)\)-approximation for all queries for which the \(F_p\) moment lies in \(\Theta((1+\varepsilon)^i)\). To determine the appropriate scale for a given query \({\mathbf{z}}-{\mathbf{q}}\), we begin at the top level \(K\). The estimator at this level provides an additive approximation of \(\varepsilon\cdot\Theta((1+\varepsilon)^K)\), which suffices to determine whether the true value is smaller than \(2\varepsilon\cdot\Theta((1+\varepsilon)^K)\). If this is the case, we can safely proceed to a lower level and repeat the process. A more fine-grained version of this iterative search allows the algorithm to iteratively zoom in on the correct level, ultimately yielding a multiplicative \((1+\varepsilon)\)-approximation across all scales of \(\|{\mathbf{z}}-{\mathbf{q}}\|_p^p\). So, if each of the algorithms \({\mathcal{A}}_i\) is accurate with high probability, \({\mathcal{A}}'\) returns a multiplicative \((1+\varepsilon)\) approximation.

Finally, it remains to show that this new algorithm \({\mathcal{A}}'\) is robust, i.e. each of the \({\mathcal{A}}_i\)’s continue to be accurate even when updates are adaptive. By contradiction, suppose that there exists a strategy \({\mathcal{S}}\) for the adversary to break a particular \({\mathcal{A}}_i\) with non-trivial probability. In that case, we can construct an adaptive attack on \({\mathcal{A}}_i\) by letting the adversary simulate the execution of the algorithm for the remaining scales \({\mathcal{A}}_1,\ldots, {\mathcal{A}}_{i-1}, {\mathcal{A}}_{i+1}, \ldots, {\mathcal{A}}_K\) by itself, and then execute strategy \({\mathcal{S}}\) to break \({\mathcal{A}}_i\). However, this contradicts the robustness of \({\mathcal{A}}_i\), so we conclude that \({\mathcal{A}}'\) is adversarially robust on streams of length \(m = \mathop{\mathrm{poly}}(n)\).

1.2.2 Sketching, EMD, and Clustering↩︎

1.2.2.1 Equivalence between robustness and sketching.

To formalize the connection between adversarial robustness and classical sketching, we use a well-known result by [51], who established that any finite-dimensional normed space \(\mathcal{X}=(\mathbb{R}^n, \|\cdot\|_{\mathcal{X}})\) admitting an efficient classical linear sketch must also admit a low-distortion linear embedding into \(L_p\) for \(p \in\left(\frac{2}{3},1\right)\) (and into \(L_1\) if the norm is closed under sum-product). Because this embedding is a linear map, we can immediately integrate it within our turnstile streaming framework. Specifically, given a static embedding matrix \({\mathbf{A}}\in \mathbb{R}^{M \times n}\), each stream update to the underlying vector \({\mathbf{x}}\) implicitly updates the coordinates of the corresponding vector \({\mathbf{A}}{\mathbf{x}}\) in the embedded space. We can then execute our adversarially robust \(L_p\) estimation algorithm directly on this virtual stream.

The major issue is that the continuous embedding from [51] is existential and not necessarily computable. To make this algorithmic, we operate in an advice model and prove that the continuous embedding can be discretized. Fortunately, by using standard techniques, it can be shown the target dimension of the virtual stream can be upper bounded by \(M = \mathcal{O}\left(n\log n\right)\), and that the entries of \({\mathbf{A}}\) require only \(\mathcal{O}\left(\log n\right)\) bits of precision. Since the space complexity of our robust \(L_p\) approximation algorithm depends only polylogarithmically on \(M\), we can run it on the transformed stream to establish a weak equivalence between classical sketching and adversarial robustness.

1.2.2.2 Derandomizing embeddings for EMD and clustering.

This approach directly gives robust algorithms for important tasks such as approximating the Earth Mover Distance (EMD) over the grid \([\Delta]^d\). In the classical oblivious setting, EMD is estimated by embedding the spatial distributions into \(L_1\) via randomly shifted quadtrees, achieving \(\mathcal{O}\left(d \log \Delta\right)\) distortion [55][57]. However, this randomized embedding \({\mathbf{A}}_s\) only provides a “for each” guarantee, so that an adaptive adversary could observe the algorithm’s outputs, deduce the random shift \({\mathbf{s}}\), and generate updates that force worst-case distortion.

To prevent adversarial attacks against the embedding, we instead completely derandomize the construction. Namely, we define a deterministic embedding \({\mathbf{A}}{\mathbf{x}}= \frac{1}{n} \bigoplus_{s \in [\Delta]^d} {\mathbf{A}}_s{\mathbf{x}}\) that concatenates the scaled linear embeddings induced by all possible \(\Delta^d\) grid shifts simultaneously. By linearity of expectation, the \(L_1\) norm of this concatenated vector exactly matches the expected value over the random shifts, providing a universal “for all” guarantee that holds against any adaptive adversary. While aggregating over all shifts \({\mathbf{s}}\in[\Delta]^d\) blows up the embedding dimension from \(\mathcal{O}\left(n\right)\) to \(M =\mathcal{O}\left(n^2\right)\), where \(n = \Delta^d\), our robust \(F_p\) estimation algorithm again only uses space polylogarithmic in \(M\).

We naturally extend this robust EMD primitive to the \(k\)-median clustering problem, which can be formulated as the Earth Mover Distance between the data distribution \(\mu\) and an assignment vector \(\nu_{{\mathcal{C}}}\) that routes mass to the nearest centers in a candidate set \({\mathcal{C}}\). Using our deterministic \(L_1\) embedding, we can dynamically maintain a robust sketch of the dataset. Because the embedding is deterministic and universally preserves distances, we can safely enumerate over a standard collection of candidate center sets and evaluate their robust costs on the fly, achieving the first robust algorithm for \(k\)-median clustering on turnstile streams.

2 Preliminaries↩︎

2.1 Notation↩︎

Throughout, we write \([n]\) to refer to the set of integers \(\{1,2,\ldots,n\}\) for any positive integer \(n\). The notation \(\mathop{\mathrm{poly}}(n)\) refers to some polynomial in \(n\) with fixed, but unspecified, degree. An event is said to happen with high probability if its likelihood is at least \(1 - \frac{1}{\mathop{\mathrm{poly}}(n)}\). We typically use normal font for scalars and bold font for vectors or matrices.

We typically use normal font for scalars and bold font for vectors or matrices. For vectors \({\mathbf{x}}, {\mathbf{y}}\in \mathbb{R}^n\), we write \(\langle {\mathbf{x}}, {\mathbf{y}}\rangle\) for the standard Euclidean inner product. For \(p > 0\), the \(L_p\) norm (or quasi-norm when \(p < 1\)) of \({\mathbf{x}}\in \mathbb{R}^n\) is defined as \[\|{\mathbf{x}}\|_p = \left(\sum_{i=1}^n |x_i|^p\right)^{1/p}.\] For a vector \({\mathbf{x}}\) and a subspace \(V\), \(\mathop{\mathrm{Proj}}_V({\mathbf{x}})\) denotes the orthogonal projection of \({\mathbf{x}}\) onto \(V\), i.e., the vector in \(V\) closest to \({\mathbf{x}}\) in Euclidean distance. For a set of vectors \(S\), \(\mathop{\mathrm{Span}}(S)\) denotes the linear span of \(S\), i.e., all linear combinations of vectors in \(S\).

We use \(\bigoplus\) to denote vector concatenation (direct sum). For vectors \({\mathbf{x}}^{(1)} \in \mathbb{R}^{n_1}, \ldots, {\mathbf{x}}^{(k)} \in \mathbb{R}^{n_k}\), we define \[\bigoplus_{i=1}^k {\mathbf{x}}^{(i)} = ({\mathbf{x}}^{(1)}, \ldots, {\mathbf{x}}^{(k)}) \in \mathbb{R}^{n_1 + \cdots + n_k}.\]

We use \(\circ\) to denote column-wise concatenation. For vectors \({\mathbf{a}}_1, \ldots, {\mathbf{a}}_k \in \mathbb{R}^n\), the matrix \({\mathbf{a}}_1 \circ \cdots \circ {\mathbf{a}}_k \in \mathbb{R}^{n \times k}\) is defined by taking \({\mathbf{a}}_j\) as its \(j\)-th column. For a matrix \({\mathbf{A}}\in \mathbb{R}^{n \times k}\), we write \({\mathbf{A}}^\dagger\) to denote its Moore-Penrose pseudoinverse, defined as the unique matrix satisfying \[{\mathbf{A}}{\mathbf{A}}^\dagger {\mathbf{A}}= {\mathbf{A}}, \quad {\mathbf{A}}^\dagger {\mathbf{A}}{\mathbf{A}}^\dagger = {\mathbf{A}}^\dagger, \quad ({\mathbf{A}}{\mathbf{A}}^\dagger)^\top = {\mathbf{A}}{\mathbf{A}}^\dagger, \quad ({\mathbf{A}}^\dagger {\mathbf{A}})^\top = {\mathbf{A}}^\dagger {\mathbf{A}}.\] When \({\mathbf{A}}\) has full column rank, this reduces to \({\mathbf{A}}^\dagger = ({\mathbf{A}}^\top {\mathbf{A}})^{-1} {\mathbf{A}}^\top\).

2.2 Preliminaries for Small Moment Estimation↩︎

We recall the existence of an embedding of \(F_p\) into \(F_2\).

theoremthmembed [52][54] For each \(p\in(0,2)\), there exists an isometric embedding \(f\) onto a Hilbert space \(H\), such that \[\|{\mathbf{u}}-{\mathbf{v}}\|_p^p=\|f({\mathbf{u}})-f({\mathbf{v}})\|_2^2,\qquad \|f(\mathbf{0})\|_2=0.\]

Similarly, we describe an embedding for \(F_0\) into \(F_2\) as follows. Given a vector \({\mathbf{x}}\in\mathbb{R}^n\), suppose all coordinates of \(x\) are bounded within \([-m,-(m-1),\ldots,-1,0,1,\ldots,m-1,m]\). Now for each coordinate \(i \in [n]\) and each possible value \(a\) that coordinate \(i\) may take, introduce a distinct orthonormal basis vector \(e_{i,a}\) in a high-dimensional Euclidean space. Then, we define \[g({\mathbf{x}}) = \frac{1}{\sqrt{2}}\sum_{i=1}^n e_{i, x_i},\] so that each coordinate of \({\mathbf{x}}\) is represented by a one-hot vector indicating its value. Now for any two vectors \({\mathbf{x}},{\mathbf{y}}\) whose coordinates are within this range, we then have \[\begin{align} \|g({\mathbf{x}}) - g({\mathbf{y}}) \|_2^2 &= \frac{1}{2}\sum_{i=1}^n \| e_{i, x_i} - e_{i, y_i} \|_2^2\\ &= \frac{1}{2}\cdot 2 \cdot |\{ i : x_i \neq y_i \}|\\ &= \|{\mathbf{x}}- {\mathbf{y}}\|_0. \end{align}\]

However, note that for \(p=0\), we deterministically have \(\|g({\mathbf{x}})\|_2^2=\frac{n}{2}\) for all \({\mathbf{x}}\in\mathbb{R}^n\). To account for this, we further define the embedding by

\[f({\mathbf{x}}) \coloneq g({\mathbf{x}}) - g(\mathbf{0})\]

In particular, observe that this embedding preserves the \(L_0\) norm as before, and maps \(\mathbf{0}\) to \(\mathbf{0}\): \[\|f({\mathbf{x}}) - f({\mathbf{y}})\|_2^2 = \|{\mathbf{x}}- {\mathbf{y}}\|_0 \textrm{ and } \|f(\mathbf{0})\|_2^2 = 0\]

Thus, the one-hot encoding yields an isometric embedding of \((\mathbb{R}^n, \|\cdot\|_0)\) into \((\mathbb{R}^D, \|\cdot\|_2^2)\), where each differing coordinate contributes a fixed amount to the squared Euclidean distance. Hence, we have:

theoremthmembedlzero There exists an isometric embedding \(f\) from \(\mathbb{R}^n\) onto a Hilbert space \(H\), such that \[\|{\mathbf{u}}-{\mathbf{v}}\|_0=\|f({\mathbf{u}})-f({\mathbf{v}})\|_2^2,\qquad \|f(\mathbf{0})\|_2=0.\]

Next, we recall oblivious turnstile streaming algorithms for \(F_p\) moment estimation and distinct element estimation:

Theorem 1. [35][39] Given \(p\in[0,2]\) and \(\varepsilon\in(0,1)\), there exists a linear sketching turnstile streaming algorithm \({\mathsf{FPSmall}}\) that uses \(\mathcal{O}\left(\frac{1}{\varepsilon^2}\log^2 n \log \frac{1}{\delta}\right)\) bits of space on a universe of size \(n\) and a stream of length \(m=\mathop{\mathrm{poly}}(n)\) and with probability \(1-\delta\), outputs a \((1+\varepsilon)\)-approximation to the \(F_p\) moment.

None

Figure 1: Estimator for dot product in the embedded space..

We now show the correctness of the algorithm \({\mathsf{DotEst}}\), which estimates the dot product of two vectors in the embedded space.

Lemma 1. With high probability, \({\mathsf{DotEst}}\) outputs an estimate to \(\langle f({\mathbf{x}}),f({\mathbf{q}})\rangle\) with additive error \(\varepsilon\cdot\|{\mathbf{x}}\|_p^p+\varepsilon\cdot\|{\mathbf{q}}\|_p^p+\varepsilon\cdot\|{\mathbf{x}}-{\mathbf{q}}\|_p^p\). The algorithm uses \(\mathcal{O}\left(\frac{1}{\varepsilon^2}\log^3 n\right)\) bits of space.

Proof. By the correctness of \({\mathsf{FPSmall}}\), we have: \[\begin{align} \left\lvert\widetilde{X}-\|{\mathbf{x}}\|_p^p\right\rvert&\le\varepsilon\cdot\|{\mathbf{x}}\|_p^p\\ \left\lvert\widetilde{Q}-\|{\mathbf{q}}\|_p^p\right\rvert&\le\varepsilon\cdot\|{\mathbf{q}}\|_p^p\\ \left\lvert\widetilde{D}-\|{\mathbf{x}}-{\mathbf{q}}\|_p^p\right\rvert&\le\varepsilon\cdot\|{\mathbf{x}}-{\mathbf{q}}\|_p^p. \end{align}\] By triangle inequality, it follows that \[\left\lvert\widetilde{X}+\widetilde{Q}-\widetilde{D}-\|{\mathbf{x}}\|_p^p-\|{\mathbf{q}}\|_p^p+\|{\mathbf{x}}-{\mathbf{q}}\|_p^p\right\rvert\le\varepsilon\cdot\|{\mathbf{x}}\|_p^p+\varepsilon\cdot\|{\mathbf{q}}\|_p^p+\varepsilon\cdot\|{\mathbf{x}}-{\mathbf{q}}\|_p^p.\] By [thm:embed], we have \[\|{\mathbf{x}}-{\mathbf{q}}\|_p^p=\|f({\mathbf{x}})-f({\mathbf{q}})\|_2^2=\|f({\mathbf{x}})\|_2^2+\|f({\mathbf{q}})\|_2^2-2\cdot\langle f({\mathbf{x}}),f({\mathbf{q}})\rangle.\] Hence by [thm:embed], \[\begin{align} \langle f({\mathbf{x}}),f({\mathbf{q}})\rangle&=\frac{1}{2}\left(\|f({\mathbf{x}})\|_2^2+\|f({\mathbf{q}})\|_2^2-\|f({\mathbf{x}})-f({\mathbf{q}})\|_2^2\right)\\ &=\frac{1}{2}\left(\|{\mathbf{x}}\|_p^p+\|{\mathbf{q}}\|_p^p-\|{\mathbf{x}}-{\mathbf{q}}\|_p^p\right). \end{align}\] Therefore, \[\left\lvert\frac{1}{2}(\widetilde{X}+\widetilde{Q}-\widetilde{D})-\langle f({\mathbf{x}}),f({\mathbf{q}})\rangle\right\rvert\le\varepsilon\cdot\|{\mathbf{x}}\|_p^p+\varepsilon\cdot\|{\mathbf{q}}\|_p^p+\varepsilon\cdot\|{\mathbf{x}}-{\mathbf{q}}\|_p^p.\] The space complexity follows from requiring \((1+\varepsilon)\)-approximation to the \(F_p\) moment, using the subroutine from 1. ◻

Lemma 2. Let \({\mathbf{A}}\) be the \(n \times L\) matrix where the \(i\)-th column is \({\mathbf{A}}_i = {\mathbf{q}}_i\). Let \({\mathbf{y}}= \arg \min_{{\mathbf{x}}\in \mathbb{R}^L} \|{\mathbf{A}}{\mathbf{x}}- {\mathbf{z}}\|_2^2\) subject to the constraint \(\sum_{i = 1}^L x_i = 1\). Then, \(\|{\mathbf{A}}{\mathbf{y}}\|_2 \leq \|{\mathbf{z}}- {\mathbf{q}}_1\|_2 + \|{\mathbf{z}}\|_2\).

Proof. Define matrix \({\mathbf{B}}\in \mathbb{R}^{n \times L}\) whose \(i\)-th column is given by \({\mathbf{B}}_i = {\mathbf{q}}_i - {\mathbf{q}}_1\). Note that for any \({\mathbf{x}}\) such that \(\sum_{i =1}^L x_i = 1\), we have \[{\mathbf{B}}{\mathbf{x}}= \sum_{i = 1}^L ({\mathbf{q}}_i - {\mathbf{q}}_1) {\mathbf{x}}_i = \sum_{i = 1}^L x_i {\mathbf{q}}_i - \left(\sum_{i = 1}^L x_i \right) {\mathbf{q}}_1 = {\mathbf{A}}{\mathbf{x}}- {\mathbf{q}}_1.\] Consequently, it follows that \({\mathbf{y}}= \arg \min_{{\mathbf{x}}\in \mathbb{R}^L} \|{\mathbf{B}}{\mathbf{x}}- ({\mathbf{z}}- {\mathbf{q}}_1)\|_2^2\). Since \({\mathbf{y}}\) is optimal, \[\|{\mathbf{B}}{\mathbf{y}}- ({\mathbf{z}}- {\mathbf{q}}_1)\|_2 \leq \|{\mathbf{z}}- {\mathbf{q}}_1\|_2.\] Thus, we have that \[\|{\mathbf{A}}{\mathbf{y}}\|_2 = \|{\mathbf{B}}{\mathbf{y}}+ {\mathbf{q}}_1\|_2 \leq \|{\mathbf{B}}{\mathbf{y}}- ({\mathbf{z}}- {\mathbf{q}}_1)\|_2 + \|{\mathbf{z}}\|_2 \leq \|{\mathbf{z}}- {\mathbf{q}}_1\|_2 + \| {\mathbf{z}}\|_2,\] as desired. ◻

3 Robust \(F_p\) Algorithm for \(p\in[0,2)\)↩︎

In this section, we present our adversarially robust algorithm for \(F_p\) moment estimation on insertion-deletion streams, for \(p\in[0,2)\). Our goal is to generalize the estimator, corrector, and learner framework developed for \(F_2\) moment estimation in [32]. The key challenge is that \(L_p\) spaces for \(p \neq 2\) are no longer Hilbert spaces, i.e., there is no inner product that induces the \(L_p\) norm, so geometric reasoning based on orthogonality or the Pythagorean theorem does not apply. Instead, our analysis relies on the existence of an embedding of \(L_p^p\) into \(L_2^2\).

3.1 Subroutines for Small Moment Estimation↩︎

We next describe an algorithm for \(L_p\) norm estimation, with \(p\in[0,2)\). Utilizing [thm:embed], there exists an embedding \(f\) from \(F_p\) to \(F_2\), so that we have \[\|{\mathbf{x}}-{\mathbf{y}}\|_p^p=\|f({\mathbf{x}})-f({\mathbf{y}})\|_2^2=\|f({\mathbf{x}})\|_2^2-2\langle f({\mathbf{x}}),f({\mathbf{y}})\rangle+\|f({\mathbf{y}})\|_2^2.\]

Note that for all \(p \in [0,2)\) we have \(f(\mathbf{0})=\mathbf{0}\), so that \[\|f({\mathbf{x}})\|_2^2=\|f({\mathbf{x}})-f(\mathbf{0})\|_2^2=\|{\mathbf{x}}-\mathbf{0}\|_p^p=\|{\mathbf{x}}\|_p^p\] and thus \[\|{\mathbf{x}}-{\mathbf{y}}\|_p^p=\|{\mathbf{x}}\|_p^p-2\langle f({\mathbf{x}}),f({\mathbf{y}})\rangle+\|{\mathbf{y}}\|_p^p.\] Then it follows that we can use \(F_p\) estimation algorithms to estimate \(\|{\mathbf{x}}\|_p^p\) and \(\|{\mathbf{y}}\|_p^p\). Moreover, since \(\|{\mathbf{x}}-{\mathbf{y}}\|_p^p=\|f({\mathbf{x}})-f({\mathbf{y}})\|_2^2\), then we can further estimate \(2\langle f({\mathbf{x}}),f({\mathbf{y}})\rangle\) using \(F_p\) estimation algorithms, such as in \({\mathsf{DotEst}}\).

In this subsection, we design and analyze a robust algorithm which estimates the \(F_p\) moment up to \(\varepsilon\cdot A\) additive error when the underlying input vector satisfies \(\|{\mathbf{x}}\|_p^p = \mathcal{O}\left(A\right)\). Then, in 3.2 we show how to modify our \(F_p\) estimation algorithm to obtain the \((1+\varepsilon)\) multiplicative error guarantee.

3.1.0.1 Estimator, corrector, and learner.

As in [32], we have a learner that maintains an approximation \({\mathbf{v}}\) to \(f({\mathbf{z}})\). By analogy, we can update \({\mathbf{v}}\) by adding \(\varepsilon\cdot ({\mathbf{v}}+ f({\mathbf{q}}))\) each time that the estimator is incorrect on a query \({\mathbf{q}}\); however, in this setting, this update rule may result in large coefficients in the linear combination \({\mathbf{v}}= \sum_{i \in [L]} \alpha_i \cdot f({\mathbf{q}}_i)\). Thus, we modify the previous update rule as follows: we add the vector \({\mathbf{q}}\) to a list \({\mathcal{L}}_i\) and solve a kernel regression problem to find the vector \({\mathbf{v}}\) in the span of \({\mathcal{L}}_i\) that best approximates \({\mathbf{z}}\). Crucially, we embed all vectors into \(L_2\) space so that it suffices to solve an \(L_2\) regression problem in the kernel space, where we can compute the closed-form solution using a linear combination of dot products of either the form \(\langle f({\mathbf{z}}),f({\mathbf{q}}_i)\rangle\) or \(\langle f({\mathbf{q}}_i),f({\mathbf{q}}_j)\rangle\), which can be computed using \(\mathcal{O}\left(\frac{1}{\varepsilon^2} \log^3 n\right)\) bits of space by 1.

Figure 2: {\mathsf{EstLevel}}(i) for F_p moment estimation
Figure 3: {\mathsf{MaintainList}}(i) for F_p moment estimation

Formally, the procedure \({\mathsf{EmbedEst}}\) in 4 computes the squared distance \(\|f({\mathbf{z}})-{\mathbf{v}}\|_2^2\) in the kernel space using estimates of the norms and pairwise dot products. The procedure \({\mathsf{EstLevel}}\) in 2 then recursively estimates the \(F_p\) moment at each recursive level \(i\) by combining the embedded approximation from \({\mathsf{EmbedEst}}\) with the estimate from the previous level. Meanwhile, \({\mathsf{MaintainList}}\) in 3 maintains a list \({\mathcal{L}}_i\) at level \(i\), which includes each query vector \({\mathbf{q}}\) for which the corrector flags the output from the estimator as being inaccurate. When this occurs, the subroutine \({\mathsf{GetIterate}}\) in 5 computes \({\mathbf{v}}\) by finding a near-optimal approximation of \(f({\mathbf{z}})\) in the span of the list \({\mathcal{L}}_i\).

3.1.0.2 Recursion.

In the top-level of the algorithm, we use the \(\mathsf{DotEst}\) subroutine to estimate \(\|f({\mathbf{z}}) - {\mathbf{v}}\|_2^2\). Following the robust \(L_2\) algorithm of [32], we need to recursively compute the remaining quantity \(\|{\mathbf{v}}- f({\mathbf{q}})\|_2^2\) in the next level, where the evolving portion of the stream \({\mathbf{q}}= {\mathbf{q}}_L + {\mathbf{q}}_{L+1}\) is divided into blocks which must be sketched independently. Unfortunately, we do not have access to the sketch of \({\mathbf{v}}\) in the embedded space, and in fact, \({\mathbf{v}}\) may not have a pre-image in the original space. This significantly complicates our implementation of the recursion and related computations. In the following lemma, we show that all terms of \(\|{\mathbf{v}}- f({\mathbf{q}})\|_2^2\) can be computed robustly, and that it suffices to recursively compute only one squared-norm.

Lemma 3. At each level \(i\) of the recursion in 2, \(Q_i = {\mathsf{EstLevel}}(i-1)\) executes a single recursive call to estimate the squared norm \(\left \|\sum_{i = 1}^L \alpha_i f({\mathbf{q}}_i - {\mathbf{q}}_{L}) - f({\mathbf{q}}_{L + 1})\right \|_2^2\), where \({\mathcal{L}}_i = \{f({\mathbf{q}}_i)\}_{i \in [L]}\) are the previous queries on which the estimator was incorrect and the current iterate is \({\mathbf{v}}= \sum_{i = 1}^L \alpha_i\cdot f({\mathbf{q}}_i)\).

Proof. We expand \(\|{\mathbf{v}}- f({\mathbf{q}})\|_2^2\) and describe how each term can be computed robustly. \[\begin{align} \|{\mathbf{v}}- f({\mathbf{q}})\|_2^2&= \left\|\sum_{i \in [L]} \alpha_i \cdot f({\mathbf{q}}_i) - f({\mathbf{q}}) \right\|_2^2 \\ & = \sum_{1 \leq i,j \leq L} \left(\alpha_i \cdot \alpha_j \cdot \langle f({\mathbf{q}}_i), f({\mathbf{q}}_j) \rangle \right) - 2 \sum_{i \in [L]} \alpha_i \langle f({\mathbf{q}}_i), f({\mathbf{q}}) \rangle + \|f({\mathbf{q}})\|_2^2 \end{align}\] We consider each of the three types of terms above. We begin with the simplest part: note that since past queries \({\mathbf{q}}_i \in {\mathcal{L}}\) are fixed, the inner products of the form \(\langle f({\mathbf{q}}_i), f({\mathbf{q}}_j) \rangle\) can be computed robustly by invoking the \({\mathsf{DotEst}}\) subroutine directly.

Next, we can write the last two terms as follows: \[\begin{align} -2\sum_{i \in [L]} \alpha_i \langle f({\mathbf{q}}_i), f({\mathbf{q}}) \rangle + \|f({\mathbf{q}})\|_2^2 &= - \sum_{i = 1}^L \alpha_i \left(\|f({\mathbf{q}}_i)\|_2^2 + \|f({\mathbf{q}})\|_2^2 - \|f({\mathbf{q}}_i) - f({\mathbf{q}})\|_2^2 \right) + \|f({\mathbf{q}})\|_2^2 \\ & = \sum_{i= 1}^L \alpha_i \|f({\mathbf{q}}_i) - f({\mathbf{q}})\|_2^2 - \sum_{i = 1}^L \alpha_i \|f({\mathbf{q}}_i)\|_2^2 + \left(1-\sum_{i = 1}^L \alpha_i\right) \cdot \|f({\mathbf{q}})\|_2^2 \end{align}\]

The term \(\sum_{i = 1}^L \alpha_i \cdot \|f({\mathbf{q}}_i)\|_2^2\) consists only of previous fixed queries \({\mathbf{q}}_i \in {\mathcal{L}}\) and thus can be computed directly by using \(\mathsf{FPSmall}\) sketches. Additionally, since the coefficients of \({\mathbf{z}}' = \sum_{i = 1}^L \alpha_i f({\mathbf{q}}_i)\) satisfy \(\sum_{i = 1}^L \alpha_i = 1\), the third term above is identically zero. Therefore, it suffices to robustly compute the value of \(\sum_{i = 1}^L \alpha_i \|f({\mathbf{q}}_i) - f({\mathbf{q}})\|_2^2\). To this end, observe that since \(f\) is an isometric embedding into \(L_2^2\), we have that \[\|f({\mathbf{q}}_i) - f({\mathbf{q}}) \|_2^2 = \|{\mathbf{q}}_i - {\mathbf{q}}_L - {\mathbf{q}}_{L+1}\|_p^p = \|f({\mathbf{q}}_i - {\mathbf{q}}_L) -f({\mathbf{q}}_{L+1})\|_2^2.\]

Thus, the remaining term can be expressed as \[\begin{align} \sum_{i = 1}^L \alpha_i \cdot \|f({\mathbf{q}}_i) - f({\mathbf{q}})\|_2^2 &= \sum_{i = 1}^L \alpha_i \cdot \|f({\mathbf{q}}_i - {\mathbf{q}}_L) - f({\mathbf{q}}_{L+1})\|_2^2 \\ &= \sum_{i =1}^L \alpha_i \cdot \|f({\mathbf{q}}_i - {\mathbf{q}}_L)\|_2^2 - 2 \left \langle \sum_{i = 1}^L \alpha_i f({\mathbf{q}}_i - {\mathbf{q}}_L), f({\mathbf{q}}_{L+1}) \right \rangle + \|f({\mathbf{q}}_{L+1})\|_2^2. \end{align}\] At this point, we recall that our \(L_2\) algorithm initializes a new block each time that the estimator at that level is inaccurate. By construction, we begin a new block every time that a query is added to the list, so in particular \({\mathbf{q}}_L \in {\mathcal{L}}\) and \(\{{\mathbf{q}}_i - {\mathbf{q}}_L\}_{i \in [L]}\) and \({\mathbf{q}}_{L+1}\) can be sketched using independent sketches. Moreover, each \({\mathbf{q}}_i - {\mathbf{q}}_{L}\) is a fixed vector so we can simply use \(\mathsf{FPSmall}\) to estimate each of the norms \(\|f({\mathbf{q}}_i - {\mathbf{q}}_L)\|_2^2\). We consider the last two terms: \[\begin{align} &- 2 \left \langle \sum_{i = 1}^L \alpha_i f({\mathbf{q}}_i - {\mathbf{q}}_L), f({\mathbf{q}}_{L+1}) \right \rangle + \|f({\mathbf{q}}_{L+1})\|_2^2 \\ & = \left \|\sum_{i = 1}^L \alpha_i f({\mathbf{q}}_i - {\mathbf{q}}_L) - f({\mathbf{q}}_{L+1}) \right \|_2^2 - \|f({\mathbf{q}}_{L+1})\|_2^2 - \left \|\sum_{i = 1}^L \alpha_i f({\mathbf{q}}_i - {\mathbf{q}}_L) \right \|_2^2 + \|f({\mathbf{q}}_{L+1})\|_2^2 \\ & = \left \|\sum_{i = 1}^L \alpha_i f({\mathbf{q}}_i - {\mathbf{q}}_L) - f({\mathbf{q}}_{L + 1}) \right \|_2^2 - \left \|\sum_{i = 1}^L \alpha_i f({\mathbf{q}}_i - {\mathbf{q}}_L) \right \|_2^2 \end{align}\] As before, the second term only depends on the fixed vectors \(\{{\mathbf{q}}_i - {\mathbf{q}}_L\}_{i \in [L]}\) so it can be estimated by invoking the \(\mathsf{DotEst}\) subroutine. Finally, we can recursively estimate the first term by applying our robust \(L_p\) algorithm. ◻

Remark 2. The input to the recursion at each level will be of the form \[\left\|\sum_{i = 1}^L \alpha_i \cdot f({\mathbf{q}}_i - {\mathbf{q}}_L) - f({\mathbf{q}}_{L+1})\right\|_2^2,\] and in particular the estimator which is computed in the next level is given by \[\left\|\sum_{ i = 1}^L \alpha_i \cdot f({\mathbf{q}}_i - {\mathbf{q}}_L) - {\mathbf{v}}'\right\|_2^2 + \|{\mathbf{v}}' - f({\mathbf{q}}_{L+1})\|_2^2,\] where \({\mathbf{v}}'\) is the iterate at the next level. Importantly, note that \({\mathbf{v}}' = \sum_{i = 1}^L \beta_i \cdot f({\mathbf{q}}_i')\)s represents the projection of \(\sum_{i = 1}^L \alpha_i \cdot f({\mathbf{q}}_i - {\mathbf{q}}_L)\) onto the list of previous incorrect queries \(\{{\mathbf{q}}_i'\}_{i \in [L']}\) of the next level, and can be estimated by computing \(\mathcal{O}\left(L^2\right)\) pair-wise inner products between list vectors in the adjacent levels.

In order to implement the corrector at each level of the recursion, in 4 we show that the input to the recursion at each level has bounded norm.

Figure 4: {\mathsf{EmbedEst}}({\mathbf{z}},{\mathbf{v}}) for F_p moment estimation
Figure 5: {\mathsf{GetIterate}}({\mathbf{z}},{\mathcal{L}}_i) for F_p moment estimation

Lemma 4 (Bounding the norm). For any level \(k \in [H]\), let \({\mathbf{w}}_k\) be the input to the recursion, let \({\mathbf{v}}\) be the iterate at level \(k\) which approximates \(f({\mathbf{z}})\). Then \(\|{\mathbf{w}}_k\|_2^2 \leq \|{\mathbf{z}}\|_p^p + \mathcal{O}\left(A\right)\).

Proof. At each level \(k \in [H]\), the input to the recursion at the next level is \[\|{\mathbf{w}}_k\|_2^2 = \left \|\sum_{i = 1}^{L} \alpha_i f({\mathbf{q}}_i - {\mathbf{q}}_L) - f({\mathbf{q}}_{L+1}) \right \|_2^2,\] where \({\mathcal{L}}_i = \{f({\mathbf{q}}_i)\}_{i = 1}^L\) denotes the list at level \(k\). Furthermore, recall that \({\mathbf{v}}= \sum_{i = 1}^L \alpha_i \cdot f({\mathbf{q}}_i)\) is the projection of \(f({\mathbf{z}}- {\mathbf{q}}_1)\) onto the subspace spanned by the set of list vectors \(f({\mathbf{q}}_i)\) for \(i \in [L]\), and by 2 we have \(\sum_{i = 1}^L \alpha_i = 1\). Then, we have

\[\begin{align} \left \|\sum_{i = 1}^L \alpha_i f({\mathbf{q}}_i - {\mathbf{q}}_L) \right \|_2^2 &= \sum_{i,j = 1}^{L} \alpha_i \cdot \alpha_j \langle f({\mathbf{q}}_i- {\mathbf{q}}_L), f({\mathbf{q}}_j - {\mathbf{q}}_L)\rangle \\ &= \frac{1}{2} \sum_{i,j = 1}^{L} \alpha_i\cdot \alpha_j \left(\|f({\mathbf{q}}_i) - f({\mathbf{q}}_L)\|_2^2 + \|f({\mathbf{q}}_j) - f({\mathbf{q}}_L)\|_2^2 - \|f({\mathbf{q}}_i) - f({\mathbf{q}}_j)\|_2^2 \right) \\ &= \frac{1}{2} \sum_{i, j = 1}^L \left(-2 \langle f({\mathbf{q}}_i), f({\mathbf{q}}_L) \rangle - 2\langle f({\mathbf{q}}_j), f({\mathbf{q}}_L) \rangle + 2 \langle f({\mathbf{q}}_i), f({\mathbf{q}}_j) \rangle + 2 \|f({\mathbf{q}}_L)\|_2^2 \right) \\ &= \sum_{i,j = 1}^L \alpha_i \cdot \alpha_j \langle f({\mathbf{q}}_i), f({\mathbf{q}}_j) \rangle - 2 \sum_{i = 1}^L \alpha_i \cdot \langle f({\mathbf{q}}_i), f({\mathbf{q}}_L) \rangle + \|f({\mathbf{q}}_L)\|_2^2 \\ &= \left\|\sum_{i = 1}^L \alpha_i f({\mathbf{q}}_i) - f({\mathbf{q}}_L)\right\|_2^2 = \|{\mathbf{v}}- f({\mathbf{q}}_L)\|_2^2. \end{align}\]

In particular, it follows that

\[\left \| \sum_{i = 1}^L \alpha_i \cdot f({\mathbf{q}}_i - {\mathbf{q}}_L) \right \|_2 = \|{\mathbf{v}}- f({\mathbf{q}}_L)\|_2 \leq \|{\mathbf{v}}\|_2 + \|f({\mathbf{q}}_L)\|_2.\] Recall that by assumption, we have \(\|f({\mathbf{q}}_L)\|_2 = \mathcal{O}\left(\sqrt{A}\right)\) and \(\|f({\mathbf{q}}_{L+1})\|_2 = \mathcal{O}\left(\sqrt{A}\right)\). By triangle inequality, we conclude that

\[\begin{align} \left \|\sum_{i = 1}^L \alpha_i f({\mathbf{q}}_i - {\mathbf{q}}_L)- f({\mathbf{q}}_{L+1}) \right \|_2 &\leq \|{\mathbf{v}}- f({\mathbf{q}}_L)\|_2 + \|f({\mathbf{q}}_{L+1})\|_2 \\ & \leq \|{\mathbf{v}}\|_2 + \|f({\mathbf{q}}_L)\|_2 + \|f({\mathbf{q}}_{L+1})\|_2 \\ & \leq \|{\mathbf{v}}\|_2 + \mathcal{O}\left(\sqrt{A}\right) \end{align}\]

Thus, \(\left \|\sum_{i = 1}^L \alpha_i f({\mathbf{q}}_i - {\mathbf{q}}_L) - f({\mathbf{q}}_{L+1}) \right \|_2^2 \leq \|{\mathbf{v}}\|_2^2 + \mathcal{O}\left(A\right) + \|{\mathbf{v}}\|_2 \cdot \mathcal{O}\left(\sqrt{A}\right)\) . By 2 we know that \(\|{\mathbf{v}}\|_2^2 \leq \left(\|f({\mathbf{z}})\|_2 + \|f({\mathbf{z}}) - f({\mathbf{q}}_1)\|_2\right)^2 \leq \|{\mathbf{z}}\|_p^p + \mathcal{O}\left(A\right)\), which implies the claim. ◻

3.1.0.3 Update rule and regularized regression.

Next, we discuss our modified update rule for the iterate \({\mathbf{v}}\) in each level of the algorithm. In particular, let \({\mathcal{L}}= \{f({\mathbf{q}}_i)\}_{i \in [L]}\) be the list of queries on which the algorithm was previously inaccurate. Then, we note that the \(L_2\) algorithm of [32] can be implemented by following the alternative update rule \({\mathbf{v}}= \arg \min_{{\mathbf{y}}\in \mathbb{R}^L}{\|{\mathbf{U}}{\mathbf{y}}- f({\mathbf{z}})\|_2^2}\), where \({\mathbf{U}}\) is the matrix with columns \(f({\mathbf{q}}_i)\). Then, by expressing \({\mathbf{v}}= \sum_{i = 1}^L \alpha_i \cdot f({\mathbf{q}}_i)\), we can approximate the estimator \(\|f({\mathbf{z}}) - {\mathbf{v}}\|_2^2 + \|{\mathbf{v}}- f({\mathbf{q}})\|_2^2\) by estimating the necessary inner products of the form \(\langle f({\mathbf{z}}), f({\mathbf{q}}_i) \rangle\) or \(\langle f({\mathbf{q}}_i), f({\mathbf{q}}_j) \rangle\) for \(i, j \in [L]\) via the \(\mathsf{DotEst}\) subroutine. For instance, for the first term of the estimator, we have

\[\|f({\mathbf{z}}) - {\mathbf{v}}\|_2^2 = \|f({\mathbf{z}})\|_2^2 - 2 \sum_{i = 1}^L \alpha_i \cdot \langle f({\mathbf{z}}), f({\mathbf{q}}_i) \rangle + \sum_{1 \leq i,j \leq L} \alpha_i \cdot \alpha_j \langle f({\mathbf{q}}_i), f({\mathbf{q}}_j) \rangle.\]

Similarly, by 3, the second term \(\|{\mathbf{v}}- f({\mathbf{q}})\|_2^2\) can be expanded into inner products involving the previous fixed vectors \(f({\mathbf{q}}_i)\) and \(f({\mathbf{z}})\), and a single squared norm on which we recurse. By 1, each inner product \(\langle f({\mathbf{z}}), f({\mathbf{q}}_i) \rangle\) can be estimated with additive error \(\varepsilon\cdot \left(\|{\mathbf{z}}\|_p^p + \|{\mathbf{q}}_i\|_p^p + \|{\mathbf{z}}- {\mathbf{q}}_i\|_p^p \right)\) by using \(F_p\) estimation sketches, and similarly, \(\langle f({\mathbf{q}}_i), f({\mathbf{q}}_j) \rangle\) can be estimated with additive error \(\varepsilon\cdot \left(\|{\mathbf{q}}_i\|_p^p + \|{\mathbf{q}}_j\|_p^p + \|{\mathbf{q}}_i - {\mathbf{q}}_j\|_p^p \right)\). By assumption, we have that \(\|{\mathbf{z}}\|_p^p = \Theta(A)\), \(\|{\mathbf{z}}- {\mathbf{q}}_i\|_p^p = \Theta(A)\) and all queries \({\mathbf{q}}_i\) also satisfy \(\|{\mathbf{q}}_i\|_p^p \leq \mathcal{O}\left(A\right)\), so each such inner product can be approximated up to \(\varepsilon\cdot A\) additive error. Therefore, in order to upper bound the total error incurred by our estimates via \(\mathsf{DotEst}\), we must ensure that the coefficients \(\alpha_i\) are bounded by \(\mathop{\mathrm{poly}}\left(\frac{1}{\varepsilon}, \log n \right)\). Since this is not true in general, we must modify our update rule, as we describe next.

To this end, we instead consider the vectors \(f({\mathbf{q}}_i)\) with added dimensions, i.e. let \({\mathbf{u}}_i = f({\mathbf{q}}_i) + \nu \cdot {\mathbf{e}}_{N + i} \in \mathbb{R}^{N+L}\) for \(i \in [L]\), and let \({\mathcal{L}}'\) be the list containing \({\mathbf{u}}_1, \ldots, {\mathbf{u}}_L\). Then, we observe that projecting \(f({\mathbf{z}})\) onto \({\mathcal{L}}'\) exactly corresponds to the regularized regression problem \(\mathop{\mathrm{argmin}}_{{\mathbf{u}}' \in \mathop{\mathrm{Span}}({\mathcal{L}})} \left(\|f({\mathbf{z}}) - {\mathbf{u}}' \|_2^2 + \nu^2 \cdot \|\mathbf{\alpha}\|_2^2\right)\), where \(\alpha \in \mathbb{R}^L\) denotes the vector of coefficients of the iterate. Let \({\mathbf{u}}' = \sum_{i=1}^L \alpha_i \cdot {\mathbf{u}}_i\) be the solution to this regularized regression problem; then, for a hard query \({\mathbf{q}}\), we update the current iterate \({\mathbf{v}}\) to \({\mathbf{v}}' = \sum_{ i = 1}^L \alpha_i \cdot f({\mathbf{q}}_i)\).

Finally, recall that in 3 we required that the sum of the coefficients satisfies \(\sum_{ i =1}^L \alpha_i = 1\). To ensure this, we simply impose an additional linear constraint and instead project \(f({\mathbf{z}}) - {\mathbf{u}}_1\) onto the affine subspace \({\mathbf{u}}_1 + \mathop{\mathrm{Span}}\{ {\mathbf{u}}_i - {\mathbf{u}}_1 : i = 2, \ldots,L \}\). The following lemmas allow us to bound the condition number of the vectors \({\mathbf{u}}_1,\ldots, {\mathbf{u}}_{L}\).

Lemma 5. Suppose \(\|{\mathbf{u}}_j\|_2=\mathcal{O}\left(A\right)\) for all \(j\in[L]\) and let \({\mathbf{U}}'\) be the matrix whose columns are the vectors \({\mathbf{u}}_2-{\mathbf{u}}_1,\ldots, {\mathbf{u}}_L-{\mathbf{u}}_1\). Then \(\sigma_{\max}({\mathbf{U}}')=\mathcal{O}\left(\sqrt{L\cdot A}\right)\) and \(\sigma_{\min}({\mathbf{U}}')\ge\nu_0 \sqrt{A}\).

Proof. Observe that since \(\|{\mathbf{u}}_j\|_2^2=\mathcal{O}\left(A\right)\), then by triangle inequality, \(\|{\mathbf{u}}_j-{\mathbf{u}}_1\|_2\le\|{\mathbf{u}}_j\|_2+\|{\mathbf{u}}_1\|_2=\mathcal{O}\left(\sqrt{A}\right)\) for all \(j\neq 1\).

\[\sigma_{\max}({\mathbf{U}}')\le\|{\mathbf{U}}\|_F\le\sqrt{L}\cdot\sqrt{\Theta(A)+\nu_0^2 A}=\mathcal{O}\left(\sqrt{L\cdot A}\right).\] On the other hand, since the \(L\times L\) identity matrix scaled by \(\nu\) is appended in the dimensions after \(N\), then we have \(\sigma_{\min}({\mathbf{U}}')\ge\nu_0 \sqrt{A}\). ◻

Lemma 6. Let \({\mathbf{A}}= {\mathbf{a}}_1 \circ \ldots \circ {\mathbf{a}}_k \in \mathbb{R}^{n \times k}\) have full column rank and let \({\mathbf{v}}\in \mathbb{R}^n\). Let \({\mathbf{x}}^\star = \arg\min_{{\mathbf{x}}\in \mathop{\mathrm{Span}}({\mathbf{A}})} \|{\mathbf{v}}- {\mathbf{x}}\|_2\) and \({\mathbf{x}}^\star = {\mathbf{A}}{\mathbf{y}}^\star\). If \({\mathbf{v}}\notin \mathop{\mathrm{Span}}({\mathbf{A}})\), then the coefficients of the optimal representation satisfy \[\|{\mathbf{y}}^\star\|_2 \le \frac{\|{\mathbf{v}}\|_2}{\sigma_{\min}({\mathbf{A}})}.\]

Proof. Since \({\mathbf{A}}\) has full column rank, the minimizer of \(\|{\mathbf{v}}- {\mathbf{A}}{\mathbf{y}}\|_2\) is unique and given by \[{\mathbf{y}}^\star = ({\mathbf{A}}^\top {\mathbf{A}})^{-1} {\mathbf{A}}^\top {\mathbf{v}}= {\mathbf{A}}^\dagger {\mathbf{v}},\] where \({\mathbf{A}}^\dagger\) denotes the Moore-Penrose pseudoinverse of \({\mathbf{A}}\). The corresponding vector \({\mathbf{x}}^\star = {\mathbf{A}}{\mathbf{y}}^\star\) is the orthogonal projection of \({\mathbf{v}}\) onto \(\mathop{\mathrm{Span}}({\mathbf{A}})\). Using the operator norm of the pseudoinverse and sub-multiplicativity of norms, \[\|{\mathbf{y}}^\star\|_2 = \|{\mathbf{A}}^\dagger {\mathbf{v}}\|_2 \le \|{\mathbf{A}}^\dagger\|_2 \cdot \|{\mathbf{v}}\|_2.\] Since \(\|{\mathbf{A}}^\dagger\|_2 = \frac{1}{\sigma_{\min}({\mathbf{A}})}\), i.e., the minimum singular value of \({\mathbf{A}}\), then it follows that \[\|{\mathbf{y}}^\star\|_2 \le \frac{\|{\mathbf{v}}\|_2}{\sigma_{\min}({\mathbf{A}})}.\] ◻

3.1.0.4 Algorithm analysis.

Next, we justify the correctness guarantees of our algorithm, assuming that the underlying frequency vector \({\mathbf{x}}\) satisfies \(\|{\mathbf{x}}\|_p^p \leq 10 A\) when the sketch is invoked. In the next lemma, we show that \(P_i\) in \(\mathsf{EstLevel}\) is an accurate approximation for \(\|f({\mathbf{z}}) - {\mathbf{v}}\|_2^2 + \nu^2 \|\alpha\|_2^2\).

Lemma 7. Let \({\mathbf{v}}\) be a fixed iterate vector in block \(C_{i,j}\) at level \(i\), i.e., the value of \({\mathbf{v}}\) in 2, at a fixed time in the stream, conditioned on the previous times, and suppose that \(\|f({\mathbf{z}})\|_2^2 = \Theta(A)\) and \(\|f({\mathbf{z}}) - f({\mathbf{q}})\|_2^2 = \Theta(A)\). Suppose that \(P_i\) is produced using sketch \({\mathbf{B}}_i\) which is robust for \(\mathcal{O}\left(\frac{1}{\eta^2} \log n\right)\) adaptive updates, where \(\eta = \Theta(\frac{\varepsilon}{H})\). Then with high probability, \[\|f({\mathbf{z}})-{\mathbf{v}}\|_2^2 + \nu^2 \|\alpha\|_2^2 -\frac{\varepsilon^2 A}{100H^2}\le P_i\le \|f({\mathbf{z}})-{\mathbf{v}}\|_2^2 + \frac{\varepsilon^2 A}{100 H^2} + \nu^2 \|\alpha\|_2^2.\]

Proof. Note that for \({\mathbf{v}}= \sum_{i = 1}^L \alpha_i \cdot f({\mathbf{q}}_i)\), we have that \[\begin{align} \|f({\mathbf{z}}) - {\mathbf{v}}\|_2^2 &= \|f({\mathbf{z}})\|_2^2 + \left \| \sum_{i = 1}^L \alpha_i f({\mathbf{q}}_i) \right \|_2^2 - 2 \sum_{i = 1}^L \alpha_i \cdot \langle f({\mathbf{z}}), f({\mathbf{q}}_i) \rangle \end{align}\] By 5 we have that the condition number of the list is \(\kappa = \frac{\sqrt{L}}{\nu_0} = \frac{L\cdot H^2}{\varepsilon^2}\), so it suffices for us to obtain additive error \(\mathcal{O}\left(\frac{\varepsilon^2}{\kappa^2 \cdot H^2 \cdot L^2}\right) \cdot A\) for each of the \(\mathcal{O}\left(L^2\right)\) terms.

Observe that \(\|f({\mathbf{z}})\|_2^2 = \|{\mathbf{z}}\|_p^p\) can be estimated using \({\mathbf{B}}_i\) up to \(\left(1+ \frac{\varepsilon^2}{100H^2 L^2 \kappa^2} \right)\) multiplicative error. Thus, it suffices to estimate the remaining terms: each of the \(L\) terms \(\|f({\mathbf{q}}_i)\|_2^2 = \|{\mathbf{q}}_i\|_p^p\) can be similarly estimated up to \(\left(1+ \frac{\varepsilon^2}{100H^2 \cdot L^2 \cdot \kappa^2} \right)\) multiplicative error using \({\mathbf{B}}_i\), and for \(i \not= j\) the remaining inner products \(\langle f({\mathbf{q}}_i), f({\mathbf{q}}_j)\rangle\) are estimated up to \(\frac{\varepsilon^2}{100H^2 \cdot L^2 \cdot \kappa^2} \cdot \left( \|{\mathbf{q}}_i\|_p^p + \|{\mathbf{q}}_j\|_p^p + \|{\mathbf{q}}_i - {\mathbf{q}}_j\|_p^p \right)\) additive error by invoking the \({\mathsf{DotEst}}\) subroutine. Likewise, each of the \(L\) terms \(\langle f({\mathbf{z}}), f({\mathbf{q}}_i) \rangle\) is estimated up to \(\frac{\varepsilon^2}{100H^2 \cdot L^2 \cdot \kappa^2} \cdot \left(\|{\mathbf{z}}\|_p^p + \|{\mathbf{q}}_i\|_p^p + \|{\mathbf{z}}- {\mathbf{q}}_i\|_p^p \right)\) additive error via \({\mathsf{DotEst}}\). Since each of the coefficients \(\alpha_i\) in the representation \({\mathbf{v}}= \sum_{i = 1}^L \alpha_i \cdot f({\mathbf{q}}_i)\) is bounded by \(\kappa\), the desired error bound follows by adding up all of these estimates and recalling that \(\|{\mathbf{q}}_i\|_p^p = \mathcal{O}\left(A\right)\) for all \(i \in [L]\) and \(\|{\mathbf{z}}\|_p^p = \Theta(A)\). ◻

Building on the previous lemma, we now argue that the output \(P_i + Q_i\) of \(\mathsf{EstLevel}\)\((i)\) accurately approximates our desired estimator \(S = \|f({\mathbf{z}}) - {\mathbf{v}}\|_2^2 + \|{\mathbf{v}}- f({\mathbf{q}})\|_2^2 + 2 \nu^2 \|\alpha\|_2^2\).

Lemma 8. For each \(i\in[H]\), let \({\mathcal{P}}\) be the active block in level \(i\) and let \({\mathbf{B}}_{i}\) be the sketch matrix of \({\mathcal{P}}\). Let \(S = \|f({\mathbf{z}}) - {\mathbf{v}}\|_2^2 + \|{\mathbf{v}}- f({\mathbf{q}})\|_2^2 + 2 \nu^2 \|\alpha\|_2^2\) denote the desired estimator. With high probability, the output \(P_i+Q_i\) of \({\mathsf{EstLevel}}(i)\) satisfies \[\begin{align} S- \frac{\varepsilon^2 (6i+2) A}{100H^2} & \le P_i+Q_i\le S+\frac{\varepsilon^2 (6i+2) A}{100H^2}. \end{align}\]

Proof. Recall that by 3, \(Q_i\) is computed by (1) estimating \(\mathcal{O}\left(L^2\right)\) fixed inner products using \({\mathbf{B}}_i\) and (2) recursively estimating \(\|{\mathbf{w}}_i \|_2^2 = \|\sum_{j =1}^L \alpha_j \cdot f({\mathbf{q}}_j - {\mathbf{q}}_L) - f({\mathbf{q}}_{L+1})\|_2^2\) in the next level. Note that by 4, we have \(\|{\mathbf{w}}_i\|_2^2 \leq \|f({\mathbf{z}})\|_2^2 + \mathcal{O}\left(A\right)\), so in particular \(\|{\mathbf{w}}_i\|_2^2\) can also be computed with \(\frac{6i\varepsilon^2 A}{100H^2}\) additive error.

Suppose \({\mathsf{EstLevel}}(i-1)\) outputs \(Q_i\) such that \(\|{\mathbf{v}}-f({\mathbf{q}})\|_2^2 + \nu^2 \|\alpha\|_2^2 - \frac{6i\varepsilon^2 A}{100H^2}\le Q_i\le\|{\mathbf{v}}-f({\mathbf{q}})\|_2^2 + \nu^2 \|\alpha\|_2^2 + \frac{6i\varepsilon^2 A}{100H^2}\). Then it follows by 7 that with high probability, the output \(P_i+Q_i\) of \({\mathsf{EstLevel}}(i)\) satisfies \[\begin{align} S - \frac{\varepsilon^2(6i+1)A}{100H^2}&\le P_i+Q_i \le S + \frac{\varepsilon^2(6i+1)A}{100H^2}. \end{align}\] Since the argument above shows the inductive hypothesis for a fixed \(i \in [H]\), it suffices for us to verify that the statement holds for the base case \(i =1\). In particular, \(Q_1={\mathsf{EmbedEst}}({\mathbf{v}}, {\mathbf{q}})\) is computed using sketch \({\mathbf{B}}_1\). By the correctness of \({\mathbf{B}}_1\), we have \[\|{\mathbf{v}}-f({\mathbf{q}}_0+{\mathbf{q}}_1)\|_2^2 +\nu^2 \|\alpha\|_2^2 - \frac{\varepsilon^2 A}{100H^2}\le Q_1\le \|{\mathbf{v}}-f({\mathbf{q}}_0+{\mathbf{q}}_1)\|_2^2 + \nu^2 \|\alpha\|_2^2 + \frac{\varepsilon^2 A}{100H^2},\] with high probability. Thus, by a union bound over all \(i \in [H]\) it follows that the desired bound holds for all \(i \in [H]\) by induction. ◻

We now argue that \({\mathsf{EstLevel}}(i)\) returns an estimate within additive error \(\frac{\mathcal{O}\left(\varepsilon^2 A\right) \cdot i}{100H^2}\) of the \(F_p\) moment \(\|{\mathbf{z}}- {\mathbf{q}}\|_p^p\).

Invariant 3. For any level \(i\in[H]\), let \({\mathcal{P}}\) be the active block in level \(i\) and let \({\mathbf{B}}_{i}\) be the sketch matrix of \({\mathcal{P}}\). Let \({\mathbf{q}}\) be the part of the query in \({\mathcal{P}}\) and let \({\mathbf{z}}\) be previous part. Then with high probability \[\|{\mathbf{z}}-{\mathbf{q}}\|_p^p - \frac{(6i+1)\varepsilon A}{100H}\le{\mathsf{EstLevel}}(i,{\mathbf{B}}_i{\mathbf{z}})\le \|{\mathbf{z}}-{\mathbf{q}}\|_p^p + \frac{(6i+1)\varepsilon A}{100 H}.\]

Proof. Suppose that the current iterate is not updated \({\mathbf{v}}\) for current suffix \({\mathbf{q}}\). Then, by construction we have that \[\mathcal{A}_i({\mathbf{z}}- {\mathbf{q}}) - \frac{6i\varepsilon A}{100 H}\leq P_i + Q_i \leq \mathcal{A}_i({\mathbf{z}}- {\mathbf{q}}) + \frac{6i\varepsilon A}{100 H}.\] By the correctness of \(\mathcal{A}_i\), we have that \[\|{\mathbf{z}}- {\mathbf{q}}\|_p^p - \frac{\varepsilon A}{100 H}\leq \mathcal{A}_i({\mathbf{z}}- {\mathbf{q}}) \leq \|{\mathbf{z}}- {\mathbf{q}}\|_p^p + \frac{\varepsilon A}{100 H}.\] Therefore, \[\|{\mathbf{z}}- {\mathbf{q}}\|_p^p - \frac{(6i+1)\varepsilon A}{100 H}\leq P_i + Q_i \leq \|{\mathbf{z}}- {\mathbf{q}}\|_p^p + \frac{(6i+1)\varepsilon A}{100 H},\] so the invariant is satisfied in this case. Alternatively, suppose that the iterate \({\mathbf{v}}\) is updated for the current suffix \({\mathbf{q}}\). In this case, we update \({\mathbf{v}}\) by solving the regularized regression problem (see 5) and return the estimate \(A_i\), as desired. ◻

Next, we show that the estimator in block \(C_{i,j}\) of level \(i \in [H]\) is inaccurate at most \(\mathcal{O}\left(\frac{1}{\eta^2} \log n\right)\) times throughout the stream, where \(\eta = \frac{\varepsilon}{100 H}\) is the total allowable error in each of the \(H\) levels of the recursion. Recall that the estimator at level \(i\) is given by \(\|f({\mathbf{z}}) - {\mathbf{v}}\|_2^2 + \| {\mathbf{v}}- f({\mathbf{q}})\|_2^2 + 2 \nu^2 \|\alpha\|_2^2\), where \({\mathbf{z}}\) represents the previous frequency vector, \({\mathbf{v}}\) is the projection of \(f({\mathbf{z}})\) onto the list of previous queries on which the estimator had erred, and \({\mathbf{q}}\) contains the arriving updates. Since our estimator simulates the robust \(L_2\) algorithm by embedding into \(L_2^2\), progress of our algorithm will also be measured in the \(L_2\) space.

Lemma 9 (Bounded list size). Let \(L_i\) be the number of times that the iterate \({\mathbf{v}}\) in a particular block at level \(i\in[H]\) is updated and let \(\eta = \Theta\left(\frac{\varepsilon}{H}\right)\) be the error in level \(i\). With high probability, \(L_i\le\mathcal{O}\left(\frac{1}{\eta^2}\log n\right)\) for all \(i\in[H]\) and for all times in the stream, for \(m\le\mathop{\mathrm{poly}}(n)\).

Proof. For any fixed level \(i\in[H]\) and for any fixed time in the stream, let \({\mathcal{P}}_i\) and \({\mathcal{P}}_{i+1}\) be the active blocks at levels \(i\) and \(i+1\) respectively. Let \({\mathbf{z}}\) be the frequency vector corresponding to all the updates prior to \({\mathcal{P}}_{i+1}\), and let \({\mathbf{y}}\) be the vector \(f({\mathbf{z}})\) with \(L\) zeros in the additional dimensions, so that \({\mathbf{y}}\in \mathbb{R}^{N + L}\). Similarly, let \({\mathbf{u}}\) be the vector \({\mathbf{u}}= f({\mathbf{q}})+\nu\cdot{\mathbf{e}}_{N+|{\mathcal{L}}_i|+1}\), and \({\mathbf{w}}\) is precisely the projection of \({\mathbf{y}}\) onto the span of \({\mathbf{u}}_i- {\mathbf{u}}_1\) for \(i \in [|{\mathcal{L}}_i|]\), as defined in 5. Conditioned on the correctness guarantees of \({\mathsf{EstLevel}}\) in 2, we have that \[\|f({\mathbf{z}}) - {\mathbf{v}}\|_2^2 + \|{\mathbf{v}}- f({\mathbf{q}})\|_2^2 + 2 \nu^2 \|\alpha\|_2^2 - \eta A \leq {\mathsf{EstLevel}}(i, {\mathbf{B}}_{i} {\mathbf{z}})\leq \|f({\mathbf{z}}) - {\mathbf{v}}\|_2^2 + \|{\mathbf{v}}- f({\mathbf{q}})\|_2^2 + 2 \nu^2 \|\alpha\|_2^2 + \eta A,\] where \({\mathbf{v}}\) is our true iterate. Recall that by our assumption, \(\|f({\mathbf{z}})\|_2^2 = \|{\mathbf{y}}\|_2^2 = \Theta(A)\) and \(\|f({\mathbf{z}}) - f({\mathbf{q}})\|_2^2 = \Theta(A)\), so we also have \(\|{\mathbf{y}}- {\mathbf{u}}\|_2^2 = \Theta(A)\). In particular, by our choice of \(\nu = \frac{\varepsilon^2 A}{H^2 \cdot \sqrt{L}}\) and by 6, we must have \(\|{\mathbf{y}}- {\mathbf{w}}\|_2^2 = \Theta(A)\) and \(\|{\mathbf{w}}- {\mathbf{u}}\|_2^2 \leq \mathcal{O}\left(A\right)\). Therefore, it follows that \[(1-\eta') \cdot (\|{\mathbf{y}}-{\mathbf{w}}\|_2^2+\|{\mathbf{w}}-{\mathbf{u}}\|_2^2)\le{\mathsf{EstLevel}}(i,{\mathbf{B}}_i{\mathbf{z}}) \le(1+\eta')\cdot(\|{\mathbf{y}}-{\mathbf{w}}\|_2^2+\|{\mathbf{w}}-{\mathbf{u}}\|_2^2),\] for any choice of \(\eta'=\Theta(\eta)\). Let \({\mathbf{u}}'\) be the projection of \({\mathbf{u}}\) onto the span of \({\mathbf{u}}_2- {\mathbf{u}}_1,\ldots, {\mathbf{u}}_{L} - {\mathbf{u}}_{1}\). By Pythagorean theorem, we have \[(1-\eta') \cdot (\|{\mathbf{y}}-{\mathbf{w}}\|_2^2+\|{\mathbf{w}}-{\mathbf{u}}'\|_2^2+\|{\mathbf{u}}'-{\mathbf{u}}\|_2^2)\le{\mathsf{EstLevel}}(i,{\mathbf{B}}_{i}{\mathbf{z}}) \le(1+\eta')\cdot(\|{\mathbf{y}}-{\mathbf{w}}\|_2^2+\|{\mathbf{w}}-{\mathbf{u}}'\|_2^2+\|{\mathbf{u}}'-{\mathbf{u}}\|_2^2).\] Suppose that we do not have \[(1-\eta)^2\cdot\|f({\mathbf{z}})-f({\mathbf{q}})\|_2^2\le{\mathsf{EstLevel}}(i,{\mathbf{B}}_{i}{\mathbf{z}})\le(1+\eta)^2\cdot\|f({\mathbf{z}})-f({\mathbf{q}})\|_2^2.\] Then, by the choice of \(\nu\) above, it directly follows that we also do not have \[(1-\eta)^2\cdot\|{\mathbf{y}}-{\mathbf{u}}\|_2^2\le{\mathsf{EstLevel}}(i,{\mathbf{B}}_{i}{\mathbf{z}})\le(1+\eta)^2\cdot\|{\mathbf{y}}-{\mathbf{u}}\|_2^2.\] Now, we consider the cases:

  1. \(\|{\mathbf{y}}-{\mathbf{w}}\|_2^2+\|{\mathbf{w}}-{\mathbf{u}}'\|_2^2+\|{\mathbf{u}}'-{\mathbf{u}}\|_2^2\le 16\|{\mathbf{y}}-{\mathbf{u}}\|_2^2\) or

  2. \(\|{\mathbf{y}}-{\mathbf{w}}\|_2^2+\|{\mathbf{w}}-{\mathbf{u}}'\|_2^2+\|{\mathbf{u}}'-{\mathbf{u}}\|_2^2>16\|{\mathbf{y}}-{\mathbf{u}}\|_2^2\).

First, suppose \(\|{\mathbf{y}}-{\mathbf{w}}\|_2^2+\|{\mathbf{w}}-{\mathbf{u}}'\|_2^2+\|{\mathbf{u}}'-{\mathbf{u}}\|_2^2\le 16\|{\mathbf{y}}-{\mathbf{u}}\|_2^2\). Then, \[\begin{align} \left\lvert\|{\mathbf{y}}-{\mathbf{w}}\|_2^2+\|{\mathbf{w}}-{\mathbf{u}}'\|_2^2+\|{\mathbf{u}}'-{\mathbf{u}}\|_2^2-\|{\mathbf{y}}-{\mathbf{u}}\|_2^2\right\rvert &>2\eta\cdot\|{\mathbf{y}}-{\mathbf{u}}\|_2^2-\eta'\cdot(\|{\mathbf{y}}-{\mathbf{w}}\|_2^2 \\ &+\|{\mathbf{w}}-{\mathbf{u}}'\|_2^2+\|{\mathbf{u}}'-{\mathbf{u}}\|_2^2). \end{align}\] By Pythagorean theorem, we have \[\begin{align} \|{\mathbf{y}}-{\mathbf{u}}\|_2^2&=\|({\mathbf{y}}-{\mathbf{w}})+({\mathbf{w}}-{\mathbf{u}}')+({\mathbf{u}}'-{\mathbf{u}})\|_2^2\\ &=\|{\mathbf{y}}-{\mathbf{w}}+{\mathbf{u}}'-{\mathbf{u}}\|_2^2+\|{\mathbf{w}}-{\mathbf{u}}'\|_2^2\\ &=\|{\mathbf{y}}-{\mathbf{w}}\|_2^2+\|{\mathbf{u}}'-{\mathbf{u}}\|_2^2+2\langle {\mathbf{y}}-{\mathbf{w}},{\mathbf{u}}'-{\mathbf{u}}\rangle+\|{\mathbf{w}}-{\mathbf{u}}'\|_2^2. \end{align}\] Hence if we have a bad estimator, then \[\lvert\langle {\mathbf{y}}-{\mathbf{w}},{\mathbf{u}}'-{\mathbf{u}}\rangle\rvert>\eta\cdot\|{\mathbf{y}}-{\mathbf{u}}\|_2^2-\frac{\eta'}{2}\cdot(\|{\mathbf{y}}-{\mathbf{w}}\|_2^2+\|{\mathbf{w}}-{\mathbf{u}}'\|_2^2+\|{\mathbf{u}}'-{\mathbf{u}}\|_2^2).\] Since \(\|{\mathbf{y}}-{\mathbf{w}}\|_2^2+\|{\mathbf{w}}-{\mathbf{u}}'\|_2^2+\|{\mathbf{u}}'-{\mathbf{u}}\|_2^2\le 16(\|{\mathbf{y}}-{\mathbf{u}}\|_2^2)\) by assumption, for \(\eta'\le\frac{\eta}{16}\) we have \[\lvert\langle {\mathbf{y}}-{\mathbf{w}},{\mathbf{u}}'-{\mathbf{u}}\rangle\rvert>\frac{\eta}{2}\cdot\|{\mathbf{y}}-{\mathbf{u}}\|_2^2.\] Now, let \({\mathbf{y}}'\) be the projection of \({\mathbf{y}}\) to the span of the new subspace augmented with \({\mathbf{u}}\). By Pythagorean theorem, \[\begin{align} \|{\mathbf{y}}-{\mathbf{y}}'\|_2^2&=\|{\mathbf{y}}-{\mathbf{w}}\|_2^2-\frac{1}{\|{\mathbf{u}}-{\mathbf{u}}'\|_2^2}\cdot\langle {\mathbf{y}}-{\mathbf{w}},{\mathbf{u}}-{\mathbf{u}}'\rangle^2\\ &\le\|{\mathbf{y}}-{\mathbf{w}}\|_2^2-\frac{\eta^2}{4}\cdot\frac{\|{\mathbf{y}}-{\mathbf{u}}\|_2^4}{\|{\mathbf{u}}-{\mathbf{u}}'\|_2^2}\\ &\le\|{\mathbf{y}}-{\mathbf{w}}\|_2^2-\frac{\eta^2}{16}\cdot\frac{\|{\mathbf{y}}-{\mathbf{w}}\|_2^2\cdot\|{\mathbf{u}}-{\mathbf{u}}'\|_2^2}{\|{\mathbf{u}}-{\mathbf{u}}'\|_2^2}\\ &=\left(1-\frac{\eta^2}{16}\right)\cdot\|{\mathbf{y}}-{\mathbf{w}}\|_2^2. \end{align}\] In particular, note that \({\mathbf{u}}-{\mathbf{u}}'\neq\mathbf{0}^n\), since \({\mathbf{u}}\) cannot lie in the span of \({\mathcal{L}}_{i+1}\) while still corresponding to a bad estimate.

In the other case, we have \(\|{\mathbf{y}}-{\mathbf{w}}\|_2^2+\|{\mathbf{w}}-{\mathbf{u}}'\|_2^2+\|{\mathbf{u}}'-{\mathbf{u}}\|_2^2>16(\|{\mathbf{y}}-{\mathbf{u}}\|_2^2)\). Then \[\left\lvert\|{\mathbf{y}}-{\mathbf{w}}\|_2^2+\|{\mathbf{w}}-{\mathbf{u}}'\|_2^2+\|{\mathbf{u}}'-{\mathbf{u}}\|_2^2-\|{\mathbf{y}}-{\mathbf{u}}\|_2^2\right\rvert>\frac{15}{16}\cdot(\|{\mathbf{y}}-{\mathbf{w}}\|_2^2+\|{\mathbf{w}}-{\mathbf{u}}'\|_2^2+\|{\mathbf{u}}'-{\mathbf{u}}\|_2^2).\] Recall that \[\|{\mathbf{y}}-{\mathbf{u}}\|_2^2=\|{\mathbf{y}}-{\mathbf{w}}\|_2^2+\|{\mathbf{u}}'-{\mathbf{u}}\|_2^2+2\langle {\mathbf{y}}-{\mathbf{w}},{\mathbf{u}}'-{\mathbf{u}}\rangle+\|{\mathbf{w}}-{\mathbf{u}}'\|_2^2.\] So, if the estimator is not accurate, then we must have \[\lvert\langle {\mathbf{y}}-{\mathbf{w}},{\mathbf{u}}'-{\mathbf{u}}\rangle\rvert>\frac{1}{4}\cdot(\|{\mathbf{y}}-{\mathbf{w}}\|_2^2+\|{\mathbf{w}}-{\mathbf{u}}'\|_2^2+\|{\mathbf{u}}'-{\mathbf{u}}\|_2^2).\] Next, let \({\mathbf{y}}'\) be the projection of \({\mathbf{y}}\) to the span of the new subspace augmented with \({\mathbf{u}}\). By Pythagorean theorem, we have that \[\begin{align} \|{\mathbf{y}}-{\mathbf{y}}'\|_2^2&=\|{\mathbf{y}}-{\mathbf{w}}\|_2^2-\frac{1}{\|{\mathbf{u}}-{\mathbf{u}}'\|_2^2}\cdot\langle {\mathbf{y}}-{\mathbf{w}},{\mathbf{u}}-{\mathbf{u}}'\rangle^2\\ &\le\|{\mathbf{y}}-{\mathbf{w}}\|_2^2-\frac{1}{16}\cdot\frac{(\|{\mathbf{y}}-{\mathbf{w}}\|_2^2+\|{\mathbf{w}}-{\mathbf{u}}'\|_2^2+\|{\mathbf{u}}'-{\mathbf{u}}\|_2^2)^2}{\|{\mathbf{u}}-{\mathbf{u}}'\|_2^2}\\ &\le\|{\mathbf{y}}-{\mathbf{w}}\|_2^2-\frac{1}{16}\cdot\frac{\|{\mathbf{y}}-{\mathbf{w}}\|_2^2\cdot\|{\mathbf{u}}-{\mathbf{u}}'\|_2^2}{\|{\mathbf{u}}-{\mathbf{u}}'\|_2^2}\\ &=\frac{15}{16}\cdot\|{\mathbf{y}}-{\mathbf{w}}\|_2^2. \end{align}\]

Note that the argument above assumes that we compute the new projection \({\mathbf{y}}'\) exactly. However, 2 computes distances to \({\mathbf{y}}'\) up to additive error \(\Theta\left(\frac{\varepsilon^2 A}{H^2}\right)\). Since the total progress is \(\mathcal{O}\left(\eta^2 A\right)\) for \(\eta = \frac{\varepsilon}{H}\) and the error incurred in \({\mathbf{y}}'\) is \(\Theta\left(\frac{\varepsilon^2 A}{H^2}\right)\), we have shown that \(\|{\mathbf{y}}-{\mathbf{y}}'\|_2^2\le(1-\mathcal{O}\left(\eta^2\right))\cdot\|{\mathbf{y}}-{\mathbf{w}}\|_2^2\).

By assumption, we have \(\|{\mathbf{y}}\|_2^2 = \|f({\mathbf{z}})\|_2^2= \Theta(A) \leq \mathop{\mathrm{poly}}(n)\) initially, so the total number of vectors added to the list is at most \(\mathcal{O}\left(\frac{1}{\eta^2}\log n\right)\), as desired. ◻

3.2 Achieving Multiplicative Error↩︎

In this section, we show how to convert an algorithm that estimates a function \(F(\cdot)\) up to additive \(\varepsilon\cdot (1+\varepsilon)^i\) error to an algorithm that achieves a multiplicative \((1+\varepsilon)\)-approximation guarantee. This allows us to complete our adversarially robust \(F_p\) moment estimation algorithm on insertion-deletion streams. Let \({\mathcal{A}}_1, \ldots, {\mathcal{A}}_{K}\) denote \(K = \mathcal{O}\left(\frac{1}{\varepsilon}\log n\right)\) independent copies of a robust additive-error algorithm, where \({\mathcal{A}}_i\) achieves additive \(\varepsilon\cdot (1+\varepsilon)^i\) error when the frequency vector \({\mathbf{x}}\) satisfies \(F({\mathbf{x}}) \leq 10 \cdot (1+\varepsilon)^i\).

None

Figure 6: No caption.

In the next lemma, we show that this algorithm returns a \((1\pm \varepsilon)\) approximation to \(F({\mathbf{x}})\) and is robust to \(m = \mathop{\mathrm{poly}}(n)\) adaptive updates.

Lemma 10. Given any \(\varepsilon\in (0,1)\), there exists an adversarially robust insertion-deletion streaming algorithm on a stream of length \(m = \mathop{\mathrm{poly}}(n)\) that with high probability, outputs a multiplicative \((1\pm \mathcal{O}\left(\varepsilon\right))\) approximation to \(F({\mathbf{x}})\).

Proof. We first argue that the algorithm above is robust. Note that at each scale \(j \in [K]\), the additive-error algorithm \({\mathcal{A}}_j\) is guaranteed to return an estimate \(S_j\) such that \(|F({\mathbf{x}}) - S_j| \leq \varepsilon\cdot (1+\varepsilon)^j\), with high probability when the input \({\mathbf{x}}\) satisfies \(F({\mathbf{x}}) \leq 10 \cdot (1+\varepsilon)^j\). Since the algorithm starts with \(j = K\) and iterates backwards, this condition is satisfied automatically, so the algorithm \({\mathcal{A}}_j\) will satisfy this additive guarantee. Furthermore, if \(S_j\) is returned by \({\mathcal{A}}_j\), it must be that \(S_j \geq (1 + \frac{\varepsilon}{4})(1+\varepsilon)^{j-1}\) and \(S_{j+1} < (1+\frac{\varepsilon}{4})(1+\varepsilon)^{j}\), so \[F({\mathbf{x}}) \ge (1 + \frac{\varepsilon}{4})(1 + \varepsilon)^{j - 1} - \mathcal{O}\left(\varepsilon\right) \cdot (1 + \varepsilon)^j\] and \[F({\mathbf{x}}) <(1 + \frac{\varepsilon}{4}) (1 + \varepsilon)^j + \mathcal{O}\left(\varepsilon\right) \cdot (1 + \varepsilon)^{j + 1} \;.\] From the above, we see that \(S_j \in (1 \pm \mathcal{O}\left(\varepsilon\right)) \cdot F({\mathbf{x}})\). Thus, if each \({\mathcal{A}}_i\) has additive error \(\varepsilon\cdot (1+\varepsilon)^j\) when \(F({\mathbf{x}}) \leq 10 \cdot (1+\varepsilon)^j\), then the output is a \((1+\mathcal{O}\left(\varepsilon\right))\)-multiplicative approximation. So, it suffices to show that each \({\mathcal{A}}_i\) has small additive error \(\varepsilon\cdot (1+\varepsilon)^i\) for inputs \(F({\mathbf{x}}) \leq 10 \cdot (1+\varepsilon)^j\) with probability \(1-\frac{1}{n^2}\), even when the stream is chosen adaptively. To see this, we argue by contradiction: suppose there exists a adaptive strategy \({\mathcal{S}}\) of length \(\mathop{\mathrm{poly}}(n)\) for the adversary, such that for some \(j \in [K]\), \({\mathcal{A}}_j\) has error probability \(\geq \frac{1}{n^2}\). We design an adaptive strategy to break the additive-error algorithm \({\mathcal{A}}_j\) as follows: the adversary can simulate the execution of the algorithm for copies \(\{{\mathcal{A}}_1',\ldots, {\mathcal{A}}_{j-1}', {\mathcal{A}}_j, {\mathcal{A}}_{j+1}',\ldots {\mathcal{A}}_L'\}\), where \({\mathcal{A}}_j\) is the embedded target copy. Then, the adversary can simply execute the adaptive strategy \({\mathcal{S}}\) on \(\{{\mathcal{A}}_1',\ldots, {\mathcal{A}}_j,\ldots, {\mathcal{A}}_L' \}\), and by assumption \({\mathcal{S}}\) will ensure that \({\mathcal{A}}_j\) fails to output a \((1\pm\varepsilon)\) approximation with probability at least \(\frac{1}{n^2}\). However, \({\mathcal{A}}_j\) was assumed to be robust to \(m = \mathop{\mathrm{poly}}(n)\) adaptive inputs, so this results in a contradiction. ◻

We now show correctness for our adversarially robust \(F_p\) estimation algorithm for \(p \in [0,2)\), which achieves a \((1 + \varepsilon)\)-approximation to \(F_p\) using polylogarithmic space.

Proof. We begin by noting that a randomized adversary can be modeled as a distribution over sequences of possible inputs. Since the probability that such an adversary succeeds is at most the maximum success probability over any fixed input sequence, it suffices without loss of generality to analyze the case of a deterministic adversary.

We now upper bound the number of computation paths by upper bounding the number of interactions with the corrector. Recall that at each step, \(\mathsf{MaintainList}\) queries each \(F_p\) sketch \({\mathbf{B}}_i\) whether it should update the current iterate \({\mathbf{v}}\) with query \({\mathbf{q}}\), which would effectively add the embedding of the query \({\mathbf{q}}\) to a list \({\mathcal{L}}_{i}\) and solve the regularized regression problem in the new subspace. As a result, the transcript from \({\mathbf{B}}_i\) can be viewed as a sequence over the alphabet \(\{\bot, \top\}\), where the output \(\bot\) from the sketching matrix indicates that no action should be taken (i.e. the estimator is sufficiently accurate for \({\mathbf{q}}\)) and \(\top\) indicates that the iterate should be updated by adding the embedding of \({\mathbf{q}}\) to the list \({\mathcal{L}}_{i}\). If \(\top\) occurs at most \(L\) times in a single block of the level below, and there are \(B\) blocks in the level below, it follows that the total number of times that the corrector will be used to flag an inaccurate query is \(B \cdot L\) overall.

Note that if the iterate is updated, this causes the linear sketch at level \(i-1\) to maintain \({\mathbf{B}}_{i-1} {\mathbf{v}}'\), where \({\mathbf{v}}'\) is the iterate obtained by solving the regularized regression problem. Additionally, the linear sketch \({\mathbf{B}}_{i-1}\) releases the estimate \(A_{i}\), but no other information about \({\mathbf{B}}_i\) is revealed. Additionally, at the start of each of the \(B\) blocks, the algorithm outputs an estimate of the \(F_p\) moment, encoded using \(C_1\log n\) bits for some constant \(C_1 > 0\). Thus, the total number of possible output streams from the sketch matrix is bounded by \[\binom{m}{L\cdot B}\cdot (C_1\log n)^{B\cdot L + B}.\] Since the adversary is deterministic, each possible input stream is determined by one of these output streams. By setting the total failure probability to \[\delta \le \frac{1}{(nm)^3}\cdot\left(\binom{m}{L\cdot B}\cdot (C_1\log n)^{B \cdot L + B}\right)^{-1},\] a union bound over all possible adversarial input streams guarantees that the sketch matrix at level \(i\) is correct with probability at least \(1 - \frac{1}{(nm)^3}\). For \(m = \mathop{\mathrm{poly}}(n)\), it follows that \[\log\frac{1}{\delta} = \mathcal{O}\left((B \cdot L + B)\log n\right).\]

Next, we count the number of adaptive interactions with the estimator, which consists of \(P_i\) and \(Q_i\). To start, we use a bounded computation paths argument to track the adaptive interactions due to \(P_i\). First, we note that the output of each sketch is rounded to \(\mathcal{O}\left(\log n\right)\) bits. Furthermore, the number of adaptive interactions with \({\mathbf{B}}_i\) is precisely the number distinct vectors which are sketched by \(B_i\). Recall that the iterate \({\mathbf{v}}\) is updated at most \(L\) times due to some hard query \({\mathbf{q}}_i\), and to estimate \(P_i = \|f({\mathbf{z}}) - {\mathbf{v}}\|_2^2\) we must compute \(\mathcal{O}\left(L^2\right)\) inner products. Thus, it follows that the number of computation paths is \(\binom{m}{L^2} \cdot \left(2^{C_2 \log n}\right)^{L^2}\) for some constant \(C_2 > 0\). As before, it suffices to set \(\log \frac{1}{\delta} = \mathcal{O}\left((B \cdot L^2 + B) \log n\right)\). In particular,observe that each adaptive update to \(P_i\) corresponds to a different value for the iterate \({\mathbf{v}}\), and other queries to \(P_i\) are to the same value of the iterate \({\mathbf{v}}\) and are thus correct conditioned on the correctness of the estimate for \({\mathbf{v}}\). For robustness of the estimate \(Q_i\), we observe that by 3, \(Q_i\) consists of a term \(\|\sum_{i = 1}^L \alpha_i \cdot f({\mathbf{q}}_i - {\mathbf{q}}_{L}) - f({\mathbf{q}}_{L+1})\|_2^2\) which is the input to the recursion, and \(\mathcal{O}\left(L^2\right)\) inner products between \(f({\mathbf{z}})\), \(f({\mathbf{q}}_i)\), and \(f({\mathbf{q}}_i - {\mathbf{q}}_{L})\). Since the addition of each of the \(f({\mathbf{q}}_i)\) to the list corresponds to a single update to the iterate \({\mathbf{v}}\), and the \({\mathbf{q}}_i\) are fixed, it follows that the inner products discussed in 3 can be computed robustly given that \({\mathbf{B}}_i\) is robust to \(\mathcal{O}\left(L^2\right)\) adaptive interactions.

This establishes robustness, after which correctness follows directly from 3. By setting the error parameter \(\beta = \frac{\varepsilon^2}{\kappa^2 \cdot L^2 \cdot H^2 }\) as in 7, we ensure that the total allowable error for each level of the algorithm is \(\frac{\varepsilon A}{100 H} = \eta \cdot \Theta(A)\).

At this point, recall that the algorithm \({\mathcal{A}}\) achieves additive \(\varepsilon\cdot A\) error when the frequency vector \({\mathbf{x}}= {\mathbf{z}}- {\mathbf{q}}\) has \(F_p\) moment \(\|{\mathbf{x}}\|_p^p\leq 10A\), for a fixed parameter \(A \leq \mathop{\mathrm{poly}}(n)\), and is robust to \(m = \mathop{\mathrm{poly}}(n)\) adaptive updates. By applying the framework in 6, we obtain an algorithm \({\mathcal{A}}'\) which returns a multiplicative \((1\pm \varepsilon)\)-approximation to \(\|{\mathbf{x}}\|_p^p\) at all times in the stream, with high probability.

3.2.0.1 Space complexity.

We now analyze the total space of the algorithm. For a fixed tree and level \(i \in [H]\), we maintain \(B\) sketch matrices, one for each active block at level \(i+1\). Recall \(\eta = \frac{\varepsilon}{100H}\) is the total error for each level. Each sketching algorithm must achieve accuracy \(\left(1+\beta\right)\) and failure probability \(\delta\), where \[\log\left(\frac{1}{\delta}\right) = \mathcal{O}\left((B \cdot L^2 +B)\log n\right).\] By 9, we have \(L \le \frac{C_3}{\eta^2}\log n\) for some constant \(C_3 > 0\), with high probability, conditioned on the correctness of the subroutines. Since we require \(B^H \ge m\) and \(B \ge L\), it suffices to set \[B = \mathcal{O}\left(\frac{1}{\eta^2}\log n\right),\qquad H = \mathcal{O}\left(\log n\right),\] so that \(\log \frac{1}{\delta} = \mathcal{O}\left(\frac{1}{\eta^6} \log^4 n\right)\).

By 1, the space required to store the sketch \({\mathbf{B}}_i\) is \(\mathcal{O}\left(\frac{1}{\beta^2} \log^2 n \log \frac{1}{\delta}\right)\). There are \(B = \mathcal{O}\left(\frac{1}{\eta^2} \log n\right)\) sketching matrices in each level across \(H\) levels of recursion; moreover, the multiplicative-error framework in 6 requires storing \(\mathcal{O}\left(\log n\right)\) copies of this additive-error algorithm. Therefore, the final algorithm uses \(\mathop{\mathrm{poly}}\left(\frac{1}{\varepsilon},\log n\right)\) bits of memory. ◻

4 Embedding Applications↩︎

4.1 Embedding into \(L_p\)↩︎

In this section, we give a number of additional applications of our adversarially robust \(L_p\) estimation algorithm for \(p\in[0,2)\). Unlike the applications in 4.3 which embed into \(L_2^2\), the applications in this section embed into \(L_p\) for \(p\in[0,2)\). To that end, recall that a result by [51] guarantees that any norm \({\mathcal{X}}= (\mathbb{R}^n, \|\cdot\|_{{\mathcal{X}}})\) satisfying triangle inequality and sub-multiplicativity of norms admits a classical sketch and embeds linearly into a measure space \(L_p(\mu)\) that solves the following problem:

Definition 2 (Gap-norm problem). Given a parameter \(D>1\), a vector \({\mathbf{x}}\in\mathbb{R}^n\) and a norm \(\|\cdot\|_{{\mathcal{X}}}\), distinguish between the input cases \(\|{\mathbf{x}}\|_{{\mathcal{X}}}\le 1\), versus \(\|{\mathbf{x}}\|_{{\mathcal{X}}}\ge D\).

Theorem 4. [51] Suppose \(p\in\left(\frac{2}{3},1\right)\) and \({\mathcal{X}}\) is a norm that admits an oblivious linear sketch for the \(D\)-gap norm problem using \(s\) space, then \({\mathcal{X}}\) admits a linear embedding \(T: {\mathcal{X}}\to L_p(\mu)\) with distortion \(\mathcal{O}\left(sD\right)\).

However, the proof of 4 is existential and not necessarily algorithmically computable in general. Thus to efficiently evaluate this embedding, we utilize an advice model where the streaming algorithm is granted read-only access to a static advice string, i.e., the embedding matrix \({\mathbf{A}}\), that depends solely on the metric space \({\mathcal{X}}\) and dimension \(n\). In particular, we assume that stream updates arrive as discrete increments in the standard computational basis \({\mathbf{e}}_1, \ldots, {\mathbf{e}}_n\) of \(\mathbb{R}^n\) and that the metric space is well-conditioned with respect to this basis; otherwise, the norm of a simple unit stream update could exceed the representable word size. Formally:

Assumption 1 (Basis condition number). Let \(R = \max_{j=1}^n \|{\mathbf{u}}_j\|_{{\mathcal{X}}}\) denote the maximum norm of any standard computational basis vector \({\mathbf{e}}_1,\ldots,{\mathbf{e}}_n\), and let \(r = \min_{x \neq 0} \frac{\|{\mathbf{x}}\|_{{\mathcal{X}}}}{\|{\mathbf{x}}\|_p}\) denote the minimum scaling factor relative to the standard \(L_p\) norm. We assume that the geometric condition number defined by \(\kappa = \frac{R}{r}\) satisfies \(\kappa \le \mathop{\mathrm{poly}}(n)\).

Given that the distortion of the embedding of 4 is \(\mathcal{O}\left(sD\right)\), we cannot subsequently embed \(L_p\) into \(L_2^2\), as this could cause a blow-up of \((sD)^{\mathcal{O}\left(H\right)}\) across \(H\) different recursive levels. Instead, we observe that the embedding of 4 is crucially linear, so we can directly map the input stream to a virtual stream over \(\mathbb{R}^M\), where \(M\) is the dimension of the embedding. Our robust \(L_p\) estimation algorithm is then executed over the virtual stream. However, this requires some care about the magnitude of \(M\), as well as the magnitude of the resulting entries, which we now observe.

Lemma 11. Let \({\mathcal{X}}= (\mathbb{R}^n, \|\cdot\|_{{\mathcal{X}}})\) be a finite-dimensional normed space. Let \({\mathbf{A}}\in\mathbb{R}^{M\times n}\) be the static linear embedding into \(L_p^M\) with distortion \(D' = \mathcal{O}\left(sD\right)\). Then the dimension is upper bounded by \(M=\mathcal{O}\left(n\log n\right)\) and there exists a basis for \({\mathcal{X}}\) such that every entry of \({\mathbf{A}}\) can be represented exactly using \(\mathcal{O}\left(\log n+\log\frac{sD}{\varepsilon}\right)\) bits.

Proof. We first show an upper bound on the target dimension \(M\). By 4, there exists a linear map \(T: {\mathcal{X}}\to L_p(\mu)\) for some \(p \in (2/3, 1)\) with distortion \(\mathcal{O}\left(sD\right)\). By the subspace discretization theorem of [58][60], any \(n\)-dimensional subspace of \(L_p\) linearly embeds into \(L_p^M\) with distortion \(1+\varepsilon\) using \(M = \mathcal{O}\left(\frac{n}{\varepsilon^2}\log n\right)\) coordinates, e.g., using Lewis Weight sampling. Hence, we have \(M=\mathcal{O}\left(n\log n\right)\) by fixing the distortion to be a constant, i.e., \(\gamma=\Theta(1)\).

To upper bound the magnitude of the entries, recall that by Auerbach’s Lemma, there exists a basis \({\mathbf{e}}_1, \ldots, {\mathbf{e}}_n\) for \({\mathcal{X}}\) such that \(\|{\mathbf{e}}_j\|_{{\mathcal{X}}} = 1\) and for any \({\mathbf{x}}= \sum x_j {\mathbf{e}}_j\), we can upper bound the coefficients by \(\max_j |x_j| \le \|{\mathbf{x}}\|_{{\mathcal{X}}}\). Let \({\mathbf{A}}^* \in \mathbb{R}^{M \times n}\) be the exact continuous embedding matrix under this basis. Then the maximum magnitude of any entry is upper bounded by its \(L_p\) column norm: \[\max_i |A^*_{i,j}| = \left(\max_i |A^*_{i,j}|^p\right)^{1/p} \le \left(\sum_{i=1}^M |A^*_{i,j}|^p\right)^{1/p} = \|{\mathbf{A}}^*{\mathbf{e}}_j\|_p \le D' \|{\mathbf{e}}_j\|_{{\mathcal{X}}} = D'=\mathcal{O}\left(sD\right).\]

To lower bound the magnitude of the nonzero entries, consider a discrete matrix \({\mathbf{A}}\) formed by rounding every entry of \({\mathbf{A}}^*\) to the nearest multiple of \(\nu = \frac{\varepsilon}{M^{1/p} n}\). For any stream vector \({\mathbf{x}}\in \mathbb{R}^n\), the additive error in the \(L_p^p\) quasi-norm induced by this perturbed matrix \({\mathbf{A}}\) is at most: \[\|{\mathbf{A}}{\mathbf{x}}- {\mathbf{A}}^*{\mathbf{x}}\|_p^p = \sum_{i=1}^M \left|\sum_{j=1}^n (A_{i,j} - A^*_{i,j}) x_j\right|^p \le \sum_{i=1}^M \left(\sum_{j=1}^n \nu |x_j|\right)^p \le \sum_{i=1}^M (\nu n \max_j |x_j|)^p \le M \nu^p n^p \|{\mathbf{x}}\|_{{\mathcal{X}}}^p = \varepsilon^p \|{\mathbf{x}}\|_{{\mathcal{X}}}^p.\] Because \(L_p\) is a quasi-norm for \(p\le1\), we have the subadditivity inequality \(\|{\mathbf{u}}+{\mathbf{v}}\|_p^p \le \|{\mathbf{u}}\|_p^p + \|{\mathbf{v}}\|_p^p\). Thus, the additive error translates to the metric bounds as: \[\|{\mathbf{A}}{\mathbf{x}}\|_p^p \le \|{\mathbf{A}}^*{\mathbf{x}}\|_p^p + \|{\mathbf{A}}{\mathbf{x}}- {\mathbf{A}}^*{\mathbf{x}}\|_p^p \le \|{\mathbf{A}}^*{\mathbf{x}}\|_p^p + \varepsilon^p\|{\mathbf{x}}\|_{{\mathcal{X}}}^p\] and symmetrically, \(\|{\mathbf{A}}{\mathbf{x}}\|_p^p \ge \|{\mathbf{A}}^*{\mathbf{x}}\|_p^p - \varepsilon^p\|{\mathbf{x}}\|_{{\mathcal{X}}}^p\). This implies that discretizing to the grid of granularity \(\nu\) changes the \(L_p^p\) distortion bound by a negligible additive factor of \(\varepsilon^p\). Moreover, since the entries reside in \([-D', D']\) on a grid of step \(\nu\), the total number of representable values is \(\frac{2D'}{\nu}=\mathcal{O}\left(\frac{D'M^{1/p}n}{\varepsilon}\right)\). Hence, every entry \(A_{i,j}\) can be represented using \(\mathcal{O}\left(\log n+\log\frac{sD}{\varepsilon}\right)\) bits, which gives the claimed bit complexity. ◻

Thus, we have the following corollary to 4:

Corollary 1. Suppose \({\mathcal{X}}\) is a norm that admits an oblivious linear sketch for distinguishing distance \(1\) vs \(D\) using \(s\) space. Then there exists an adversarially robust streaming algorithm for \({\mathcal{X}}\) that, given oracle access to the corresponding embedding matrix, uses \(S\cdot\mathop{\mathrm{polylog}}(n)\) space and achieves a multiplicative \(\mathcal{O}\left(sD\right)\) approximation.

Putting together 1 with known equivalences between turnstile algorithms and linear sketches, we have the following:

Proof. Note that the forward direction follows immediately by 1, while the reverse direction holds for polynomially-long streams from known results, e.g., [45][47], [49]. ◻

Finally, we give a number of specific applications of 1 where the linear transformation \({\mathbf{A}}\) is explicit.

4.1.0.1 Robust graph total variation.

In graph signal processing, the graph total variation is a standard tool for quantifying the smoothness of a signal \({\mathbf{x}}\in \mathbb{R}^V\) defined on a graph \(G=(V,E)\). Fixing an arbitrary orientation of the edges, the corresponding incidence matrix \({\mathbf{B}}\in \{-1,0,1\}^{|E| \times |V|}\) maps vertex signals to edge-wise differences. The graph total variation norm can be written as \(\|{\mathbf{x}}\|_{\text{TV}} = \|{\mathbf{B}}{\mathbf{x}}\|_1\), i.e., the \(L_1\) norm of edge differences. The matrix \({\mathbf{B}}\) thus provides an isometric linear embedding from \((\mathbb{R}^V, \|\cdot\|_{\text{TV}})\) into \((\mathbb{R}^E, \|\cdot\|_1)\). Then applying 1, we have:

Theorem 5 (Robust Graph Total Variation). There exists an adversarially robust turnstile streaming algorithm that computes a \((1+\varepsilon)\)-approximation to the graph total variation seminorm \(\|{\mathbf{x}}\|_{\text{TV}(G)} = \sum_{(u,v)\in E} |x_u - x_v|\), using \(\mathop{\mathrm{poly}}\left(\frac{1}{\varepsilon},\log|V|\right)\) bits of space.

4.1.0.2 Robust trend filtering (\(k\)-th order total variation).

Consider a temporal signal \({\mathbf{x}}\in \mathbb{R}^n\), which can be viewed as a sequence of observations over time, e.g., measurements or prices. A natural way to quantify the variability of such a signal is through its discrete differences, where the first-order differences capture successive changes \(x_{i+1} - x_i\) and higher-order differences capture more refined notions of variation, such as curvature for \(k=2\) and higher-order fluctuations. Formally, the \(k\)-th order difference operator is represented by a matrix \({\mathbf{D}}^{(k)}\), obtained by iteratively applying a total of \(k\) times the first-order operator \({\mathbf{D}}^{(1)} \in \mathbb{R}^{(n-1)\times n}\), which has \(1\) on the main diagonal and \(-1\) on the superdiagonal, i.e., the diagonal that is directly above and to the right of the main diagonal. In this way, the \(k\)-th order total variation norm is defined as \(\|{\mathbf{x}}\|_{TV^{(k)}} = \|{\mathbf{D}}^{(k)}{\mathbf{x}}\|_1\), so that it is the sum of the absolute values of these higher-order differences. Intuitively, this quantity measures how irregular the signal is at scale \(k\). For example, \(k=1\) penalizes sharp jumps, while \(k=2\) penalizes changes in slope, encouraging piecewise linear structure. This notion forms the basis of trend filtering, where one seeks signals that balance fidelity to data with low higher-order variation. Note that since \({\mathbf{D}}^{(k)}\) can be explicitly computed, the \(k\)-th order total variation norm embeds explicitly and isometrically into \(L_1\). Thus by applying 1, we have:

Theorem 6 (Robust Trend Filtering). There exists an adversarially robust turnstile streaming algorithm that computes a \((1+\varepsilon)\)-approximation to the \(k\)-th order total variation norm \(\|{\mathbf{x}}\|_{TV^{(k)}} = \|{\mathbf{D}}^{(k)}{\mathbf{x}}\|_1\), using \(\mathop{\mathrm{poly}}\left(\frac{1}{\varepsilon},\log n\right)\) bits of space.

4.1.0.3 Robust Earth Mover distance (EMD).

Earth Mover distance (EMD) is a common metric for comparing two distributions over a discrete grid \([\Delta]^d\), so that \(n = \Delta^d\). Intuitively, EMD quantifies the minimal “work” needed to transform one distribution into another, where work is the amount of mass moved times the distance the mass is moved. We interpret \(\|{\mathbf{x}}\|_{\mathop{\mathrm{EMD}}}\) as the Earth Mover Distance between the signed measure \({\mathbf{x}}\) and the zero vector \(\mathbf{0}\), i.e., \(\|{\mathbf{x}}\|_{\mathop{\mathrm{EMD}}} := \mathop{\mathrm{EMD}}({\mathbf{x}}, \mathbf{0})\). Equivalently, for two distributions \(\mu,\nu\), we have \(\mathop{\mathrm{EMD}}(\mu,\nu) = \|\mu - \nu\|_{\mathop{\mathrm{EMD}}}\). Perhaps the most well-used embeddings for EMD are based on randomly shifted quadtrees and give \(\mathcal{O}\left(d\log\Delta\right)\) distortion, but provide a “for each” guarantee. That is, for a fixed signal \({\mathbf{x}}\), the embedding preserves distances in expectation over its random choices. However, this randomized embedding is insufficient for our purposes in the adversarially robust streaming setting, as an adaptive adversary can exploit the particular random shift to create worst-case distortions.

Instead, consider the following construction of a fully deterministic embedding. Let \({\mathbf{A}}_{{\mathbf{s}}} : \mathbb{R}^n \to \mathbb{R}^K\) denote the linear embedding induced by a single quadtree shift \({\mathbf{s}}\), with \(K = \mathcal{O}\left(n\right)\). We define the deterministic, concatenated embedding \[{\mathbf{A}}{\mathbf{x}}= \frac{1}{n} \bigoplus_{s \in [\Delta]^d} {\mathbf{A}}_{{\mathbf{s}}}{\mathbf{x}},\] which aggregates the contributions from all possible shifts. By linearity of expectation, the \(L_1\) norm of \({\mathbf{A}}{\mathbf{x}}\) exactly matches the expected value over all shifts: \[\|{\mathbf{A}}{\mathbf{x}}\|_1 = \frac{1}{n} \sum_{{\mathbf{s}}\in [\Delta]^d} \|{\mathbf{A}}_{{\mathbf{s}}}{\mathbf{x}}\|_1 = \underset{{\mathbf{s}}}{\mathbb{E}}\left[\|{\mathbf{A}}_{{\mathbf{s}}}{\mathbf{x}}\|_1\right].\] This gives a deterministic, universal “for all” guarantee, so that for all \({\mathbf{x}}\in\mathbb{R}^n\), we have \[\|{\mathbf{x}}\|_{\mathop{\mathrm{EMD}}} \le \|{\mathbf{A}}{\mathbf{x}}\|_1 \le \mathcal{O}\left(d \log \Delta\right)\|{\mathbf{x}}\|_{\mathop{\mathrm{EMD}}}.\] Although the embedding dimension grows from \(K=\mathcal{O}\left(n\right)\) to \(M=nK=\mathcal{O}\left(n^2\right)\), the resulting \(L_1\) estimation algorithm only uses space polylogarithmic in the dimension. Hence by applying 1, we have:

4.1.0.4 Robust \(k\)-median clustering.

Next, we consider the \(k\)-median clustering problem over the grid \([\Delta]^d\), where a dataset is represented as a multiset of points, or equivalently, a mass vector \(\mu \in \mathbb{R}^{[\Delta]^d}\). The \(k\)-median objective seeks a set of \(k\) centers \({\mathcal{C}}\subseteq [\Delta]^d\) minimizing the total \(L_2\) distance from each point to its nearest center. Equivalently, for an assignment vector \(\nu_{{\mathcal{C}}}\) that routes each unit of mass in \(\mu\) to its closest center in \({\mathcal{C}}\), the \(k\)-median cost can be expressed as an Earth Mover Distance: \[\mathop{\mathrm{cost}}_k(\mu) = \min_{{\mathcal{C}}: |{\mathcal{C}}|=k} \mathop{\mathrm{EMD}}(\mu, \nu_{{\mathcal{C}}}).\] Thus, to approximate this quantity in the streaming setting, previous works often utilize the standard embedding of \(\mathop{\mathrm{EMD}}\) into \(L_1\) via randomly shifted quadtrees. Fix a shift \(s \in \mathbb{Z}^d\) and suppose without loss of generality that \(\Delta=2^\ell\) for some integer \(\ell>0\). Then for each scale \(t \in \{0,1,\ldots,\ell\}\), define a grid \(\mathcal{G}_{s,t}\) with side length \(2^t\). For a mass vector \(\mu\), let \(G_{s,t}\mu\) denote the vector recording the total mass in each cell of \(\mathcal{G}_{s,t}\). Then the embedding is defined by concatenation across scales: \[G_s \mu = (G_{s,0}\mu)\circ (2 \cdot G_{s,1}\mu)\circ \cdots \circ (2^t \cdot G_{s,t}\mu)\circ \cdots \circ (2^\ell \cdot G_{s,\ell}\mu).\] The key intuition is that the contribution of a unit of mass to the \(L_1\) norm \(\|G_s(\mu - \nu)\|_1\) is determined by the finest scale at which the mass assigned in \(\mu\) and \(\nu\) fall into different cells. Because coarser grids are weighted more heavily, this construction ensures that the \(L_1\) norm faithfully captures transportation cost. In particular, this embedding provides an upper bound on \(\mathop{\mathrm{EMD}}(\mu,\nu)\) up to a factor of \(\mathcal{O}\left(d \log \Delta\right)\).

As in the EMD setting, to obtain adversarial robustness we derandomize the construction by concatenating over all shifts, yielding a deterministic embedding \({\mathbf{A}}\) with a “For All” guarantee. Applying 1 to the embedded vector allows us to approximate \(\|{\mathbf{A}}(\mu - \nu_{{\mathcal{C}}})\|_1\) for all candidate center sets \({\mathcal{C}}\) simultaneously in sublinear space.

Finally, we recall that there exists a collection \({\mathcal{C}}\) of candidate sets of centers and assigned masses such that \(|{\mathcal{C}}|\le(\Delta m)^{\mathcal{O}\left(kd\right)}\), one of which can be used to find a constant-factor approximation to the optimal \(k\)-median clustering cost [56], [57]. For our purposes, it suffices to enumerate over this candidate set, though we remark that there are more efficient top-down search processes to find a good candidate set [56], [57]. Therefore, we have:

4.2 Applications to Entropy Estimation↩︎

In this section, we leverage our adversarially robust \(F_p\) estimation algorithms to obtain a black-box procedure for estimating entropy. Recall that given a frequency vector \({\mathbf{v}}\in\mathbb{R}^n\), the Shannon entropy is defined as \(H({\mathbf{v}})=-\sum_{i=1}^n v_i\log v_i\). We first recall the following relationship between the Shannon entropy and its exponentiation:

Observation 7. An \(\varepsilon\)-additive approximation to the Shannon entropy \(H(v)\) is a \((1+\varepsilon)\)-multiplicative approximation to \(h(v):=2^{H(v)}\) and vice versa.

In light of this observation, it suffices to focus on computing a \((1+\varepsilon)\)-multiplicative approximation to \(h(v)=2^{H(v)}\). To that end, we recall to following structural property that facilitates entropy approximation.

Lemma 12 (Section 3.3 in [61]). Let \(k=\log\frac{1}{\varepsilon}+\log\log m\) and \(\varepsilon'=\frac{\varepsilon}{12(k+1)^3\log m}\). There exists an efficiently computable collection \(\{y_0,\ldots,y_k\}\) with each \(y_i\in(0,2)\), together with a deterministic procedure that, given \((1+\varepsilon')\)-approximations to \(F_{y_i}(v)\) for all \(i\), outputs a \((1+\varepsilon)\)-approximation to \(h(v)=2^{H(v)}\).

The points \(\{y_0,\ldots,y_k\}\) from 12 can be constructed explicitly as described in [61]. Let \(\ell=\frac{1}{2(k+1)\log m}\) and define \[f(z)=\frac{(k^2\ell)z-\ell(k^2+1)}{2k^2+1}.\] Then each \(y_i\) is given by \(y_i=1+f\left(\cos\left(\frac{i\pi}{k}\right)\right)\), which allows the entire set to be computed in linear time. Finally, a \((1+\varepsilon)\)-multiplicative estimate of \(h(v)=2^{H(v)}\) is obtained from \(2^{P(0)}\), where \(P(x)\) is the degree-\(k\) polynomial interpolating the points \(\{(y_i, F_{y_i}(v))\}_{i=0}^k\). Crucially, since \(y_i\in(0,2)\) for each \(i\), we can apply our \(F_p\) estimation algorithm to get an additive \(\varepsilon\)-approximation to the Shannon entropy:

4.3 Embedding into \(L_2^2\)↩︎

In this section, we show that our algorithm for \(L_p\) estimation, \(p \in [0,2)\) can be extended to a broader class of functions. In particular, consider the task of estimating \(\left\lVert{\mathbf{x}}\right\rVert_g := \sum_i g(x_i)\) for some specific function \(g\). We show that if \(g\) has the form \(g(t) = f(t^2)\) for some Bernstein function \(f\) (4), then we can design an adversarially robust streaming algorithm which computes a \((1 \pm \varepsilon)\)-approximation to \(\left\lVert{\mathbf{x}}\right\rVert_g\) at each time in the adaptive stream, using \(\mathop{\mathrm{poly}}\left(\frac{1}{\varepsilon},\log n\right)\) bits of space. We note that this definition captures many interesting choices of the function \(g\), which are relevant for various applications.

  • (Pseudo–Huber Loss): \(g_{\tau}(x) = \tau(\sqrt{1 + (x / \tau)^2} - 1)\)

  • (Cauchy/Lorentzian Loss): \(g_{\tau}(x) = \log (1 + x^2 / \tau)\)

  • (Generalized Charbonnier): \(g_{\tau} = (1 + x^2 / \tau)^\beta - 1\) for \(0 < \beta \le 1\).

  • (Welsch/Leclerc Loss): \(g_{\tau}(x) = 1 - e^{-x^2 / \tau}\)

  • (Geman–McClure loss): \(\displaystyle g_{\tau} =\frac{x^2}{x^2 + \tau}\)

We first recall the following classical result in [52].

Definition 3 (Negative Type (NT) Function). A symmetric continuous function \(\psi : \mathbb{R}^d \to \mathbb{R}\) is NT if \(\psi(0) = 0\), \(\psi(x) \geq 0\), and for any \(n \in \mathbb{N}\), \(\{x_i\} \subset \mathbb{R}^d\) and \(\{\alpha_i\} \subset \mathbb{R}\) such that \(\sum \alpha_i = 0\), \[\sum_{i,j} \alpha_i\alpha_j\psi(x_i - x_j) \leq 0.\]

Theorem 8 ([52]). Let \(\psi: \mathbb{R}^d \to \mathbb{R}\) be a continuous function satisfying the conditions of 3. Then the following are equivalent:

  1. \(\psi\) is of negative type.

  2. There exists a Hilbert space \(H\) and a mapping \(\Phi\) such that \(\psi(x - y) = \|\Phi(x) - \Phi(y)\|_H^2\).

  3. \(f_t(x) = e^{-t\psi(x)}\) is Positive Definite for all \(t > 0\).

Definition 4 (Bernstein function, e.g., [62]). A function \(f:(0,\infty)\to[0,\infty)\) is called a Bernstein function if \(f\in C^\infty(0,\infty)\) and for all \(n\in\mathbb{N}_0\) and all \(x>0\), \[(-1)^n f^{(n+1)}(x) \ge 0.\] where \(f^{(n)}\) denotes the \(n\)-th derivative of the function \(f\).

Theorem 9 (Theorem 3.1, [63]). Let \(f: [0, \infty) \to [0, \infty)\) and \(f(0) = 0\). Then the following two statements are equivalent:

  1. \(f\) is a Bernstein function.

  2. For \(\xi \in \mathbb{R}^k\), \(f(|\xi|^2)\) is a continuous negative type function for all \(k \ge 1\).

By applying 8 and 9 coordinate-wise and then taking the sum over all coordinates, we have the following theorem. Without loss of generality, we can assume that \(\Phi(0) = 0\); otherwise, we can simply replace the embedding \(\Phi({\mathbf{x}})\) by \(\Phi({\mathbf{x}}) - \Phi(0)\) to satisfy this condition.

Theorem 10. Suppose \(f: \mathbb{R}^n \to \mathbb{R}\) satisfies \(f(x) = \sum_{i=1}^n g(x_i)\), where \(g(x) = h(x^2)\) for some Bernstein function \(h\) and \(h(0) = 0\). There exists an isometric embedding \(\Phi\) from \(\mathbb{R}^n\) into a Hilbert space \(H\), such that \[f({\mathbf{u}}-{\mathbf{v}})=\|\Phi({\mathbf{u}})-\Phi({\mathbf{v}})\|_2^2,\qquad \|\Phi(0)\|_2^2=0.\]

To utilize our algorithm for \(L_p\) estimation for \(p \in[0, 2)\), we also need a (non-robust) algorithm for estimating \(\left\lVert{\mathbf{x}}\right\rVert_g\). In the work of [32], the authors give the following lemma, which is based on the zero-one law of the form of the function \(g\) in [64].

Lemma 13 ([32], [64]). Given a function \(g: \mathbb{Z}_{n \ge 0} \to \mathbb{R}\) where \(g(x) = f(x^2 )\) for some Bernstein function \(f\), there exists a one-pass (non-robust) turnstile streaming algorithm that \((1 \pm \varepsilon)\)-estimates the value of \(\left\lVert{\mathbf{x}}\right\rVert_g = \sum_{i = 1}^n g(x_i)\) with high probability in space \(\mathop{\mathrm{poly}}\left(\frac{1}{\varepsilon},\log n\right)\).

Finally, by combining 10 and 13, we obtain adversarially robust turnstile streaming algorithms that compute a \((1+\varepsilon)\)-approximation for any \(g\)-sum \(\|{\mathbf{x}}\|_g\), where \(g(x) = h(x^2)\) for some Bernstein function \(h\) and \(h(0) = 0\).

Theorem 11. Given a function \(g: \mathbb{Z}_{n \ge 0} \to \mathbb{R}\) where \(g(x) = f(x^2 )\) for some Bernstein function \(f\) and \(f(0) = 0\), there exists an adversarially robust insertion-deletion streaming algorithm on a stream of length \(m\) that with high probability, outputs a \((1 \pm \varepsilon)\)-approximation to the value of \(\left\lVert{\mathbf{x}}\right\rVert_g = \sum_{i = 1}^n g(x_i)\). For \(m = \mathop{\mathrm{poly}}(n)\), the algorithm uses \(\mathop{\mathrm{poly}}\left(\frac{1}{\varepsilon},\log n\right)\) bits of space.

Acknowledgements↩︎

Elena Gribelyuk and Huacheng Yu are supported in part by an NSF CAREER award CCF-2339942. Honghao Lin was supported in part by a Simons Investigator Award and a CMU Paul and James Wang Sercomm Presidential Graduate Fellowship. David P. Woodruff is supported in part by Office of Naval Research award number N000142112647 and a Simons Investigator Award. Samson Zhou is supported in part by NSF CCF-2335411 and gratefully acknowledges funding provided by the Oak Ridge Associated Universities (ORAU) Ralph E. Powe Junior Faculty Enhancement Award.

References↩︎

[1]
O. Ben-Eliezer, R. Jayaram, D. P. Woodruff, and E. Yogev, “A framework for adversarially robust streaming algorithms,” J. ACM, vol. 69, no. 2, pp. 17:1–17:33, 2022.
[2]
I. Mironov, M. Naor, and G. Segev, “Sketching in adversarial environments,” SIAM J. Comput., vol. 40, no. 6, pp. 1845–1870, 2011.
[3]
S. Mitrovic, I. Bogunovic, A. Norouzi-Fard, J. Tarnawski, and V. Cevher, “Streaming robust submodular maximization: A partitioned thresholding approach,” in Advances in neural information processing systems 30: Annual conference on neural information processing systems, 2017, pp. 4557–4566.
[4]
D. Avdiukhin, S. Mitrovic, G. Yaroslavtsev, and S. Zhou, “Adversarially robust submodular maximization under knapsack constraints,” in Proceedings of the 25th ACM SIGKDD international conference on knowledge discovery & data mining, KDD, 2019, pp. 148–156.
[5]
O. Ben-Eliezer and E. Yogev, “The adversarial robustness of sampling,” in Proceedings of the 39th ACM SIGMOD-SIGACT-SIGAI symposium on principles of database systems, PODS, 2020, pp. 49–62.
[6]
Y. Cherapanamjeri and J. Nelson, “On adaptive distance estimation,” in Advances in neural information processing systems 33: Annual conference on neural information processing systems, NeurIPS, 2020.
[7]
N. Alon, O. Ben-Eliezer, Y. Dagan, S. Moran, M. Naor, and E. Yogev, “Adversarial laws of large numbers and optimal regret in online classification,” in STOC: 53rd annual ACM SIGACT symposium on theory of computing, 2021, pp. 447–455.
[8]
V. Braverman, A. Hassidim, Y. Matias, M. Schain, S. Silwal, and S. Zhou, “Adversarial robustness of streaming algorithms through importance sampling,” in Advances in neural information processing systems 34: Annual conference on neural information processing systems, NeurIPS, 2021, pp. 3544–3557.
[9]
M. Ajtai et al., “The white-box adversarial data stream model,” in PODS ’22: International conference on management of data, 2022, pp. 15–27.
[10]
O. Ben-Eliezer, T. Eden, and K. Onak, “Adversarially robust streaming via dense-sparse trade-offs,” in 5th symposium on simplicity in algorithms, SOSA@SODA, 2022, pp. 214–227.
[11]
A. Beimel, H. Kaplan, Y. Mansour, K. Nissim, T. Saranurak, and U. Stemmer, “Dynamic algorithms against an adaptive adversary: Generic constructions and lower bounds,” in STOC ’22: 54th annual ACM SIGACT symposium on theory of computing, 2022, pp. 1671–1684.
[12]
A. Chakrabarti, P. Ghosh, and M. Stoeckl, “Adversarially robust coloring for graph streams,” in 13th innovations in theoretical computer science conference, ITCS, 2022, pp. 37:1–37:23.
[13]
B. Menuhin and M. Naor, “Keep that card in mind: Card guessing with limited memory,” in 13th innovations in theoretical computer science conference, ITCS, 2022, pp. 107:1–107:28.
[14]
M. Naor and N. Oved, “Bet-or-pass: Adversarially robust bloom filters,” in Theory of cryptography - 20th international conference, TCC, proceedings, part II, 2022, pp. 777–808.
[15]
S. Assadi, A. Chakrabarti, P. Ghosh, and M. Stoeckl, “Coloring in graph streams via deterministic and adversarially robust algorithms,” in Proceedings of the 42nd ACM SIGMOD-SIGACT-SIGAI symposium on principles of database systems, PODS, 2023, pp. 141–153.
[16]
Y. Cherapanamjeri, S. Silwal, D. P. Woodruff, F. Zhang, Q. Zhang, and S. Zhou, “Robust algorithms on adaptive inputs from bounded adversaries,” in The eleventh international conference on learning representations, ICLR, 2023.
[17]
E. Cohen, J. Nelson, T. Sarlós, and U. 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, 2023, pp. 7235–7243.
[18]
I. Dinur, U. Stemmer, D. P. Woodruff, and S. 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, 2023, pp. 35–65.
[19]
B. Peng and A. Rubinstein, “Near optimal memory-regret tradeoff for online learning,” in 64th IEEE annual symposium on foundations of computer science, FOCS, 2023, pp. 1171–1194.
[20]
D. P. Woodruff, F. Zhang, and S. Zhou, “On robust streaming for learning with experts: Algorithms and lower bounds,” in Advances in neural information processing systems 36: Annual conference on neural information processing systems, NeurIPS, 2023.
[21]
S. Ahmadian and E. Cohen, “Unmasking vulnerabilities: Cardinality sketches under adaptive inputs.” 2024, [Online]. Available: https://arxiv.org/abs/2405.17780.
[22]
Y. Feng, A. Jain, and D. P. Woodruff, “Fast white-box adversarial streaming without a random oracle,” in Forty-first international conference on machine learning, ICML, 2024.
[23]
E. Gribelyuk, H. Lin, D. P. Woodruff, H. Yu, and S. Zhou, “A strong separation for adversarially robust \(L_0\) estimation for linear sketches,” in 65th IEEE annual symposium on foundations of computer science, FOCS, 2024, pp. 2318–2343.
[24]
D. P. Woodruff and S. Zhou, “Adversarially robust dense-sparse tradeoffs via heavy-hitters,” in Advances in neural information processing systems 38: Annual conference on neural information processing systems, NeurIPS, 2024.
[25]
E. Cohen, M. Singhal, and U. Stemmer, “Breaking the quadratic barrier: Robust cardinality sketches for adaptive queries,” in Forty-second international conference on machine learning, ICML, 2025.
[26]
E. Gribelyuk, H. Lin, D. P. Woodruff, H. Yu, and S. Zhou, “Lifting linear sketches: Optimal bounds and adversarial robustness,” in Proceedings of the 57th annual ACM symposium on theory of computing, STOC, 2025, pp. 395–406.
[27]
A. Andoni, T. Haris, E. Kelman, and K. Onak, “Efficient algorithms for adversarially robust approximate nearest neighbor search,” CoRR, vol. abs/2601.00272, 2026.
[28]
O. Ben-Eliezer, K. Onak, and S. Silwal, “Robust streaming against low-memory adversaries,” in 17th innovations in theoretical computer science conference, ITCS, 2026, pp. 16:1–16:23.
[29]
E. Cohen, E. Gribelyuk, J. Nelson, and U. Stemmer, “Adaptively robust resettable streaming,” CoRR, vol. abs/2601.21989, 2026.
[30]
E. Cohen, J. Nelson, T. Sarlós, M. Singhal, and U. Stemmer, “One attack to rule them all: Tight quadratic bounds for adaptive queries on cardinality sketches,” in Proceedings of the 2026 annual ACM-SIAM symposium on discrete algorithms, SODA, 2026, pp. 3162–3200.
[31]
A. Gál, G. Kol, R. R. Saxena, and H. Yu, “Optimal white-box adversarial streaming lower bounds for approximating LIS length,” in 17th innovations in theoretical computer science conference, ITCS, 2026, pp. 64:1–64:17.
[32]
E. Gribelyuk, H. Lin, D. P. Woodruff, H. Yu, and S. Zhou, “Adversarial robustness on insertion-deletion streams,” in Proceedings of the 57th annual ACM symposium on theory of computing, STOC, 2026.
[33]
H. Lin, Z. Song, D. P. Woodruff, S. Xie, and S. Zhou, \(L_p\) sampling in distributed data streams with applications to adversarial robustness,” in Proceedings of the 2026 annual ACM-SIAM symposium on discrete algorithms, SODA, 2026, pp. 4342–4409.
[34]
N. Alon, Y. Matias, and M. Szegedy, “The space complexity of approximating the frequency moments,” J. Comput. Syst. Sci., vol. 58, no. 1, pp. 137–147, 1999.
[35]
P. Indyk, “Stable distributions, pseudorandom generators, embeddings, and data stream computation,” J. ACM, vol. 53, no. 3, pp. 307–323, 2006.
[36]
P. Li, “Estimators and tail bounds for dimension reduction in \(\ell_\alpha\) (\(0<p\le 2\)) using stable random projections,” in Proceedings of the nineteenth annual ACM-SIAM symposium on discrete algorithms, SODA, 2008, pp. 10–19.
[37]
D. M. Kane, J. Nelson, and D. 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, 2010, pp. 1161–1178.
[38]
D. M. Kane, J. Nelson, and D. P. Woodruff, “An optimal algorithm for the distinct elements problem,” in Proceedings of the twenty-ninth ACM SIGMOD-SIGACT-SIGART symposium on principles of database systems, PODS, 2010, pp. 41–52.
[39]
D. M. Kane, J. Nelson, E. Porat, and D. P. Woodruff, “Fast moment estimation in data streams in optimal space,” in Proceedings of the 43rd ACM symposium on theory of computing, STOC, 2011, pp. 745–754.
[40]
S. Ganguly, “A lower bound for estimating high moments of a data stream,” CoRR, vol. abs/1201.0253, 2012.
[41]
D. P. Woodruff and S. Zhou, “Separations for estimating large frequency moments on data streams,” in 48th international colloquium on automata, languages, and programming, ICALP, 2021, pp. 112:1–112:21.
[42]
S. Ganguly, “Polynomial estimators for high frequency moments,” CoRR, vol. abs/1104.4552, 2011.
[43]
S. Ganguly and D. P. Woodruff, “High probability frequency moment sketches,” in 45th international colloquium on automata, languages, and programming, ICALP, 2018, pp. 58:1–58:15.
[44]
D. P. Woodruff and S. Zhou, “Tight bounds for adversarially robust streams and sliding windows via difference estimators,” in 62nd IEEE annual symposium on foundations of computer science, FOCS, 2021, pp. 1183–1196.
[45]
Y. Li, H. L. Nguyen, and D. P. Woodruff, “Turnstile streaming algorithms might as well be linear sketches,” in Symposium on theory of computing, STOC, 2014, pp. 174–183.
[46]
Y. Ai, W. Hu, Y. Li, and D. P. Woodruff, “New characterizations in turnstile streams with applications,” in 31st conference on computational complexity, CCC, 2016, pp. 20:1–20:22.
[47]
K. Hosseini, S. Lovett, and G. Yaroslavtsev, “Optimality of linear sketching under modular updates,” in 34th computational complexity conference, CCC, 2019, pp. 13:1–13:17.
[48]
J. Kallaugher and E. Price, “Separations and equivalences between turnstile streaming and linear sketching,” in Proccedings of the 52nd annual ACM SIGACT symposium on theory of computing, STOC, 2020, pp. 1223–1236.
[49]
C. Jiang, Y. Liu, and H. Yu, “Turnstile streaming algorithms might (still) as well be linear sketches, for polynomial-length streams.” 2026, [Online]. Available: https://arxiv.org/abs/2604.22052.
[50]
M. Hardt and D. P. Woodruff, “How robust are linear sketches to adaptive inputs?” in Symposium on theory of computing conference, STOC, 2013, pp. 121–130.
[51]
A. Andoni, R. Krauthgamer, and I. P. Razenshteyn, “Sketching and embedding are equivalent for norms,” SIAM J. Comput., vol. 47, no. 3, pp. 890–916, 2018.
[52]
I. J. Schoenberg, “Metric spaces and positive definite functions,” Transactions of the American Mathematical Society, vol. 44, no. 3, pp. 522–536, 1938.
[53]
I. Schoenberg, “Sur la définition axiomatique d’une classe d’espace distanciés vectoriellement applicable sur l’espace de hilbert,” Ann. Math, vol. 36, pp. 724–732, 1935.
[54]
G. Robertson, “Negative type and bi-lipschitz embeddings into hilbert space,” Bulletin of the Malaysian Mathematical Sciences Society, vol. 47, no. 5, p. 139, 2024.
[55]
P. Indyk, “Algorithms for dynamic geometric problems over data streams,” in Proceedings of the 36th annual ACM symposium on theory of computing, 2004, pp. 373–380.
[56]
A. Backurs, P. Indyk, I. P. Razenshteyn, and D. P. Woodruff, “Nearly-optimal bounds for sparse recovery in generic norms, with applications to k-median sketching,” in Proceedings of the twenty-seventh annual ACM-SIAM symposium on discrete algorithms, SODA, 2016, pp. 318–337.
[57]
V. Cohen-Addad, D. P. Woodruff, and S. Zhou, “Streaming euclidean k-median and k-means with o(log n) space,” in 64th IEEE annual symposium on foundations of computer science, FOCS, 2023.
[58]
G. Schechtman, “More on embedding subspaces of \(L_p\) in \(\ell^n_r\),” Compositio Mathematica, vol. 61, no. 2, pp. 159–169, 1987.
[59]
M. Talagrand, “Embedding subspaces of L1 into \(\ell^N_1\),” Proceedings of the American Mathematical Society, pp. 363–369, 1990.
[60]
G. Schechtman and A. Zvavitch, “Embedding subspaces of \(L_p\) into \(\ell^N_p\), 0< p< 1,” Mathematische Nachrichten, vol. 227, no. 1, pp. 133–142, 2001.
[61]
N. J. A. Harvey, J. Nelson, and K. Onak, “Sketching and streaming entropy via approximation theory,” in 49th annual IEEE symposium on foundations of computer science, FOCS, 2008, pp. 489–498.
[62]
R. L. Schilling, R. Song, and Z. Vondracek, Bernstein functions: Theory and applications, vol. 37. Walter de Gruyter, 2012.
[63]
F. Kühn and R. L. Schilling, “A probabilistic proof of schoenberg’s theorem,” Journal of Mathematical Analysis and Applications, vol. 476, no. 1, pp. 13–26, 2019, doi: https://doi.org/10.1016/j.jmaa.2018.11.046.
[64]
V. Braverman, S. R. Chestnut, D. P. Woodruff, and L. F. Yang, “Streaming space complexity of nearly all functions of one variable on frequency vectors,” in Proceedings of the 35th ACM SIGMOD-SIGACT-SIGAI symposium on principles of database systems, PODS, 2016, pp. 261–276.

  1. As we explain next, \({\mathbf{v}}\) can be computed via a kernel regression over these previously observed queries \(f({\mathbf{q}}_1),f({\mathbf{q}}_2),\ldots,f({\mathbf{q}}_L)\) on which the estimator failed. Crucially, this regression can be implemented using only estimates of norms and pairwise inner products of the form \(\langle f({\mathbf{q}}_i), f({\mathbf{q}}_j)\rangle\) and \(\langle f({\mathbf{z}}), f({\mathbf{q}}_i)\rangle\), which can themselves be obtained using \(F_p\) sketches.↩︎

  2. We refer the reader to 3 for more details regarding how to estimate various terms in the expansion.↩︎

  3. Note that for this condition, we require that any any time, the prefix of the stream has \(F_p\) moment bounded by \(A\). Specifically, \(\|{\mathbf{z}}\|_p^p \leq \mathcal{O}\left(A\right)\) and \(\|{\mathbf{z}}- {\mathbf{q}}_i\|_p^p \leq \mathcal{O}\left(A\right)\) for all previous queries \({\mathbf{q}}_i\). Also, this directly implies that \(\|{\mathbf{q}}_i\|_p^p \leq \mathcal{O}\left(A\right)\), so \(\|{\mathbf{q}}_i - {\mathbf{q}}_j\|_p^p \leq \mathcal{O}\left(A\right)\) as well.↩︎