potentialpaper

MaxSketch: Robust Distinct Counting in Streams via Random Projections

Nikos Tsikouras, Constantine Caramanis, Christos Tzamos

NeurIPS 2026

Edit this page

Or clone it with git

Run in a terminal:

Needs Git LFS. To push, use an API key from your profile as the password.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

TL;DR. We develop a novel sketch-based approach for solve the streaming clustering problem, that requires exponentially less memory than an offline clustering algorithm.

Abstract. Estimating the number of distinct elements in a data stream is well understood when repeated elements are identical. In modern settings, however, observations are high-dimensional and noisy, so repeated instances of the same object are only approximately similar -- for example, different images of the same individual may vary significantly at the pixel level. Classical sketches such as HyperLogLog rely on consistent hash values for identical elements and break down in this regime. Recent work on robust distinct counting in general metric spaces gives algorithms that use O~(n/ε)\tilde O(\sqrt n/\varepsilon) words of memory and proves an Ω(n)\Omega(\sqrt n)-bit lower bound for general noisy datasets. We show that substantially improved memory guarantees are possible under geometric structure common in learned representations. We introduce MaxSketch, a simple max-linear sketch built from random Gaussian projections, and prove that it succeeds in estimating the number of distinct latent objects. Concretely, we show that under this geometric structure m=O(ε−2log⁡(2/δ))m = O( \varepsilon^{-2}\log (2/\delta)) independent Gaussian projections suffice to estimate the true distinct count within a factor of 1+ε1+\varepsilon with probability at least 1−δ1-\delta. Experiments on image streams confirm that MaxSketch accurately estimates distinct counts and generalizes beyond the training regime. Our results bridge classical streaming algorithms and modern representation learning, showing how geometric structure can fundamentally reduce the complexity of distinct counting.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

edit · history

DateVersionSubmitted toPDFEvidence
3 May 2026NeurIPS 2026submittedNeurIPS 2026Accept (oral)reviews ↓[1]PDF[1]
Missing a version?

NeurIPS 2026

Accept (oral) · 3 reviews · OpenReview

Updated 25 Nov 2026, 03:42 UTC.

Program Chairs · DecisionOpenReview ↗
Decision
Accept (oral)
Read decision
Meta-review

(a) summary

This paper discusses a robust version of the problem of counting the number of distinct elements in a data stream, where elements are considered equal if they are close enough in some metric. It introduces the concept of (η,ρ)(\eta,\rho)-clusterability (Definition 2.1) and MaxSketch which exploits the clusterability structure (Definition 3.1). It then establishes a high-probability bound on the relative error of an estimator of the number of clusters on the basis of MaxSketch under the (η,ρ)(\eta,\rho)-clusterability.

(b) strengths

  • This paper provides a strong theoretical result backing up the proposal, under the clusterability assumption (Reviewers 1qCd, XuGo).
  • The proposed MaxSketch algorithm is quite simple (Reviewer XuGo).

(c) weaknesses

  • In Theorem 4.4, very strong clusterability (i.e., smaller ρ\rho and η\eta) is needed, especially as nn becomes larger, and it is hard to verify in practice (Reviewers 1qCd, XuGo, mUkJ).
  • No lower bound is currently known, which is also acknowledged by the authors in Conclusion (Reviewer XuGo).
  • Experiments are not aligned with the theoretical development (Reviewer XuGo).
  • The problem of whether count supervision can induce clusterable embeddings is still open, which is also acknowledged by the authors in Limitations (Reviewer XuGo).

(d) I would appreciate it if the authors address appropriately the major concerns raised by the reviewers, especially on the alignment between theory and experiments, and on how well the clusterability holds in the experimental settings.

Minor points:

  • Line 159: distinct-element(s) counting
  • Line 155: Use of the angle brackets ⟨⋅⟩\langle\cdot\rangle to represent a sequence of vectors may be in conflict with the use of the same symbols to represent inner product.
  • Lines 162, 231, 271, 334, 344, 359, 623, 634: The minus sign "−-" should be replaced by a hyphen "-".
  • Lines 163, 164, 193: One may state that the unit vectors reside in Sd−1\mathbb{S}^{d-1}, in accordance with the description in line 155.
  • Line 229: The period "." at the end is missing.
  • Line 269: The definition of "±1\pm1 accuracy" should be described.
  • Lines 575, 576, 640: Use the same numbering of theorems as in the main text.
Final justification

The rating/confidence values are 5/5, 5/4, and 5/4. The PC notified contribution-type mismatch in one review, which I think is not serious as the review adequately addresses the contents. All the reviewers have acknowledged the author response positively. I am therefore happy to recommend acceptance of this paper.

I briefly went through Appendix B to check the theoretical development, and found some flaws summarized in the following. I feel that most of them are minor and easily fixable, but I would like to draw the authors' attention on them, especially on whether the rounding of indices would not affect the validity of the claims.

  • Appendix: Both ln⁡\ln and log⁡\log are used to represent the natural logarithm. The same notation should be used throughout.
  • Line 521: The symbol ⊆\subseteq is not defined.
  • Line 525: Var and Cov should not be italic.
  • Lines 527-528: if ... for all i,j=1,…,n(.→,)i,j=1,\ldots,n(. → ,) (T → t)hen
  • Lines 530, 533: Sudakov(-)Fernique
  • Lemma B.5: One should also assume ϵ≤1\epsilon\le 1, which is needed at the development in line 559.
  • Line 548: Δcenters(t)\Delta_{centers}(t) → Δcenters(k)\Delta_{\mathrm{centers}}(k)
  • Line 550: One needs the absolute value sign ∣⟨x(r),x(s)⟩∣|\langle x^{(r)},x^{(s)}\rangle|, ∣Cov(Gr,Gs)∣|\mathrm{Cov}(G_r,G_s)|, ∣E[GrGs]∣|\mathbb{E}[G_rG_s]|, etc.
  • Line 555: The range 1≤i≤(1+ε)k1\le i\le(1+\varepsilon)k is in general not the same as the range 1≤i≤k′=⌈(1+ε)k⌉1\le i\le k'=\lceil(1+\varepsilon)k\rceil, causing a flaw in the current proof. Although I think that this flaw would be fixable, there seem other instances in which rounding to integers is done rather casually (e.g., Lt+1L_{t+1} in the proof of Theorem B.8), which would need more careful treatment.
  • Line 555: Φ\Phi, the CDF of the standard normal distribution, is not defined.
  • Equation (3): A brief explanation of why the first inequality holds, such as "since the random variable max⁡i≤k′Zi−max⁡i≤kZi\max_{i\le k'}Z_i-\max_{i\le k}Z_i is nonnegative", would be appreciated.
  • Line 568: t′t' → k′k'
  • Line 588: "return" might be confusing, as rr is not the final output of the estimator.
  • Line 595: This sentence is too telegraphic.
  • Equations (5), (6): kk → k⋆k^\star
  • Line 600: GkG_k, defined as Gk(w)=⟨w,x(k)⟩G_k(w)=\langle w,x^{(k)}\rangle in line 596, is not monotonic in kk.
  • Line 602: By (the proof of) Lemma B.5,
  • Line 646: The definition of GkG_k overrides the definition Gr(w)=⟨w,x(r)⟩G_r(w)=\langle w,x^{(r)}\rangle in line 596, and is thus confusing.
  • Line 655: (1+ε)k(1+\varepsilon)k may not be an integer, so that a proper rounding should be done.
Area Chair mYo1 · Meta-reviewOpenReview ↗
Read meta-review
Meta-review

(a) summary

This paper discusses a robust version of the problem of counting the number of distinct elements in a data stream, where elements are considered equal if they are close enough in some metric. It introduces the concept of (η,ρ)(\eta,\rho)-clusterability (Definition 2.1) and MaxSketch which exploits the clusterability structure (Definition 3.1). It then establishes a high-probability bound on the relative error of an estimator of the number of clusters on the basis of MaxSketch under the (η,ρ)(\eta,\rho)-clusterability.

(b) strengths

  • This paper provides a strong theoretical result backing up the proposal, under the clusterability assumption (Reviewers 1qCd, XuGo).
  • The proposed MaxSketch algorithm is quite simple (Reviewer XuGo).

(c) weaknesses

  • In Theorem 4.4, very strong clusterability (i.e., smaller ρ\rho and η\eta) is needed, especially as nn becomes larger, and it is hard to verify in practice (Reviewers 1qCd, XuGo, mUkJ).
  • No lower bound is currently known, which is also acknowledged by the authors in Conclusion (Reviewer XuGo).
  • Experiments are not aligned with the theoretical development (Reviewer XuGo).
  • The problem of whether count supervision can induce clusterable embeddings is still open, which is also acknowledged by the authors in Limitations (Reviewer XuGo).

(d) I would appreciate it if the authors address appropriately the major concerns raised by the reviewers, especially on the alignment between theory and experiments, and on how well the clusterability holds in the experimental settings.

Minor points:

  • Line 159: distinct-element(s) counting
  • Line 155: Use of the angle brackets ⟨⋅⟩\langle\cdot\rangle to represent a sequence of vectors may be in conflict with the use of the same symbols to represent inner product.
  • Lines 162, 231, 271, 334, 344, 359, 623, 634: The minus sign "−-" should be replaced by a hyphen "-".
  • Lines 163, 164, 193: One may state that the unit vectors reside in Sd−1\mathbb{S}^{d-1}, in accordance with the description in line 155.
  • Line 229: The period "." at the end is missing.
  • Line 269: The definition of "±1\pm1 accuracy" should be described.
  • Lines 575, 576, 640: Use the same numbering of theorems as in the main text.
Final justification

The rating/confidence values are 5/5, 5/4, and 5/4. The PC notified contribution-type mismatch in one review, which I think is not serious as the review adequately addresses the contents. All the reviewers have acknowledged the author response positively. I am therefore happy to recommend acceptance of this paper.

I briefly went through Appendix B to check the theoretical development, and found some flaws summarized in the following. I feel that most of them are minor and easily fixable, but I would like to draw the authors' attention on them, especially on whether the rounding of indices would not affect the validity of the claims.

  • Appendix: Both ln⁡\ln and log⁡\log are used to represent the natural logarithm. The same notation should be used throughout.
  • Line 521: The symbol ⊆\subseteq is not defined.
  • Line 525: Var and Cov should not be italic.
  • Lines 527-528: if ... for all i,j=1,…,n(.→,)i,j=1,\ldots,n(. → ,) (T → t)hen
  • Lines 530, 533: Sudakov(-)Fernique
  • Lemma B.5: One should also assume ϵ≤1\epsilon\le 1, which is needed at the development in line 559.
  • Line 548: Δcenters(t)\Delta_{centers}(t) → Δcenters(k)\Delta_{\mathrm{centers}}(k)
  • Line 550: One needs the absolute value sign ∣⟨x(r),x(s)⟩∣|\langle x^{(r)},x^{(s)}\rangle|, ∣Cov(Gr,Gs)∣|\mathrm{Cov}(G_r,G_s)|, ∣E[GrGs]∣|\mathbb{E}[G_rG_s]|, etc.
  • Line 555: The range 1≤i≤(1+ε)k1\le i\le(1+\varepsilon)k is in general not the same as the range 1≤i≤k′=⌈(1+ε)k⌉1\le i\le k'=\lceil(1+\varepsilon)k\rceil, causing a flaw in the current proof. Although I think that this flaw would be fixable, there seem other instances in which rounding to integers is done rather casually (e.g., Lt+1L_{t+1} in the proof of Theorem B.8), which would need more careful treatment.
  • Line 555: Φ\Phi, the CDF of the standard normal distribution, is not defined.
  • Equation (3): A brief explanation of why the first inequality holds, such as "since the random variable max⁡i≤k′Zi−max⁡i≤kZi\max_{i\le k'}Z_i-\max_{i\le k}Z_i is nonnegative", would be appreciated.
  • Line 568: t′t' → k′k'
  • Line 588: "return" might be confusing, as rr is not the final output of the estimator.
  • Line 595: This sentence is too telegraphic.
  • Equations (5), (6): kk → k⋆k^\star
  • Line 600: GkG_k, defined as Gk(w)=⟨w,x(k)⟩G_k(w)=\langle w,x^{(k)}\rangle in line 596, is not monotonic in kk.
  • Line 602: By (the proof of) Lemma B.5,
  • Line 646: The definition of GkG_k overrides the definition Gr(w)=⟨w,x(r)⟩G_r(w)=\langle w,x^{(r)}\rangle in line 596, and is thus confusing.
  • Line 655: (1+ε)k(1+\varepsilon)k may not be an integer, so that a proper rounding should be done.
Reviewer mUkJOpenReview ↗
Rating
5/6
Confidence
4/5
Quality
4/4
Clarity
4/4
Significance
3/4
Originality
3/4
Contribution type
theory
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

This paper studies the distinct counting problems in Stream datas. In the abstract form, there are nn datas, one needs to create an algorithm which tell how many distinct datas in total (many has repetitions), the goal here is to small number of spaces for such purpose. Classical algorithm is Hyperloglog, which conclude that typically polylog(n) bits are sufficient. Here the authors analyzed the problem from a perspective that's more close to real setting. Datas that are not so different from each other should be recognized as the same 'true data' (Think of alphabets that are presented in images.) So there is a natural latent identification from observed datas to latent groups, where the problem here tried to identified the number of groups. The actual setup assumed datas that are within the same group lies has a small distance and not in the same groups have relative large distances for some given metric space, so that there is of whether one data should belong to group A or B in the setup.

In the generic metric space setup (i.e. one has access to a distance oracle for pairs of data, not underlying knowledge of the metric space), the memory usage has a n\sqrt{n} sharpthreshold by a recent paper of Zhang, while the original distinct counting problem algorithm Hyperloglog (there one only counts) requires only polylog(n). There are other works where datas are in Euclidean space, but the dependence highly depends on the dimensions (at a higher level, it relies on partition the spaces into grids.)

The authors came up with a setup where datas lies in high dimensional space, indeed on the sphere Sd−1S^{d-1}. The proper notion of distance separation between groups now can be realized from inner products. They create an algorithm that actually determine the number of groups up to a small multiplicative error with memory does not depend on the dimension.

Conceptually, to my understanding, the undelrying tool is known as Gaussian Mean Width. For a set A⊆Sd−1A \subseteq S^{d-1}, it gaussian mean width is of the following

Esup⁡x∈A⟨G,x⟩ ,\mathbb{E} \sup_{x\in A}\langle G, x\rangle\,,

where G∼N(0,Id)G \sim N(0,I_d), the value S(A){\cal S}(A) in the analysis is an empirical mean of the gaussian mean width. Suppose AA is the union of C1,…,CkC_1,\dots, C_k, where CiC_i is a spherical cap around a true data point xix_i, and x1,…,xkx_1,\dots,x_k are chosen uniformly on the sphere. (The caps represent the possible sampled data of the true data.) From this sampling, typical realization for a pairs are roughly

Then, the gaussian width of A=∪CiA= \cup C_{i} or A=∪{xi}A=\cup\{x_i\} are both roughly like log⁡k\sqrt{\log k}, provided the cap is small enough. Thus, estimating the gaussian mean width provides an rough idea of the group size.

Now, in the manuscript, the corresponding xix_i are not random data centers, but provided a structure with inner product separation. And the cap size is also determined by the inner product, that's the corresponding (η,ρ)(\eta,\rho) definition. So the analysis are based on this, with say tools such as Sudakov-Fernique inequality. Also, the sample size mm (the number of gaussian vectors generated) should be large enough to distinguish group sizes if the size differ by ε\varepsilon mulplicative scale, which produce the result where m≳log(n)/ε2m \gtrsim log(n)/\varepsilon^2 provided that caps are of size O(εlog⁡(n))O(\tfrac{\varepsilon}{\log(n)}), and between caps the distance are at least say π/2−O(εlog⁡(n))\pi/2 - O(\frac{\varepsilon}{\log(n)}).

Strengths and weaknesses

Overall, I find the paper interesting because can dealt with data in high dimension, instead of small Euclidean dimension, while maintaining a log(n)log(n) memory.

The paper is very clear and well presented.

From the originality perspective, I would characterize it as use some tool from one field (high dimensional probability) and applied to a variant of the problem (distinct counting), which does not seem in this setting before the papers cited.

The assumption capture something correctly, which is data are lying in high dimension. On the other hand, assuming datas are sort well separated by inner products is the main weakness, which might not be satisfied by many practical scenarios.

Questions

Question 1. It seems the data centers need to be well-separated (angle ~ 90 degrees), while the cluster size must be very small. To what extent do you think it can be extended?

Question 2. Maybe I'm wrong, conceptually, it seems to me that the dependence could only depend on kk? Rather than nn?

Limitations

Yes.

Final justification

The authors have addressed the questions I ask. But I don't think the result is not at the level of "groundbreaking impact on one or more areas of AI", so the score remains at 5.

Formatting concerns

No.

2 comments
Authors · RebuttalOpenReview ↗
Rebuttal

We thank the Reviewer for their valuable comments and feedback. We will incorporate their suggestions to improve the manuscript. Below, we address each of the Reviewer’s questions.

Question 1:\textbf{Question 1:} It seems the data centers need to be well-separated [...].

Answer 1:\textbf{Answer 1:} Thank you for raising this point. The conditions in Theorem 4.4 describe a sufficient geometric regime for obtaining the strong worst-case (1+ε)(1+\varepsilon)-approximation guarantee, rather than necessary conditions for MaxSketch to retain information about the count. Our experiments suggest that the latter can hold under substantially weaker geometry: in the face experiment, where clusters are less tightly concentrated and centers are not nearly orthogonal, MaxSketch still provides useful approximate counting accuracy (e.g., within ±100\pm100 identities), although the theorem's multiplicative guarantee no longer applies. We therefore expect the useful operating regime of MaxSketch to be broader than what is currently captured by Theorem 4.4; characterizing this regime theoretically is an interesting open direction.

Question 2:\textbf{Question 2:} Maybe I'm wrong, conceptually, it seems to me that the dependence could only depend on kk ? Rather than nn?

Answer 2:\textbf{Answer 2:} Thank you for this observation. This is partially the case: the center-separation dependence can naturally be expressed in terms of kk, since the relevant Gaussian maximum is over the kk centers. However, under our current worst-case within-cluster assumption, the perturbation term can still depend on nn, because MaxSketch takes a maximum over all stream elements and many within-cluster perturbations can contribute an extreme-value effect scaling with log⁡n\log n. We discuss this point in more detail, including a concrete example, in our Answer 1 to Reviewer 1qCd.

We are happy to provide more clarifications if required.

Reviewer mUkJ · CommentOpenReview ↗

Thank you very much for the response and the clarification. I will keep my score as 5/6.

Reviewer XuGoOpenReview ↗
Rating
5/6
Confidence
4/5
Quality
3/4
Clarity
4/4
Significance
3/4
Originality
3/4
Contribution type
theory
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

This paper introduces MaxSketch, a max-linear, permuation-invariant straming sketch for estiating the number of dinstict objects in a data stream when obeservations are noisy meaning that repeated appearances of the same entity are only approximately similar rather than identical. The motivating setting is modern perception pipelines (e.g., counting distinct people passing a camera), where raw observations are mapped into continuous embedding spaces and exact hash-based equality no longer holds. This is the pont of departure in terms of classical algorithms (e.g. \texttt{HyperLogLog}) as they require consistent hashing of identical keys.

The main contribution of the paper is the following: Assuming a (η,ρ)(\eta, \rho)-clusterability assumption that requires observations of the same object to form directionally tight clusters and distinct objects to correspond to well-separated directions in the embedding space, the authors show that m=O~(log⁡n/ϵ2)m = \tilde{O}(\log n / \epsilon^2) Gaussian projections suffice to estimate the distinct count within a (1+ϵ)(1+\epsilon) multiplicative factor with high probability. This is a significant improvement over the Ω(n)\Omega(\sqrt{n}) memory lower-bound established for robust distinct counting in general metric-spaces. The key insight is that max-aggregation of Guassian projections produces an extreme-value statistic whose expectation is monotonically increasing in the number of distinct clusters, and that the gap between adjacent cardinalities is detectable when cluster geometry satisfies the aforementioned clusterability assumption.

The analysis combines Gaussian process theory, Slepian's inequality, and concentration of Lipschitz functions. The authors additionally present a learnability result (Theorem 4.7) showing that, once projections are fixed, a monotone readout can be learned from polynomially many samples. Experiments on MNIST, CIFAR-10, and a merged face-counting dataset validate the approach and compare against DeepSets, LSTM aggregators, and zhang's metric-space lgorithm.

Strengths and weaknesses

Quality Strengths:

  1. Strong theoretical result with clear separation from prior work: The paper cleanly identifies a structural assumption (i.e. inner-product-based clusterability) under which the Ω(n)\Omega(\sqrt{n}) lower for general metric spaces is bypassed. The O(log⁡n/ϵ2)O(\log n / \epsilon^2) memory guarantee represents an exponential improvement and is neatly positioned relative to both classical streaming (\texttt{HyperLogLog} O(log⁡n)O(\log n) for exact keys) and recent robust counting work (Zhang's \tilde{O}(\sqrt{n}) for arbitrary metrics).

  2. Neat algorithm design: The MaxSketch construction is remarkably simple, i.e. random Gaussian projections followed by max-aggregation and averagin, yet supports a rich theoretical analysis. The max-aggregation's natural insensitivity to multiplicity (once a cluster contributes a large projection, repeats cannot increase it further) is a clean and intuitive property that distinguishes it from sum- or mean-based pooling.

  3. Proofs are complete: The paper provides full proofs (in appendix) with explicit assumptions, organized around three key lemmas: (i) Gaussian maxima comparison under bounded correlations (Lemma 4.1), (ii) perturbation from within-cluster noise (Lemma 4.2), and (iii) gap detection between adjacent cardinalities (Lemma 4.3). The modular structure makes the analysis relatively easy to follow for readers familiar with Gaussian process theory.

  4. Learnability reduction (Theorem 4.7): The observation that, once projections are fixed, the entire estimation problem collapses to learning a one-dimensional monotone function is theoretically appealing and practically useful. It provides polynomial sample complexity guarantees and connects the streaming problem to well-studied function approximation. 5 Well-motivated problem setting: The problem of counting distinct entities from noisy observations (faces, objects, etc.) is practically important and poorly served by existing tools. The paper clearly articulates why LSH fails (collision probability depends on distance, entangling identity with multiplicity) and why distance-based separation alone is insufficient.

Weaknesses

  1. The clusterability assumption may be restrictive and hard to verify in practice: The formal requirement is ρ<cρϵ2/ln⁡n\rho < c_{\rho} \epsilon^2 / \ln n, and η≤cηϵ2/(ln⁡n)2\eta \leq c_{\eta} \epsilon^2 / (\ln n)^2. Take for istance a large stream, n=106n = 10^{6}, even with ϵ=0.1\epsilon = 0.1, this requires ρ<cρ0.01/14≈cρ7×10−4\rho < c_{\rho} 0.01/14 \approx c_{\rho} 7 \times 10^{-4} and η≤cη0.01/196≈cη5×10−5\eta \leq c{\eta} 0.01/196 \approx c_{\eta} 5 \times 10^{-5}. These are extremely restrictive bounds on inter-class correlation and intra-class spread unless the constants unless the constatns cp,cηc_{p}, c_{\eta} are sufficiently large.

2 No lower bound under the clusterability assumption: The paper explicitly acknowledges that "no lower bound is currently known under our clusterability assumption." Without a matching lower bound, it is unclear whether O(log⁡n/\espilon2)O(\log n / \espilon^2) is tight or whether further improvement is possible.

  1. Experimental evaluation is somewhat disconnected from the theory: The experiments use m=4096m = 4096 projections universally without any justification from the theoretical bounds. The paper does not compute what m the theory requires for the experimental settings, nor does it verify that the clusterability parameters (η,ρ)(\eta, \rho) of the actual embeddings satisfy the theorem's requirements. Additionaly, the face-counting experiment uses $\pm 50 $ accuracy rather than (1+ϵ)(1+ \epsilon) multiplicative error, making it difficult to assess whether theoretical guarantees are achieved.

  2. The circularity concern is acknowledged but not resolved: The paper correctly identifies that understanding "when count supervision alone can provably induce clusterable embedding geometry" is an open problem. The CIFAR-10 end-to-end experiments confirm that count supervision alone fails to produce the required cluster structure. This means MaxSketch's theoretical guarantees presuppose access to a well-trained encoder, which in turn requires labeled data, and potentially undermining the practical appeal of the method for the very settings (unsupervised counting) where it would be most valuable.

Clarity Strengths

  1. The paper is well-written with clear exposition; The progression from motivation → algorithm definition → theoretical analysis → experiments is logical and easy to follow.

  2. The informal theorem statement (Theorem 4.4) is stated early and in accessible terms, with formal details deferred to the appendix.

  3. The comparison with prior work (HyperLogLog, Zhang's algorithm, LSH, DeepSets) is thorough and fairly positions MaxSketch relative to each.

  4. The conceptual framing of MaxSketch as a "statistics-preserving embedding" rather than a distance-preserving one is insightful and pedagogically effective.

Weaknesses

  1. To my undestandding, the relationship between the theorem's requirements on ρ,η\rho, \eta (in terms if ϵ\epsilon and nn) is never addressed. I would suggest the authors to include a table or a figure showing the feasible region of (η,ρ)(\eta, \rho) for typical (n,ϵ)(n,\epsilon) values.

  2. The connection between Theorem 4.4 (data-independent thresholds) and Theorem 4.7 (learned readout) could be better articulated. Are they alternative approaches? Does one subsume the other?

Significance Strengths

  1. The paper opens a new structural regime for robust distinct counting, demonstrating that inner-product separation (as opposed to metric separation) enables exponentially better sketches. This is conceptually important for the streaming algorithms community.

  2. The bridge between classical streaming and modern representation learning is timely and could inspire further work on exploiting learned geometric structure for other streaming problems.

Weaknesses

  1. The face-counting experimen, the only truly realistic scenario, achieves ±50\pm 50 accuracy on counts up to $ \sim 5,000$, , which may not be competitive with simpler baselines (e.g., tracking-based counting) in practice.

  2. The paper does not discuss the merge/union operation, which is crucial for distributed streaming systems. HyperLogLog's practical dominance owes much to its simple mergeability (component-wise max). Whether MaxSketch supports this is unclear.

Originality Strengths

  1. The formulation of robust distinct counting via max-aggregated Gaussian projections under a clusterability assumption is novel. While individual components (Gaussian projections, extreme-value statistics, max-pooling in neural networks) are known, their combination for this purpose is new and non-obvious.

  2. The identification that inner-product structure (rather than metric distance) is the right geometric property to exploit is an original insight that distinguishes this work from Zhang's metric-space approach.

  3. The learnability reduction to one-dimensional isotonic regression is a clean contribution with broader applicability.

Weaknesses

  1. The max-of-random-projections statistic has appeared in other contexts (e.g., max-stable processes, support function estimation in convex geometry). The novelty is more in the application and analysis for cardinality estimation than in the fundamental algorithmic idea.
Questions
  1. Can you provide numerical estimates of the constants cρc_{\rho}, cηc_{\eta} in Theorem 4.4 and verify empirically that the embeddings used in your experiments satisfy the (η,ρ)(\eta, \rho)-clusterability requirement?

  2. What is the computational cost per stream element, and how does MaxSketch compare to HyperLogLog and Zhang's algorithm in omputational time time?

  3. Does MaxSketch support merging (union) of sketches from different substreams? In distributed streaming systems, mergeability is essential. Since max-aggregation is associative and commutative, it seems like two MaxSketches could be merged by taking component-wise maxima. If so, please state and prove this formally. If not, please discuss why and what modifications might enable it.

  4. Can you provide or conjecture a lower bound under (η,ρ)(\eta, \rho)-clusterability? is O(log⁡n/ϵ2)O(\log n / \epsilon^2) tight for this structural regime, or is there room for improvement?

  5. Regarding the circularity issue: have you considered settings where the encoder is trained with a contrastive or self-supervised objective (not requiring count labels) and then MaxSketch is applied? The CIFAR-10 end-to-end experiment shows that count supervision alone fails to induce good clusters. Does MaxSketch work well with self-supervised embeddings (e.g., SimCLR, DINO) that are known to produce good cluster structure without requiring count labels? This would partially resolve the practical circularity concern. If such experiments exist in the appendix, please highlight them.

Limitations

The authors partially address limitations—they acknowledge that "no lower bound is currently known under our clusterability assumption" and that understanding when count supervision alone can induce clusterable geometry "remains a central open problem." The CIFAR-10 end-to-end experiment honestly demonstrates failure modes. These are commendable.

However, there is a critical practical limitation that is insufficiently addressed: the feasibility of the (η,ρ)(\eta, \rho) parameters in real-world deployments. The formal theorem requires ρ<cρϵ2/ln⁡n\rho < c_{\rho} \epsilon^2 / \ln n and $\eta \leq c \epsilon^2 / (\ln n)^2 $, which become extraordinarily stringent as nn grows. For a realistic stream of n=106n = 10^6 elements with a desired accuracy of ϵ=0.1\epsilon = 0.1, we need ρ\rho on the order of 10−410^{-4} and η on the order of 10−610^{-6} (up to unknown constants). To my undestanding, the paper does not:

  • Compute the actual (η,ρ)(\eta, \rho) values for any of the experimental embeddings,
  • Discusse whether modern representation learning methods (contrastive, supervised, self-supervised) typically produce embeddings satisfying these bounds, or
  • Provide guidance on what embedding dimension d, training objective, or architecture would be needed to achieve the required separation.

Without this, practitioners cannot determine a priori whether MaxSketch's theoretical guarantees apply to their setting. The gap between "the method works empirically" and "the theory explains why" remains unresolved. I would suggest the authors add: (i) empirical measurements of η and ρ for their experimental embeddings, (ii) a discussion of how these parameters scale with embedding dimension dd and training methodology, and (iii) guidance on when practitioners should expect the guarantees to hold versus when they are operating in a regime where only the empirical (but theoretically unjustified) performance applies.

Additionally, the paper does not discuss potential negative societal impacts of person-counting technology (surveillance applications), which would be appropriate given the face-counting framing.

Final justification

The rebuttal resolves the majority of my concerns; On the main quenstion (Q1), the authors frankly confirm that the theoretical analysis does not extend to the main experimental setting. Given the paper's already strong original rating, I retain my scores at their current level.

Formatting concerns

No major formatting, anonymity, or length issues noted.

1 comment
Authors · RebuttalOpenReview ↗
Rebuttal

We thank the Reviewer for their valuable comments and feedback. We will incorporate their suggestions to improve the manuscript. Below, we address each of the Reviewer’s questions.

Question 1:\textbf{Question 1:} Can you provide numerical estimates of the constants cρc_\rho and cηc_\eta in Theorem 4.4 [...].

Answer 1:\textbf{Answer 1:} The constants cρ,cηc_\rho, c_\eta result from several conservative inequalities and were not optimized, so proof-traced numerical values would not provide meaningful practical thresholds. We agree, however, that the embedding geometry should be quantified. In the face experiment, on the held-out face identities, empirical quantities corresponding to η\eta have median 0.260.26 (95th percentile 0.640.64), while those corresponding to ρ\rho have median 0.120.12 (95th percentile 0.370.37).

Importantly, the face embeddings do not satisfy the sufficient bounds of Theorem 4.4 at the experimental scale. The experiment was not meant to numerically validate the theorem; rather, it evaluates whether MaxSketch remains useful outside the worst-case regime covered by the analysis. Indeed, the experiments demonstrate that the MaxSketch statistic still captures meaningful information about the underlying count in this substantially less idealized regime, enabling useful count estimates even though the worst-case theoretical guarantee does not apply. We will make this distinction explicit and include a table showing the sufficient (η,ρ)(\eta,\rho) region for representative values of nn and ε\varepsilon.

Question 2:\textbf{Question 2:} What is the computational cost per stream element, and how does MaxSketch compare with HyperLogLog and Zhang's algorithm in update time, query time, and memory?

Answer 2:\textbf{Answer 2:} For an encoded stream element x∈Rdx\in\mathbb R^d, MaxSketch computes mm random projections (as defined in our text) and performs mm coordinate-wise maximum updates, giving O(md)O(md) arithmetic operations per element for dense vectors and projections. Its sketch state consists of mm scalar registers. A direct query averages these registers and applies the scalar readout, requiring O(m)O(m) time.

HyperLogLog is considerably cheaper computationally: after hashing a stable discrete identifier, it updates a single register, giving O(1)O(1) update time. It uses Θ(ε−2)\Theta(\varepsilon^{-2}) registers for constant success probability, and the standard estimator can be computed by scanning these registers in O(ε−2)O(\varepsilon^{-2}) time. The key distinction is that HLL assumes repeated observations have the same discrete identifier, whereas MaxSketch does not require this.

Zhang's algorithm addresses the more general metric-space setting. In a direct implementation, each incoming element is compared against the maintained sampled-group representatives. In the well-shaped regime, the algorithm uses O(ε−1nlog⁡(1/ε))O\left(\varepsilon^{-1}\sqrt{n\log(1/\varepsilon)}\right) words of space, corresponding to the same asymptotic number of sampled-group records. Thus, the update cost is O(Tdistε−1nlog⁡(1/ε))O\left(T_{\mathrm{dist}}\varepsilon^{-1}\sqrt{n\log(1/\varepsilon)}\right), where TdistT_{\mathrm{dist}} is the cost of a metric evaluation. A direct query can likewise be implemented by scanning the maintained sampled-group records, requiring O(ε−1nlog⁡(1/ε))O\left(\varepsilon^{-1}\sqrt{n\log(1/\varepsilon)}\right) time.

We will add this computational comparison to the revision.

Question 3:\textbf{Question 3:} Does MaxSketch support merging the sketches of different substreams? [...].

Answer 3:\textbf{Answer 3:} Yes, MaxSketch is exactly mergeable, provided that the same fixed Gaussian projections are used across substreams. Each register stores the maximum projection value observed in its substream, so the sketch of the union can be recovered simply by taking the component-wise maximum of the corresponding registers. Since this operation is associative and commutative, sketches can be merged in arbitrary order without access to the original streams, making MaxSketch directly applicable to distributed streaming settings. We will make this property explicit in the revision and add a short proposition formally stating it.

Question 4:\textbf{Question 4:} Can you prove or conjecture a lower bound under (η,ρ)(\eta,\rho)-clusterability? [...].

Answer 4:\textbf{Answer 4:} We do not currently have a lower bound for arbitrary streaming algorithms under (η,ρ)(\eta,\rho)-clusterability and therefore do not claim that the dependence of Theorem 4.4 is optimal. Zhang's Ω(n)\Omega(\sqrt{n}) lower bound applies to general noisy datasets; Zhang explicitly leaves open whether such a lower bound holds even for well-shaped inputs. It therefore does not settle the stronger clusterable regime considered here. Determining the optimal space complexity under clusterability remains an interesting open problem.

Question 5:\textbf{Question 5:} Regarding the circularity issue: have you considered settings where the encoder is trained with a contrastive or self-supervised objective [...].

Answer 5:\textbf{Answer 5:} Thank you for this suggestion. Our face experiment already separates representation learning from the counting objective: the encoder is pretrained and frozen, and no count labels are used to learn the embedding geometry. Thus, the cluster structure in this experiment is not induced by MaxSketch or by count supervision.

We agree that using a self-supervised encoder such as SimCLR or DINO would provide an even cleaner test by removing identity supervision as well. This would be a valuable additional experiment. However, our theoretical result is agnostic to how the representation is obtained: it assumes clusterable embeddings and studies whether they permit compact distinct counting. Characterizing which supervised or self-supervised objectives produce such geometry is a separate encoder-learning question, which we leave open. Accordingly, the theorem does not prescribe a particular embedding dimension, architecture, or training objective; what matters for the guarantee is the resulting (η,ρ)(\eta,\rho) geometry.

Additional comments.\textbf{Additional comments.} We agree that tracking-based methods may be preferable when identity-level state can be maintained; the purpose of MaxSketch is instead to study the compact streaming-sketch regime without retaining identity-level state.

We also want to clarify the theory-experiment relationship: Theorem 4.4 provides a worst-case sufficient regime, whereas the face experiment tests the statistic on realistic embeddings outside that certified regime; m=4096m=4096 was chosen as a fixed experimental budget rather than from the theorem. Our experimental goal is not to reproduce the theorem's idealized regime, where the guarantee already predicts success, but to stress-test whether MaxSketch remains informative under substantially less ideal representations. Indeed, the face experiment still yields near perfect ±100\pm100 accuracy across the evaluated count range, while in easier settings such as MNIST MaxSketch achieves essentially perfect counting accuracy.

Theorem 4.4 and the learnability result are complementary: the former provides an explicit data-independent readout under the geometric assumptions, while the latter shows that a monotone readout of the same scalar statistic can be learned from count-labeled examples for an unknown distribution. We will make this relationship clearer.

We also agree that person-counting applications raise privacy and surveillance concerns. While our work is primarily theoretical, we will add a brief discussion of these potential societal impacts.

We are happy to provide more clarifications if required.

Reviewer 1qCdOpenReview ↗
Rating
5/6
Confidence
5/5
Quality
4/4
Clarity
4/4
Significance
3/4
Originality
4/4
Contribution type
theory
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

This work concerns a version of distinct element counting in which copies of the same element may not always be exactly identical. For instance, different photographs of the same object may be converted to similar but different feature vectors. When estimating the number of distinct elements, one would ideally ignore the variability of elements' representations. In particular, the focus is on the streaming version of the problem, in which the main goal is obtaining a good approximation to the number of distinct elements in small space.

Unfortunately, previous work established that this problem is significantly more difficult than the original distinct elements problem in general. In nn is the length of the stream, the classic version of distinct elements can be solved in space logarithmic in nn, but the approximate version requires Ω(n)\Omega(\sqrt{n}) space for arbitrary metric spaces.

This work explores a specific setting in which input elements are unit vectors such that the dot product of vectors representing the same elements is close to 1 and vectors representing different element is significantly bounded away from 1 (and, in fact, very close to 0). In this setting the paper manages to provide positive results by reducing the problem to estimating the maximum of linear projections to one dimension, where all coefficients are selected from the Gaussian distribution. The paper gives a theoretical proof that this approach works as long as the distribution of vectors follows a specific clusterability assumption. If this is the case, the dependency on nn is only logarithmic.

The theoretical analysis is accompanied by an experimental evaluation of the approach on real world data sets and feature vectors extracted from real world images. In particular, this part of the paper explores what happens if the data does not follow strict requirements of the theoretical analysis.

Strengths and weaknesses

Strengths: The idea of the random projection and using the maximum of received scalar values is genuinely neat. It combines ideas from both traditional streaming algorithms with ideas from random projections. On the one hand, it reuses the idea from some classic algorithms for estimating the number of distinct elements by selecting the maximum (or minimum) hash value. On the other hand, it applies random projections on the line with coefficients selected from the Gaussian distribution, which means that the distribution of the projection vector is Gaussian.

While I didn't analyze the details of the proof, it is clear that what the main claim is (roughly) true, which follows from standard properties of projections with random Gaussian coefficients.

I like that the paper has an experimental part and explores natural scenarios in which the strict theoreatical assumptions are not (or may not) be met.

The paper presents the ideas very clearly and it was a pleasure to read.

Weaknesses (but also some strengths): One downside of the framework is that the theoretical analysis requires significant gap in dot products between vectors in the same cluster vs. vectors in other clusters. In particular, vectors in different clusters are required to be nearly orthogonal. (It seems that, despite this strong theoretical requirement, applying the method in practice may behave well, as the experiments demonstrate, but it also seems that the results detoriate.)

A big downside is that as the size of the input grows, the similar vectors have to be aligned more and more closely and different vectors have to be more and more close to orthogonal. It would be nice if the dependence on nn could somehow be replaced by a dependence on k∗k^*, which is the number of clusters, but I suspect that this may be difficult.

As for the practicality of the approach, I think the experimental results are not completely conclusive, but I also think that the paper states a clear research direction whether these types of methods can lead to more reliable results in more general practical settings.

Questions

Is there a way to replace log⁡n\log n with log⁡k∗\log k^{*} in your main theorem? If not, what are the obstacles to making this happen?

Limitations

yes

Final justification

I am satisfied with the responses to my questions. I have read all reviews and discussions. I'm correcting the submission type from theory to general in my evaluation. I'm happy to keep my original recommendation: "accept".

Formatting concerns

No formatting concerns.

2 comments
Authors · RebuttalOpenReview ↗
Rebuttal

We thank the Reviewer for their valuable comments and feedback. We will incorporate their suggestions to improve the manuscript. Below, we address each of the Reviewer’s questions.

Question 1:\textbf{Question 1:} Is there a way to replace the dependence on the stream length nn in the main theorem [...]

Answer 1:\textbf{Answer 1:} Thanks for the question. The short answer is that nn cannot in general be replaced entirely by kk under our current worst-case clusterability assumption.

For example, take k=2k=2 perfectly orthogonal centers c1,c2c_1, c_2. We can put n1n_1 points in the first cluster, all within the allowed distance from c1c_1, but with their small perturbations pointing in different orthogonal directions.

For a Gaussian projection gg, these perturbations give Gaussian fluctuations of scale η\sqrt{\eta}. Since MaxSketch takes the maximum over all stream elements, their contribution can have typical size Θ(ηlog⁡n)\Theta(\sqrt{\eta \log n})

Thus, even with only two true clusters, increasing the number of admissible noisy copies can increase the MaxSketch value.

Additional Comments.\textbf{Additional Comments.} Regarding the experiments, please see our Answer 1 and Answer 5 to Reviewer XuGo.

We are happy to provide more clarifications if required.

Reviewer 1qCd · CommentOpenReview ↗

Thank you for your response and additional insights. I will take them into consideration when assigning the final score.

Comments on the paper

1 comment
Authors · CommentOpenReview ↗

We sincerely thank all the reviewers and AC for their thoughtful reviews, and for their positive evaluation of our work.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Missing a submission?

Loading the discussion…