Title: Statistical-Computational Trade-offs for Density Estimation
Venue: NeurIPS 2024
Accepted: yes
Keywords: statistical-computational tradeoffs

lower bounds

data structures

density estimation

hypothesis selection
Abstract: We study the density estimation problem defined as follows: given $k$ distributions $p_1, \ldots, p_k$ over a discrete domain $[n]$,  as well as a collection of samples chosen from a "query" distribution $q$ over $[n]$, output $p_i$ that is "close" to $q$. Recently Aamand et al. gave the first and only known result that achieves sublinear bounds in both the sampling complexity and the query time while preserving polynomial data structure space. However, their improvement over linear samples and time is only by subpolynomial factors.

Our main result is a lower bound showing that, for a broad class of data structures, their bounds cannot be significantly improved. In particular, if an algorithm uses $O(n/\log^c k)$ samples for some constant $c>0$ and polynomial space, then the query time of the data structure must be at least $k^{1-O(1)/\log  \log  k}$, i.e., close to linear in the number of distributions $k$. This is a novel statistical-computational trade-off for density estimation, demonstrating that any data structure must use close to a linear number of samples or take close to linear query time. The lower bound holds even in the realizable case where $q=p_i$ for some $i$, and when the distributions are flat (specifically, all distributions are uniform over half of the domain $[n]$). We also give a simple data structure for our lower bound instance with asymptotically matching upper bounds. Experiments show that the data structure is quite efficient in practice.

Statistical-Computational Trade-offs for Density Estimation

Abstract

We study the density estimation problem defined as follows: given k distributions p 1 , . . . , p k over a discrete domain [ n ] , as well as a collection of samples chosen from a 'query' distribution q over [ n ] , output p i that is 'close' to q . Recently [1] gave the first and only known result that achieves sublinear bounds in both the sampling complexity and the query time while preserving polynomial data structure space. However, their improvement over linear samples and time is only by subpolynomial factors.

Our main result is a lower bound showing that, for a broad class of data structures, their bounds cannot be significantly improved. In particular, if an algorithm uses O ( n/ log c k ) samples for some constant c > 0 and polynomial space, then the query time of the data structure must be at least k 1 -O (1) / log log k , i.e., close to linear in the number of distributions k . This is a novel statistical-computational trade-off for density estimation, demonstrating that any data structure must use close to a linear number of samples or take close to linear query time. The lower bound holds even in the realizable case where q = p i for some i , and when the distributions are flat (specifically, all distributions are uniform over half of the domain [ n ] ). We also give a simple data structure for our lower bound instance with asymptotically matching upper bounds. Experiments show that the data structure is quite efficient in practice.

1 Introduction

The general density estimation problem is defined as follows: given k distributions p 1 , . . . , p k over a domain [ n ] 2 , build a data structure which when queried with a collection of samples chosen from a 'query' distribution q over [ n ] , outputs p i that is 'close' to q . An ideal data structure reports the desired p i quickly given the samples (i.e., has fast query time), uses few samples from q (i.e., has low sampling complexity) and uses little space.

In the realizable case, we know that q is equal to one of the distributions p j , 1 ≤ j ≤ k , and the goal is to identify a (potentially different) p i such that ∥ q -p i ∥ 1 ≤ ϵ for an error parameter ϵ > 0 . In the more general agnostic case, q is arbitrary and the goal is to report p i such that

for some constant C > 1 and error parameter ϵ > 0 . The problem is essentially that of non-parametric learning of a distribution q ∈ F , where the family F = { p 1 , . . . p k } has no structure whatsoever. Its statistical complexity was understood already in [17], and the more modern focus has been on the structured case (when F has additional properties). Surprisingly, its computational complexity is still not fully understood.

Due to its generality, density estimation is a fundamental problem with myriad applications in statistics and learning distributions. For example, the framework provides essentially the best possible sampling bounds for mixtures of Gaussians [10, 18, 12]. The framework has also been studied in private [8, 7, 13, 15] and low-space [4] settings.

Table 1 summarizes known results as well as our work. As seen in the table, the data structures are subject to statistical-computational trade-offs. On one hand, if the query time is not a concern, logarithmic in k samples are sufficient [17, 11]. On the other hand, if the sampling complexity is not an issue, then one can use the algorithm of [16] to learn the distribution ˆ q such that ∥ ˆ q -q ∥ 1 ≤ ϵ/ 2 , and then deploy standard approximate nearest neighbor search algorithms with sublinear query time, e.g., from [14]. Unfortunately both of these extremes require either linear (in n ) sample complexity, or linear (in k ) query time time. Thus, achieving the best performance with respect to one metric resulted in the worst possible performance on the other metric.

The first and only known result that obtained non-trivial improvements to both the sampling complexity and the query time is due to a recent work of [1]. Their improvements, however, were quite subtle: the sample complexity was improved by a sub-logarithmic factor, while the query time was improved by a sub-polynomial factor of k 1 / (log k ) 1 / 4 = 2 log( k ) 3 / 4 .

This result raises the question of whether further improvements are possible. In particular, [1] asks: To what extent can our upper bounds of query and sample complexity be improved? What are the computational-statistical tradeoffs between the sample complexity and query time? These are the questions that we address in this paper.

Lower bound: We give the first limit to the best possible tradeoff between the query time and sampling complexity, demonstrating a novel statistical-computational tradeoff for a fundamental problem. To our knowledge, this is the first statistical-computational trade-off for a data structures problem-if we allow for superpolynomial space, logarithmic sampling and query complexity

0.01

0.03

0.05

0.07

0.09

1/

s

(Samples as a fraction of

n

)

0.0

0.2

0.4

0.6

0.8

1.0

q

(Query Exponent)

Statistical-Computational Trade-offs

UB for Half-Uniform Distributions

UB for General Distributions

Numerical Upper/Lower Bound

for Half-Uniform Distributions

LB for Half-Uniform Distributions

10

9

10

8

10

7

10

6

10

5

10

4

10

3

1/

s

(Samples as a fraction of

n

)

0.800

0.825

0.850

0.875

0.900

0.925

0.950

0.975

1.000

Log-Scale

is possible. As in [5, 6, 9, 3], we focus on data structures that operate in the so-called list-ofpoints model 3 , which captures all bounds depicted in Table 1. Suppose that the query time of the data structure is of the form k ρ q . We show that, if the data structure is allowed polynomial space kn + k 1+ ρ u and uses n/s samples, then the query time exponent ρ q must be at least 1 -O ( ρ u ) / log s . Therefore, if we set s = log c k for some c > 0 , as in [1], then the query time of the data structure must be at at least k 1 -O (1) / log log k . That is, the query time can be improved over linear time in k by at most a factor of k O (1) / log log k = 2 O (log k/ log log k ) . This shows that it is indeed not possible to improve the linear query time by a polynomial factor while keeping the sampling complexity below n/ log c n , for any constant c > 0 .

Our lower bound instance falls within the realizable case and in the restricted setting where the data and query distributions are 'half-uniform', i.e. each distribution is uniform over half of the universe [ n ] . Note that showing a lower bound under these restrictions automatically extends to the agnostic case with general distributions, as the former is a special case of the latter.

Our construction takes lower bounds by [3] for set similarity search as a starting point. We adapt their lower bound to our setting in which queries are formed via samples from a distribution. The resulting lower bound is expressed via a complicated optimization problem and does not yield a closed-form statistical-computational trade-off. One of our technical contributions is solve this optimization problem for a regime of interest to get our explicit lower bound.

Upper bound: We complement the lower bound by demonstrating a data structure for our hard instances (in the realizable case with half-uniform distributions) achieving sampling and query time bounds asymptotically matching those of the lower bound. We note that the existence of such an algorithm essentially follows from [3]. However, the algorithms presented there are quite complex. In contrast, our algorithm can be viewed as a 'bare-bones' version of their approach, and as a result it is simple and easy to implement. To demonstrate the last point, we present an empirical evaluation of the algorithm on the synthetic data set from [1], and compare it to the algorithm from that paper, as well as a baseline tailored to half-uniform distributions. Our faster algorithm achieves over 6 × reduction in the number of operations needed to correctly answer 100 random queries.

In Figure 1, we illustrate the trade-off between the number of samples and the query time exponent ρ q in our upper and lower bounds.

Open Questions: The direct question left open by our work is whether there exists a data structure whose upper bounds for general distributions match our lower bounds (note we give matching

upper bounds for half-uniform distributions). [1] give an algorithm for the general case, but with a worse trade-off than that described by our lower bound. More generally, are there other data structures problems for which one can show statistical-computational tradeoffs between the trifecta of samples, query time, and space?

2 Preliminaries and Roadmap for the Lower Bound

First we introduce helpful notation used throughout the paper.

Notation: We use Bern( p ) to denote the Bernoulli( p ) distribution and Poi( λ ) to denote the Poisson( λ ) distribution. For a discrete distribution f : X → R , we use supp ( f ) = { x ∈ X : f ( x ) = 0 } to denote f 's support and | supp ( f ) | to denote the size of its support. We use f n to denote the tensor product of n identical distribution f . Wecall a distribution f half-uniform if it is a uniform distribution on its support T with | T | = n/ 2 . For a binary distribution P supported on { 0 , 1 } with a random

̸

For a vector x ∈ R n , we use x [ i ] to denote its i -th coordinate. We use d ( p || q ) = p log p q + (1 -p ) log 1 -p 1 -q and D ( P || Q ) = ∑ p ∈ P p log p q to denote the standard KL-divergence over a binary distribution or a general discrete distribution. KL divergence D ( P || Q ) is only finite when supp ( P ) ⊆ supp ( Q ) , also denoted as P ≪ Q . All logarithms are natural.

We now introduce the main problem which we use to prove our statistical-computational lower bound. We state a version which generalizes half-uniform distributions.

Definition 2.1 (Uniform random density estimation problem) . For a universe U = { 0 , 1 } n , we generate the following problem instance:

Adataset P is constructed by sampling k uniform distributions, where for each uniform distribution p ∈ P , every element i ∈ [ n ] is contained in p 's support with probability w u .

Fix a distribution p ∗ ∈ P , take Poi ( | supp ( p ∗ ) | s · w u ) samples from p ∗ and get a query set q .

The goal of the data structure is to preprocess P such that when given the query set q , it recovers the distribution p ∗ .

We denote this problem as URDE( w u , s ) . URDE abbreviates Uniform Random Density Estimation . The name comes from the fact that the data set distributions are uniform over randomly generated supports. In Section 3, we prove a lower bound for URDE by showing that a previously studied ' hard ' problem can be reduced to URDE. The previously studied hard problem is the GapSS problem.

Definition 2.2 (Random GapSS problem [3]) . For a universe U = { 0 , 1 } n and parameters 0 < w q < w u < 1 , let distribution P U = Bern( w u ) n , P Q = Bern( w q ) n , and P QU = [ w q 0 w u -w q 1 -w u ] n . A random GapSS( w u , w q ) problem is generated by the following steps:

A dataset P ⊆ U is constructed by sampling k points where p ∼ P U for all p ∈ P .

A dataset point p ∗ ∈ P is fixed and a query point q is sampled such that ( q, p ∗ ) ∼ P QU .

The goal of the data structure is to preprocess P such that it recovers p ∗ when given the query point q .

We denote this problem as random GapSS( w u , w q ) . GapSS abbreviates Gap Subset Search . To provide some intuition about how GapSS relates to URDE, let us denote the data set P = { p 1 , . . . , p k } . Then the p i ∈ { 0 , 1 } n can naturally be viewed as k independently generated random subsets of [ n ] . For each i , p i includes each element of [ n ] with probability w u . The query point q can similarly be viewed as a random subset of [ n ] including each element with probability w q , but it is correlated with some fixed p ∗ ∈ P . Namely, p ∗ and q are generated according to the join distribution P QU (with the

right marginal distributions P Q and P U ) such q a subset of p ∗ . The goal in GapSS is to identify p ∗ given q . This intuition is formalized in Section 3.

Our main goal is to study the asymptotic behavior of algorithms with sublinear samples, or specifically, the query time and memory trade-off when only sublinear samples are available, so all our theorems assume the setting that both the support size n and the number of samples k goes to infinity and n ≪ k ≤ poly( n ) . Sublinear samples mean that 1 s < o (1) as n goes to infinity.

Our lower bound extend and generalize lower bounds for GapSS in the 'List-of-points' model. Thus, the lower bound we provide for URDE is also in the 'List-of-points' model defined below (slightly adjusted from the original definition in [5] to our setting). The model captures a large class of data structures for retrieval problems such as partial match and nearest neighbor search: where one preprocesses a dataset P to answer queries q that can 'match' a point in the dataset.

Definition 2.3 (List-of-points model) . Fix a universe Q of queries, a universe U of dataset points, as well as a partial predicate ϕ : Q × S →{ 0 , 1 , ⊥} . We first define the following ϕ -retrieval problem: preprocess a dataset P ⊆ U so that given a query q ∈ Q such that there exist some p ∗ ∈ P with ϕ ( q, p ∗ ) = 1 and ϕ ( q, p ) = 0 on all p ∈ P \ { p ∗ } , we must report p ∗ .

Then a list-of-points data structure solving the above problem is as follows:

We fix (possibly random) sets A i ⊆ U , for 1 ≤ i ≤ m ; and with each possible query point q ∈ Q , we associate a (random) set of indices I ( q ) ⊆ [ m ] ;

For the given dataset P ⊂ U , we maintain m lists of points L 1 , L 2 , ..., L m , where L i = P ∩ A i .

On query q ∈ Q , we scan through lists L i where i ∈ I ( q ) , and check whether there exists some p ∈ L i with ϕ ( q, p ) = 1 . If it exists, return p .

The data structure succeeds, for a given q ∈ Q , p ∗ ∈ P with ϕ ( q, p ∗ ) = 1 , if there exists i ∈ I ( q ) such that p ∗ ∈ L i . The total space is defined by S = m + ∑ i ∈ [ m ] | L i | and the query time by T = | I ( q ) | + ∑ i ∈ I ( q ) | L i | .

To see how the lower bound model relates to URDE, in our setting, the ' ϕ -retrieval problem' is the URDE problem: U is the set of random half-uniform distributions, Q is the family of query samples, and ϕ ( q, p ) is 1 if the samples q were drawn from the distribution p , and 0 otherwise. (The ⊥ case corresponds to an 'approximate' answer, considering by the earlier papers; but we define URDE problem directly to not have approximate solutions.)

We use the list-of-points model as it captures all known 'data-independent' similarity search data structures, such as Locality-Sensitive Hashing [14]. In principle, a lower bound against this model does not rule out data-dependent hashing approaches. However, these have been useful only for datasets which are not chosen at random. In particular, [5] conjecture that data-dependency doesn't help on random instances, which is the setting of our theorems.

3 Lower bounds for random half-uniform density estimation problem

In this section, we formalize our lower bound. The main theorem of the section is the following.

Theorem 3.1 (Lower bound for URDE ) . If a list-of-points data structure solves the URDE ( 1 2 , s ) using time O ( k ρ q ) and space O ( k 1+ ρ u ) , and succeeds with probability at least 0 . 99 , then for sufficiently large s , ρ q ≥ 1 -1 s 1 -log 2 -o (1) -ρ u log s -1 .

To prove Theorem 3.1, our starting point is the following result of [3] that provides a lower-bound for the random GapSS problem.

Theorem 3.2 (Lower bound for random GapSS, [3]) . Consider any list-of-points data structure for solving the random GapSS( w u , w q ) problem on k points, which uses expected space O ( k 1+ ρ u ) , has expected query time O ( k ρ q -o k (1) ) , and succeeds with probability at least 0 . 99 . Then for every α ∈ [0 , 1] , we have that

̸

Our proof strategy is to first give a reduction from the the GapSS problem to the URDE problem. Note that the URDE problem involves a statistical step where we receive samples from an unknown distribution (our query). On the other hand, the query of GapSS is a specified vector, rather than a distribution, with no ambiguity. Our reduction bridges this and shows that GapSS is a 'strictly easier' problem than URDE.

Theorem 3.3 (Reduction from random GapSS to URDE ) . If a list-of-points data structure solves the URDE( w u , s ) problem of size k in Definition 2.1 using time O ( k ρ q ) and space O ( k 1+ ρ u ) , and succeeds with probability at least 0 . 99 , then there exists a list-of-points data structure solving the GapSS( w u , w q ) problem for w q = w u ( 1 -e -1 s · wu ) using space O ( k 1+ ρ u ) and time O ( k ρ q + w q · n ) , and succeeds with probability at least 0 . 99 .

Proof. We provide a reduction from random GapSS( w u , w q ) to URDE( w u , s ) with s = -1 w u log ( 1 -wq wu ) . Specifically, for each instance ( P 1 , p ∗ 1 , q 1 ) generated from GapSS( w u , w q ) in Definition 2.2, we will construct an instance ( P 2 , p ∗ 2 , q 2 ) generated from URDE( w u , s ) satisfying Definition 2.1 for some s .

For each point p 1 ∈ P 1 , it is straightforward to construct a corresponding uniform distribution p 2 supported on those coordinates where p 1 [ i ] = 1 . Then let's construct q 2 from q 1 . Recall that for each i ∈ U with p ∗ 1 [ i ] = 1 , we have q 1 [ i ] = 0 with probability 1 -w q w u , in which case we add no element i to q 2 . If q 1 [ i ] = 1 , we add Poi + ( 1 s · w u ) copies of element i to q 2 where P [Poi + ( λ ) = x ] = P [Poi( λ )= x ] P [Poi( λ ) > 0] for any x > 0 . By setting s = -1 w u log ( 1 -wq wu ) , we have P [ Poi ( 1 s · w u ) = 0 ] = 1 -w q w u . Thus for each element i in p ∗ 2 , the number of its appearances in q 2 exactly follows the distribution Poi( 1 s · w u ) . According to the property of the Poisson distribution, uniformly sampling Poi ( | supp ( p ∗ 2 ) | s · w u ) elements from a set of size | supp ( p ∗ 2 ) | is equivalent to sampling each element Poi( 1 s · w u ) times. Therefore, the constructed instance ( P 2 , p ∗ 2 , q 2 ) is an instance of URDE( w u , s ) , as stated in Definition 2.1. Equivalently, we have the relationship w q = w u ( 1 -e -1 s · wu ) .

Hence we complete our reduction from GapSS (Definition 2.2) to URDE (Definition 2.1).

To get the desired space-time trade-off in the sublinear sample regime, which means s → ∞ (or equivalently w q → 0 ), and to get an interpretable analytic bound, we need to develop upon the lower bound in Theorem 3.2. This requires explicitly solving the optimization problem in Theorem 3.2. Proving Theorem 3.4 (proof in Appendix 3) is the main technical contribution of the paper.

Theorem 3.4 (Explicit lower bound for random GapSS instance) . Consider any list-of-points data structure for solving the random GapSS ( 1 2 , w q ) which has expected space O ( k 1+ ρ u ) , uses expected query time O ( k ρ q -o (1) ) , and succeeds with probability at least 0 . 99 . Then we have the following lower bound for sufficiently small w q : ρ q ≥ 1 -w 1 -log 2 -o (1) q + ρ u 1+log w q .

Applying our reduction to the random GapSS lower bound above allows us to prove our main theorem.

Proof of Theorem 3.1. According to the reduction given in Theorem 3.3 from GapSS( w u , w q ) to URDE( w u , s ) where w q = w u ( 1 -e -1 wus ) ≥ 1 s . We can apply the lower bound in Theorem 3.4 and get the desired lower bound.

Remark 3.5 . Note that in URDE ( 1 2 , s ) , the distributions are uniform over random subsets of expected size n/ 2 and the query set is generated by taking Poi ( 2 | supp ( p ∗ ) | s ) samples from one of them p ∗ . This is not quite saying that the query complexity is n/s . However, by standard

concentration bounds, from the Poisson sample, we can simulate sampling with a fixed number of samples n/s -˜ O ( √ n/s ) = n/s (1 -o (1)) with high probability, and so, any algorithm using this fixed number of samples must have the same lower bound on ρ q as in Theorem 3.1.

4 A simple algorithm for half-uniform density estimation problem

In this section, we present a simple algorithm for a special case of the density estimation problem when the input distributions are half-uniform . The algorithm also works for the related URDE ( 1 2 , s ) problem of Theorem 3.1. A distribution p over [ n ] is half-uniform if there exists T ⊂ [ n ] with | T | = n/ 2 such that p [ i ] = 2 /n if i ∈ T and 0 otherwise. The problem we consider in this section is:

Definition 4.1 (Half-uniform density estimation problem; HUDE ( s, ε ) ) . For a domain [ n ] , integer k , ε > 0 , and s > 0 , we consider the following data structure problem.

A dataset P of k distributions p 1 , . . . , p k over [ n ] which are half-uniform over subsets T 1 , . . . , T k ⊂ [ n ] each of size n/ 2 is given.

̸

We receive a query set q consisting of n/s samples from an unknown distribution p i ∗ ∈ P satisfying that ∥ p i ∗ -p j ∥ ≥ ε for j = i ∗ .

The goal of the data structure is to preprocess P such that when given the query set q , it recovers the distribution p i ∗ with probability at least 0.99.

This problem is related to the URDE(1 / 2 , s ) problem in Theorem 3.1. Indeed, with high probability, an instance of URDE(1 / 2 , s ) consists of almost half-uniform distributions with support size n/ 2 ± O ( √ n log k ) . Moreover, two such distributions p i , p j have ∥ p i -p j ∥ 1 = (1 ± O ( √ (log k ) /n )) with high probability. Thus, an instance of URDE (1 / 2 , s ) is essentially an instance of HUDE ( s, 1) .

To solve HUDE ( s, ε ) , we can essentially apply the similarity search data structure of [3] querying it with the set Q consisting of all elements that were sampled at least once. This approach obtains the optimal trade-off between ρ u and ρ q (at least in the List-of-points model). The contribution of this section is to provide a very simple alternative algorithm with a slightly weaker trade-off between ρ u and ρ q . Section 5 evaluates the simplified algorithm experimentally. Our main theorem is:

Theorem 4.2. Suppose n and k are polynomially related, s ≥ 2 , and that s is such that 4 n s ≥ C log k ε 2 for a sufficiently large constant C . Let ε > 0 and ρ u > 0 be given. There exists a data structure for the HUDE ( s, ε ) problem using space O ( k 1+ ρ u + nk ) and with query time O ( k 1 -ερu 2 log(2 s ) + n/s ) .

Let us compare the upper bound of Theorem 4.2 to the lower bound in Theorem 3.1. While Theorem 4.2 is stated for half-uniform distributions, its proof is easily modified to work for the URDE (1 / 2 , s ) problem where the support size is random. Then ε = 1 -O (1) and as s → ∞ , 2 1 -e -2 /s = s (1+ o (1)) . Thus, the query time exponent in Theorem 4.2 is ρ q = 1 -(1+ o (1))) log(2) ρ u log s . URDE (1 / 2 , s ) is exactly the hard instance in Theorem 3.1, and so we know that any algorithm must have ρ q ≥ 1 -(1 + o (1)) ρ u log s as s → ∞ . Asymptotically, our algorithm therefore gets the right logarithmic dependence on s but with a leading constant of log(2) ≈ 0 . 693 instead of 1 .

Next we define the algorithm. Let ℓ and L be parameters which we will also specify shortly. During preprocessing, our algorithm samples L subsets S 1 , . . . , S L of [ n ] each of size ℓ independently and uniformly at random. For each i ∈ L , it stores a set A i of all indices j ∈ [ k ] such that S i ⊂ T j , namely the indices of the distributions p j which contain S i in their support. See Algorithm 1.

During the query phase, we receive n/s samples from p = p i ∗ for some unknown i ∗ ∈ [ k ] . Our algorithm first forms the subset Q ⊂ [ n ] consisting of all elements that were sampled at least once. Note that | Q | ≤ n/s as elements can be sampled several times. The algorithm proceeds in two steps. First, it goes through the L sets S 1 , . . . , S L until it finds an i such that S i ⊂ Q . Second, it scans through the indices j ∈ A i . For each such j it samples a set U j one element at a time from Q . It stops this sampling at the first point of time where either U j ⊈ T j or | U j | = C log n ε for a sufficiently

large constant C . In the first case, it concludes that p j is not the right distribution and proceeds to the next element of A j and in the latter case, it returns the distribution p j as the answer to the density estimation problem. See Algorithm 2. We defer the formal proofs to Appendix B.

5 Experiments

We test our algorithm in Section 4 experimentally on datasets of half-uniform distributions as in [1] and corresponding to our study in Sections 3 and 4. Given parameters k and n , the input distributions are k distributions each uniform over a randomly chosen n/ 2 elements.

Algorithms We compare two main algorithms: an implementation of the algorithm presented in Section 4 which we refer to as the Subset algorithm and a baseline for half-uniform distributions which we refer to as the Elimination algorithm. The Subset algorithm utilizes the same techniques as that presented in Section 4 but with some slight changes geared towards practical usage. We do not compare to the 'FastTournament' of [1] since it was computationally prohibitive; see Remark C.1.

The Subset algorithm picks L subsets of size ℓ and preprocesses the data by constructing a dictionary mapping subsets to the distributions whose support contains that subset. When a query arrives, scan through the L subset until we find one that is contained in the support of the query. We then restrict ourselves to solving the problem over the set of distributions mapped to by that subset and run Elimination. The Elimination algorithm goes through the samples one at a time. It starts with a set of distributions which is the entire input in general or a subset of the input when called as a subroutine of the Subset algorithm. To process a sample, the Elimination algorithm removes from consideration all distributions which do not contain that element in its support. When a single distribution remains, the algorithm returns that distribution as the solution. As the input distributions are random half-uniform distributions, we expect to throw away half of the distributions at each step (other than the true distribution) and terminate in logarithmically in size of the initial set of distribution steps.

Experimental Setup Our experiments compare the Subset and Elimination algorithms while varying several problem parameters: the number of distributions k , the domain size n , the number of samples S (for simplicity, we use this notation rather than n/s samples as in the rest of the paper), and the size of subsets ℓ used by the Subset algorithm. While we vary one parameter at a time, the others are set to a default of k = 50000 , n = 500 , S = 50 , l = 3 . Given these parameters, we

Time in Seconds (·)

(a)

(b)

(c)

(d)

1e6

100000

0.09

1.0

Elimination #Ops

-☆- Subset (Ours) Time

--Elimination Time

sdo#(sno) asqns

0.4

0.3

() spuonas

Operations(

#

80000

-- Elimination Time

Elimination #Ops

0.08

0.06

Time in Seconds

0.6

00009

0.2

★

0.04

Timei

40000

0.03

#

0.2

0.1

#

0.02

20000

0.01

0.0

0.0

0

100000

200000

300000

400000

500000

200

400

600

800

1000

#Distributions

100000

0.045

100000

0.09

（）

80000

-☆- Subset (Ours) Time

Elimination #Ops

sdo#(sno) qasqns

★

0.040

Seconds

#Operations(★)

80000

★-

Elimination #Ops

sdo#(suno)asqns

Subset (Ours) Time

0.08

0.07

Operations(

-★-Elimination Time

0.030

★-

Elimination Time

0.06

60000

0.025

00009

0.05

40000

0.020

Timei

.=

40000

0.04

#

0.015

#

0.03

★

20000

0.010

20000

0.02

F0.01

30

35

40

45

50

55

60

2.0

2.5

3.0

3.5

4.0

4.5

5.0

evaluate the Subset algorithm and the Elimination algorithm on 100 random queries where each query corresponds to picking one of the input distributions as the true distribution to draw samples from.

In all settings we test, the Elimination algorithm achieves 100% accuracy on these queries, which is to be expected as long as the number of samples is sufficently more than the log 2 k . There is a remaining free parameter, which is the number of subsets L used in the Subset algorithm. We start with a modest value of L = 200 and increase L by a factor of 1 . 5 repeatedly until the Subset algorithm also achieves 100% accuracy on the queries (in reality, it's failure probability will likely still be greater than that of the Elimination algorithm). The results we report correspond to this smallest value of L for which the algorithm got all the queries correct.

For both algorithms, we track the average number of operations as well as the execution time of the algorithms (not counting preprocessing). A single operation corresponds to a membership query of checking whether a given distribution/sample contains a specified element in its support which is the main primitive used by both algorithms. We use code from [1] as a basis for our setup.

Results For all parameter settings we test, the number of operations per query by our Subset algorithm is significantly less than those required by Elimination algorithm, up to a factor of more than 6x . The average query time (measured in seconds) shows similar improvements for the Subset algorithm though for some parameter settings, it takes more time than the Elimination algorithm. While, in general, operations and time are highly correlated, these instances where they differ may depend on the specific Python data structures used to implement the algorithms, cache efficiency, or other computational factors.

As the number of distributions k increases, Figure 2a shows that both time and number of operations scale linearly. Across the board, our Subset algorithm outperforms the Elimination algorithm baseline and exhibits a greater improvement as k increases. On the other hand, as the domain size increases in Figure 2b, the efficiency of the Subset algorithm degrades while the Elimination algorithm maintains its performance. This is due to the fact that for larger domains, more subsets are needed in order to correctly answer all queries, leading to a greater runtime.

In Figure 2c, we see that across the board, as we vary the number of samples, the Subset algorithm has a significant advantage over the Elimination algorithm in query operations and time. Finally, Figure 2d shows that for subset size ℓ ∈ { 2 , 3 , 4 } , the Subset algorithm experiences a significant improvement over the Elimination algorithm. But for ℓ = 5 , the improvement (at least in terms of time) suddenly disappears. For this setting, that subset size requires many subsets in order to get high accuracy, leading to longer running times.

Overall, on flat distributions for a variety of parameters, our algorithm has significant benefits even over a baseline tailored for this case. The good performance of the Subset algorithm corresponds with our theory and validates the contribution of providing a simple algorithm for density estimation in this hard setting.

Acknowledgments: This work was supported by the Jacobs Presidential Fellowship, the Mathworks Fellowship, the NSF TRIPODS program (award DMS-2022448) and Simons Investigator Award; also supported in part by NSF (CCF2008733) and ONR (N00014-22-1-2713). Justin Chen is supported by an NSF Graduate Research Fellowship under Grant No. 174530. Shyam Narayanan is supported by an NSF Graduate Fellowship and a Google Fellowship. Anders Aamand was supported by the DFF-International Postdoc Grant 0164-00022B and by the VILLUM Foundation grants 54451 and 16582.

References

Anders Aamand, Alexandr Andoni, Justin Y Chen, Piotr Indyk, Shyam Narayanan, and Sandeep Silwal. Data structures for density estimation. In International Conference on Machine Learning , 2023.

Jayadev Acharya, Moein Falahatgar, Ashkan Jafarpour, Alon Orlitsky, and Ananda Theertha Suresh. Maximum selection and sorting with adversarial comparators. The Journal of Machine Learning Research , 19(1):2427-2457, 2018.

Thomas D Ahle and Jakob BT Knudsen. Subsets and supermajorities: Optimal hashing-based set similarity search. In 2020 IEEE 61st Annual Symposium on Foundations of Computer Science (FOCS) , pages 728-739. IEEE, 2020.

Maryam Aliakbarpour, Mark Bun, and Adam Smith. Hypothesis selection with memory constraints. Advances in Neural Information Processing Systems , 36, 2024.

Alexandr Andoni, Thijs Laarhoven, Ilya Razenshteyn, and Erik Waingarten. Optimal hashingbased time-space trade-offs for approximate near neighbors. In Proceedings of the twenty-eighth annual ACM-SIAM symposium on discrete algorithms , pages 47-66. SIAM, 2017.

Alexandr Andoni, Huy L Nguyen, Aleksandar Nikolov, Ilya Razenshteyn, and Erik Waingarten. Approximate near neighbors for general symmetric norms. In Proceedings of the 49th Annual ACM SIGACT Symposium on Theory of Computing , pages 902-913, 2017.

Mark Bun, Gautam Kamath, Thomas Steinke, and Steven Z Wu. Private hypothesis selection. Advances in Neural Information Processing Systems , 32, 2019.

Clément L Canonne, Gautam Kamath, Audra McMillan, Adam Smith, and Jonathan Ullman. The structure of optimal private tests for simple hypotheses. In Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing , pages 310-321, 2019.

Tobias Christiani and Rasmus Pagh. Set similarity search beyond minhash. In Proceedings of the 49th annual ACM SIGACT symposium on theory of computing , pages 1094-1107, 2017.

Constantinos Daskalakis and Gautam Kamath. Faster and sample near-optimal algorithms for proper learning mixtures of gaussians. In Conference on Learning Theory , pages 1183-1213. PMLR, 2014.

Luc Devroye and Gábor Lugosi. Combinatorial methods in density estimation . Springer series in statistics. Springer, 2001.

Ilias Diakonikolas, Gautam Kamath, Daniel Kane, Jerry Li, Ankur Moitra, and Alistair Stewart. Robust estimators in high-dimensions without the computational intractability. SIAM Journal on Computing , 48(2):742-864, 2019.

Sivakanth Gopi, Gautam Kamath, Janardhan Kulkarni, Aleksandar Nikolov, Zhiwei Steven Wu, and Huanyu Zhang. Locally private hypothesis selection. In Conference on Learning Theory , pages 1785-1816. PMLR, 2020.

Piotr Indyk and Rajeev Motwani. Approximate nearest neighbors: towards removing the curse of dimensionality. In Proceedings of the thirtieth annual ACM symposium on Theory of computing , pages 604-613, 1998.

Gautam Kamath, Vikrant Singhal, and Jonathan Ullman. Private mean estimation of heavy-tailed distributions. In Conference on Learning Theory , pages 2204-2235. PMLR, 2020.

Sudeep Kamath, Alon Orlitsky, Dheeraj Pichapati, and Ananda Theertha Suresh. On learning distributions from their samples. In Conference on Learning Theory , pages 1066-1100. PMLR, 2015.

Henry Scheffe. A Useful Convergence Theorem for Probability Distributions. The Annals of Mathematical Statistics , 18(3):434-438, 1947.

Ananda Theertha Suresh, Alon Orlitsky, Jayadev Acharya, and Ashkan Jafarpour. Near-optimalsample estimators for spherical gaussian mixtures. In Z. Ghahramani, M. Welling, C. Cortes, N. Lawrence, and K.Q. Weinberger, editors, Advances in Neural Information Processing Systems , volume 27. Curran Associates, Inc., 2014.

A Appendix: Omitted Proofs of Section 3

Theorem 3.4 (Explicit lower bound for random GapSS instance) . Consider any list-of-points data structure for solving the random GapSS ( 1 2 , w q ) which has expected space O ( k 1+ ρ u ) , uses expected query time O ( k ρ q -o (1) ) , and succeeds with probability at least 0 . 99 . Then we have the following lower bound for sufficiently small w q : ρ q ≥ 1 -w 1 -log 2 -o (1) q + ρ u 1+log w q .

Proof. Our proof proceeds by explicitly calculating the lower bound given in Theorem 3.2 when w u = 1 2 and w q approaches 0 . Recall that Theorem 3.2 states that if a list-of-points data structure solves GapSS( w u , w q ) for k points uses expected space k 1+ ρ u , and has expected query time k ρ q -o k (1) , then for every α ∈ [0 , 1] , we have that

̸

We denote the fraction in the right hand side of Equation 1 as F ( t q , t u ) . Our goal is to provide a lower bound in the case w u = 1 / 2 .

̸

For w u = 1 / 2 fixed, and for fixed w q , α, t u = 1 / 2 , we can consider F as a function of only t q . Because F is a continuously differentiable function in terms of t q , the infimum of F (for fixed w u , w q , α, t u ) can only be achieved either when ∂F/∂t q = 0 , or at the boundary points ( t q = 0 or t q → t -u ).

We first consider the case when the partial derivative is 0 and handle the endpoint cases later. Calculating the partial derivative of F with respect to t q gives us ∂F ∂t q = log t q w q -log t u -t q w u -w q -

α log t q (1 -w q ) w q (1 -t q ) . When ∂F ∂t q = 0 , we must have

Plugging in the relation in (3) and w u = 1 2 , we have

By Lemma A.1, if we set α = 1 + 1 log w q for w q is sufficiently small, we have F ( t u , t q ) ≥ α -w 1 -log 2 -o (1) q , uniformly over t u , t q . Next, let's check the boundary cases. For t q = 0 , Lemma A.8 proves that F ( t u , 0) ≥ α -w 1 -o (1) q ≥ α -w 1 -log 2 -o (1) q . For t q → t -u , because ∂F ∂t q is continuous for 0 ≤ t q < t u and lim t q → t -u ∂F ∂t q = + ∞ , the infimum of F cannot be achieved when t q → t -u .

̸

Thus, for w u = 1 / 2 , any fixed w q sufficiently small, α = 1 + 1 log w q , and any fixed t u = 1 / 2 and the infimum of F across 0 ≤ t q < t u is at least α -w 1 -log 2 -o (1) q , where the o (1) term goes to 0 as w q goes to 0 , uniformly across t u , t q . So in fact, F ( t u , t q ) ≥ α -w 1 -log 2 -o (1) q uniformly across t u , t q . Applying this bound back to our original inequality in 1 gives us the desired bound.

Our goal is to now bound the fraction in the final step of the proof of Theorem 3.4. The following lemma bound this fraction.

Lemma A.1. Fix any constant δ > 0 . Suppose w q < 1 is smaller than a sufficiently small constant c = c δ that only depends on δ , w u = 1 / 2 , and α = 1 + 1 log w q . Suppose these parameters satisfy the relation given in Equation 3. Then

̸

Equivalently,

̸

for sufficiently small w q , where o (1) denotes a term that uniformly goes to 0 as w q → 0 (regardless of t q , t u ).

In the rest of this section, we use o (1) to denote any term that goes to 0 as w q → 0 , uniformly over t q , t u . We will prove some auxiliary lemmas before proving Lemma A.1. We first define the following function H ( x ) .

Definition A.2. For a value x , H ( x ) := x log(2 x ) + (1 -x ) log(2(1 -x )) .

It is clear that H ( x ) is only defined when 0 < x < 1 . Moreover, we note the following basic property and provide its proof for completeness.

Proposition A.3. For any x ∈ (0 , 1) , 2( 1 2 -x ) 2 ≤ H ( x ) ≤ 16( 1 2 -x ) 2 .

Proof. It is simple to check that H (1 / 2) = 0 and H ′ (1 / 2) = 0 . Moreover, the second derivative is H ′′ ( x ) = 1 x + 1 1 -x = 1 x -x 2 . For 0 < x < 1 , x -x 2 ≤ 1 / 4 , so H ′′ ( x ) ≥ 4 for all x . Thus, H ′′ ( x ) ≥ 2( 1 2 -x ) 2 .

Next, we have that x -x 2 ≥ 3 16 for x ∈ [1 / 4 , 3 / 4] , which means H ′′ ( x ) ≤ 16 3 for x ∈ [1 / 4 , 3 / 4] . Thus, H ( x ) ≤ 8 3 ( 1 2 -x ) 2 for x ∈ [1 / 4 , 3 / 4] . Since the first derivative H ′ ( x ) = log( x ) -log(1 -x ) is negative for x < 1 2 and positive for x > 1 2 , this means H ( x ) is maximized as x approaches either 0 or 1 . But the limits equal log 2 , so H ( x ) ≤ log 2 for all x . Since ( 1 2 -x ) 2 ≥ 1 16 for all 1 > x > 3 4 or 0 < x < 1 4 , this means for any such x , H ( x ) ≤ log 2 ≤ 16 log 2 · ( 1 2 -x ) 2 ≤ 16 · ( 1 2 -x ) 2 . So in either case, H ( x ) ≤ 16( 1 2 -x ) 2 .

We are now ready to prove Lemma A.1.

Proof of Lemma A.1. For simplicity of notation, let x = t q . Recalling the value of α , w u , and Equation 3, we have

Now we denote the fraction in the lemma statement as b ( x ) /a ( x ) and we note

From Proposition A.4, it suffices to check the following cases:

In Case 1, x ∗ is such that x ∈ (0 , x ∗ ) is the regime of x such that a and b are well defined. Proposition A.4 further states that x ∗ only depends on w q and x ∗ ≤ w 1 -log 2 -o (1) q as w q → 0 .

The cases are handled in Lemmas A.5, A.6, and A.7, respectively. Combining them proves Lemma A.1.

Proposition A.4. Suppose that 0 < w q < 1 3 and 0 ≤ x ≤ 1 . Then, the regime of x such that a, b are well defined is x ∈ (0 , x ∗ ) , where 0 < x ∗ < 1 only depends on w q and x ∗ ≤ w 1 -log 2 -o (1) q as w q → 0 .

Proof. We must have that 0 < t u < 1 , so that a = H ( t u ) is well-defined. If x = 0 , t u = 0 , and if x = 1 , then log ( 1 -x 1 -w q ) isn't defined, so b isn't defined. If 0 < x < 1 , t u is always positive, so a being well-defined is equivalent to 1 -t u > 0 , which is equivalent to

We can rearrange this as

We can again rearrange this as

where C ( w q ) is positive if w q < 1 / 3 . This is equivalent to is equivalent to 0 < x < 1 C ( w q )+1 . So, we can set x ∗ = 1 C ( w q )+1 . Thus, a is well defined if and only if 0 < x < x ∗ , where x ∗ ∈ (0 , 1) clearly holds. Moreover, if w q < 1 / 3 , then log 1 -x 1 -w q and log 1 1 -2 w q are well-defined, and t u > x > 0 so log ( 1 -x t u ) is also well-defined. In summary, a, b are well defined if and only if 0 < x < x ∗ = 1 1+ C ( w q ) .

Finally, we bound x ∗ for w q sufficiently small. Note that (1 -w q ) 1+1 / (log w q ) = 1 + o (1) and 1 / 2 -w q = 1 / 2 -o (1) , so C ( w q ) = ( e 2 · (1 ± o (1)) ) -log w q = ( e/ 2) -log w q · (1 ± o (1)) = w log 2 -1 ± o (1) q . Thus, C ( w q ) ≥ w log 2 -1+ o (1) q , which means that x ∗ ≤ w 1 -log 2 -o (1) q .

Lemma A.5. Suppose that w q is sufficiently small, and 0 < x ≤ w 1 . 01 q , or w 0 . 99 q ≤ x < x ∗ . Then, b a ≥ -w 1 -log 2 -o (1) q as w q → 0 .

Proof. Since x is strictly positive, we can write x = w 1+ γ q , for some real γ with | γ | ≥ 0 . 01 . Then, x w q = w γ q , so ( x w q ) 1 -α = w -γ/ log w q q = e -γ . Finally, since x = o (1) and w q = o (1) , this means

t u = x + e -γ · ( 1 2 ± o (1) ) = 0 . 5 · e -γ ± o (1) · ( e -γ +1) . Since | γ | > 0 . 01 , this implies that, for w q sufficiently small, | t u -0 . 5 | ≥ Ω(1) , which means a = H ( t u ) = Ω(1) by Proposition A.3.

We can also bound b as follows. Note that ∣ ∣ ∣ log ( 1 -x 1 -w q )∣ ∣ ∣ = O ( x + w q ) , so -α · log ( 1 -x 1 -w q ) ≥ -O ( x + w q ) . Next, note that for w q sufficiently small (and thus x < x ∗ is also sufficiently small), since 0 < α, 1 -α < 1 , ( 1 -x 1 -w q ) α ≥ 0 . 5 , and ( x w q ) 1 -α ≥ x 1 -α ≥ x . Also, 1 2 -w q ≥ 1 3 . Thus, t u ≥ x + x · 1 2 · 1 3 ≥ 7 6 · x . Therefore, 0 ≤ x t u ≤ 6 7 , which means ∣ ∣ ∣ log ( 1 -x t u )∣ ∣ ∣ ≤ O ( x/t u ) . Thus, ∣ ∣ ∣ t u · ( log ( 1 -x t u ) +log ( 1 1 -2 w q ))∣ ∣ ∣ ≤ O ( t u · ( x/t u + w q )) = O ( x + w q ) . Thus, | b | ≤ O ( x + w q ) .

Since a = Ω(1) is positive, and b ≥ -O ( x + w q ) , this means that b a ≥ -O ( x + w q ) . Since we know that x < x ∗ ≤ w 1 -log 2 -o (1) q , this implies that b a ≥ -w 1 -log 2 -o (1) q .

Lemma A.6. Suppose that w 1 . 01 q < x < (1 + 1 log w q ) w q , or (1 -1 log w q ) w q < x < w 0 . 99 q . Then, b a ≥ -w 0 . 99 -o (1) q .

Proof. We again write x = w 1+ γ q , where this time | γ | < 0 . 01 . Since either x > (1 -1 log w q ) w q or x < (1 + 1 log w q ) w q , this means that | γ | ≥ Ω ( 1 (log w q ) 2 ) . Then, we can write

since 0 . 01 > | γ | ≥ Ω ( -1 log w q ) so the w 0 . 99 q term is negligible compared to γ . So, a = H ( t u ) = Θ( γ 2 ) ≥ Ω ( 1 / (log w q ) 4 ) , by Proposition A.3.

Next, to bound b , note that ∣ ∣ ∣ log ( 1 -x 1 -w q )∣ ∣ ∣ = O ( x + w q ) ≤ O ( w 0 . 99 q ) . Also, since t u = e -γ 2 ± O ( w 0 . 99 q ) , this means that t u = Θ(1) , so ∣ ∣ ∣ t u · ( log ( 1 -x t u ) +log ( 1 1 -2 w q ))∣ ∣ ∣ ≤ O ( x + w q ) = O ( w 0 . 99 q ) . Overall, | b | ≤ O ( w 0 . 99 q ) , so b a ≥ -w 0 . 99 -o (1) q .

Lemma A.7. Suppose that (1 + 1 log w q ) w q ≤ x ≤ (1 -1 log w q ) w q . Then, b a ≥ -w 1 -o (1) q .

Proof. Suppose that x = (1 + β ) w q , where | β | ≤ -1 log w q . We will look at t u from a more fine grained perspective.

Thus, we can write

Note that t u = 1 2 -Θ( β/ log w q ) , since the other terms in (5) are all negligible compared to β/ log w q , which means that a = Θ( β 2 / (log w q ) 2 ) by Proposition A.3.

To bound b , we will need the more fine-grained approximation of t u from (5). Indeed, note that log ( 1 -x 1 -w q ) = log ( 1 -βw q 1 -w q ) = -βw q 1 -w q ± O ( β 2 w 2 q ) , and t u · ( log ( 1 -x t u ) +log ( 1 1 -2 w q )) =

t u · log ( t u -x t u (1 -2 w q ) ) = t u · log ( 1 + 2 w q t u -x t u (1 -2 w q ) ) . Note that 2 w q t u = 2(1 / 2 -Θ( β/ log w q )) w q = w q -Θ( β · w q / log w q ) . Thus, 2 w q t u -x = Θ( β · w q ) . Moreover, t u (1 -2 w q ) = Θ(1) . Therefore, we have that

Therefore,

Using the more fine-grained approximation of t u , we have that

where the last line uses the fact that α = 1 + 1 log w q . So,

Therefore, ∣ ∣ b ∣ ∣ ≤ O ( w q · (log w q ) 2 ) ≤ w 1 -o (1) q

Finally we check the endpoint cases of Theorem 3.4.

Lemma A.8. For F ( t u , t q ) defined in Equation 2, and for α = 1 + 1 log w q , F ( t u , 0) ≥ α -w 1 -o (1) q where o (1) goes to 0 as w q goes to 0 , uniformly over t u .

Proof. For t q = 0 , we can calculate that

Let us first consider the term α log(1 -w q ) -t u log(1 -2 w q ) . If we were to set t u = 1 / 2 , this equals

For sufficiently small w q , | log(1 -2 w q ) | ≤ 3 w q , which means that

w

Note that -q log w q is positive, since log w q is negative. If w q is sufficiently small and | t u -1 / 2 | ≤ -c log w q for some sufficiently small constant c , then the term O ( w 2 q + | t u -1 / 2 | · w q ) is smaller than -w q log w q , which means α log(1 -w q ) -t u log(1 -2 w q ) ≥ 0 . Because d ( t u || 1 / 2) is nonnegative, this means F ≥ α ≥ α -w 1 -o (1) q . Alternatively, if | t u -1 / 2 | ≥ -c log w q , then we still have α log(1 -w q ) -t u log(1 -2 w q ) ≥ -O ( w 2 q + | t u -1 / 2 | · w q ) ≥ -O ( w q ) , and by Proposition A.3, d ( t u || 1 / 2) = H ( t u ) = Θ(( t u -1 / 2) 2 ) ≥ Ω ( ( 1 log w q ) 2 ) . So, F ≥ α -O ( w q · (log w q ) 2 ) ≥ α -w 1 -o (1) q . So, in either case, we have that F ( t u , 0) ≥ α -w 1 -o (1) q , where the o (1) term does not depend on t u .

B Appendix: Omitted proofs of section 4

Lemma B.1. The expected space usage of Algorithm 1 is O ( Lℓ + Lk 2 -ℓ + nk ) .

Proof. The algorithm has to store each of the L sets S i which requires space O ( Lℓ ) . Furthermore, it needs to store the sets A i which each have expected size O (2 -ℓ k ) . Indeed, the probability that a random subset of size ℓ is contained in a given T j is at most 2 -ℓ . Finally, the algorithm needs to store the sets T j which takes O ( nk ) space.

Lemma B.2. The expected query time of Algorithm 2 is O ( Lℓ + k ε (1 -ε/ 2) ℓ + n s )

̸

Proof. First, the algorithm forms the set Q which takes O ( n/s ) time. Then, the algorithm goes over the L sets S i until it finds an i such that S i ⊂ Q . This takes time O ( Lℓ ) . Next, the algorithm goes through the indices j ∈ A i . For each such j , it samples the set U j one element at a time checking if U j ⊂ T j . Let us first bound the expected size of A i . We clearly have that i ∗ ∈ A i . Indeed, S i ⊂ Q ⊂ T i ∗ and A i lists all the j such that S i ⊂ T j . Now for a j ∈ [ k ] with j = i ∗ , the assumption that ∥ p j -p i ∗ ∥ 1 > ε , gives that | T j ∩ T i ∗ | ≤ n ( 1 2 -ε 4 ) . As the sampling of S 1 , . . . , S L and Q are independent, we can view S i as a random sizeℓ subset of T i ∗ . In particular, the probability that S i ⊂ T j can be upper bounded by

and so, the expected size of | A i | is at most k (1 -ε/ 2) ℓ . Finally, using the assumption that ∥ p i ∗ -p j ∥ 1 > ε for j = i ∗ , and that n/s ≫ (log k ) /ε 2 , by a standard concentration bound, it holds for any j = i ∗ that | Q ∩ T j | ≤ | Q | (1 -ε/ 4) with high probability in k . In particular, for j = i ∗ , we only expect to include O (1 /ε ) samples in U j before observing that U j ⊊ T j . In conclusion, the expected query time is O ( n s + Lℓ + k ε (1 -ε/ 2) ℓ ) , as desired.

̸

̸

Lemma B.3. Let L = C ( 2 1 -e -2 /s ) ℓ for a sufficiently large constant C . Assume that L = k O (1) . Then Algorithm 2 returns i ∗ with probability at least 0 . 99 .

Proof. It is readily checked that ℓ = O (log k ) = O (log n ) , and further, for s > 10 , it holds that ℓ = O ( log k log s ) = O ( log n log s ) . We record this for later use.

̸

Note that by standard concentration bounds, it holds with high probability in k that Q ⊂ T j only for j = i ∗ . In fact, as in the previous proof, for all j = i ∗ , | Q ∩ T j | ≤ | Q | (1 -ε/ 4) with high probability in k . In particular, this implies that the algorithm with high probability never returns a j = i ∗ . Indeed, by a union bound, the probability of this happening is at most

̸

where we used that k and n are polynomially related and C is sufficiently large. In order for the algorithm to succeed, it therefore suffices to show that there exists an i ∈ [ L ] such that S i ⊂ Q . In that case, the algorithm will indeed return p i ∗ with high probability.

The expected size of Q is

and by a standard application of Azuma's inequality, it holds with high probability in n that

Note that the probability that a single set S i is contained in a fixed set Q is

̸

Using the bounds on ℓ in the beginning of the proof, we find that ℓ ≪ O (( n/s ) 0 . 51 ). In particular, conditioning on the high probability event of Equation (6), the probability in Equation (7) is at least,

for some constant c > 0 . The probability that no S i is contained in Q is at most

We thus choose L = 5 c ( 2 1 -e -2 /s ) ℓ to ensure that this probability is at most e -5 < 1 / 100 and the result follows.

We can now prove our main theorem of Section 4.

Theorem 4.2. Suppose n and k are polynomially related, s ≥ 2 , and that s is such that 5 n s ≥ C log k ε 2 for a sufficiently large constant C . Let ε > 0 and ρ u > 0 be given. There exists a data structure for the HUDE ( s, ε ) problem using space O ( k 1+ ρ u + nk ) and with query time O ( k 1 -ερu 2 log(2 s ) + n/s ) .

Proof of Theorem 4.2. Let us pick L = k ρ u . We further choose ℓ such that L = C ( 2 1 -e -2 /s ) ℓ for some sufficiently large constant C as in Lemma B.3. In particular, ℓ ≤ ρ u lg( k ) , so we obtain that the space bound from Lemma B.1 is O ( k 1+ ρ u + nk ) . On the other hand, the bound on the query time in Lemma B.2 is

as desired. Finally, by the choice of L and ℓ , it follows by Lemma B.3 that the algorithm returns i ∗ with probability at least 0 . 99 .

Note that while vastly simplified from the expression of Theorem 3.2 from [3], the expression for the query time in Theorem 4.2 is unwieldy. For a simplified version of the theorem, one can note that log(1 -ε 2 ) ≤ -ε/ 2 and for s ≥ 2 , we have that 2 1 -e -2 /s ≤ 2 s , resulting in the claimed bound.

̸

Remark B.4 . Theorem 4.2 is stated for the promise problem of Definition 4.1 where all distributions p ∈ P with p = p i ∗ have ∥ p -p i ∗ ∥ 1 ≥ ε . However, even if this condition is not met, we can still guarantee to return a distribution p j such that ∥ p j -p i ∗ ∥ ≤ ε with probability 0.99 and only a slight increase in the query time. Indeed, as in the proof of Lemma B.3 as long as there exists an S i ⊂ Q , the list A i will contain p i ∗ . Moreover, as in the proof of that lemma, the algorithm will never return a p j with ∥ p j -p i ∗ ∥ > ε . Thus it will either return p i ∗ when it encounters it in the list A i , or a distribution p j with ∥ p j -p i ∗ ∥ ≤ ε . The only difference is that now the bound on the number of samples included in U j in Lemma B.2 becomes O (log n/ε ) instead of O (1 /ε ) with a corresponding blow up by a log n factor in the query time.

C Remark about experimental setting

Remark C.1 . The prior work of [1] also tested their 'FastTournament' algorithm on random halfuniform distributions. That algorithm works for the general problem and not just flat distributions, but its generality makes it is much less efficient for the special case we consider. From their experiments, in the setting where k = 8192 , n = 500 , and S = 50 , the best setting of parameters achieves less than 98% accuracy using more than 400000 operations (their notion of operation corresponds to querying the probability mass at a specific index for two distributions while our notion of operation corresponds to querying whether a specific index is in the support of a single distribution/sample). For a comparable setting of k = 10000 , n = 500 , S = 50 , our algorithm uses fewer then 20000

operations, more than a 20 × improvement. In addition to having much better query time than the general algorithm, our algorithm has subquadratic preprocessing time of O ( kLℓ ) while the tournament-based algorithm requires O ( k 2 n ) time which is prohibitive for the parameter settings we test. For these reasons, we restrict our comparisons to our Subset algorithm and the Elimination algorithm baseline, both tailored for the half-uniform setting.

NeurIPS Paper Checklist

1. Claims

Question: Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?

Answer: [Yes]

Justification: All theorem statements have full proofs.

2. Limitations

Question: Does the paper discuss the limitations of the work performed by the authors?

Answer: [Yes]

Justification: We lay out the assumptions underlying our results and discuss our bounds in comparison to prior work in the introduction.

3. Theory Assumptions and Proofs

Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?

Answer: [Yes]

Justification: All theoretical claims have full proofs.

4. Experimental Result Reproducibility

Question: Does the paper fully disclose all the information needed to reproduce the main experimental results of the paper to the extent that it affects the main claims and/or conclusions of the paper (regardless of whether the code and data are provided or not)?

Answer: [Yes]

Justification: Full experimental details given in Section 5.

5. Open access to data and code

Question: Does the paper provide open access to the data and code, with sufficient instructions to faithfully reproduce the main experimental results, as described in supplemental material?

Answer: [Yes]

Justification: Full experimental details given in Section 5. Code is attached in the supplementary material.

6. Experimental Setting/Details

Question: Does the paper specify all the training and test details (e.g., data splits, hyperparameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?

Answer: [Yes]

Justification: Full experimental details given in Section 5.

7. Experiment Statistical Significance

Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?

Answer: [No]

Justification: We do not report error bars but run experiments over 100 randomly chosen queries to boost significance.

8. Experiments Compute Resources

Question: For each experiment, does the paper provide sufficient information on the computer resources (type of compute workers, memory, time of execution) needed to reproduce the experiments?

Answer: [Yes]

Justification: Full experimental details given in Section 5. The experiments are not computationally intensive for the parameter regime we study.

9. Code Of Ethics

Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics https://neurips.cc/public/EthicsGuidelines ?

Answer: [Yes]

Justification: The paper adheres to the code of ethics.

10. Broader Impacts

Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?

Answer: [NA]

Justification: The work is theoretical in nature and we do not envision any societal impacts.

11. Safeguards

Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?

Answer: [NA]

Justification: No new data or models were generated as part of this project.

12. Licenses for existing assets

Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?

Answer: [Yes]

Justification: Yes, we use open-source code from [1].

13. New Assets

Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?

Answer: [No]

Justification: The experimental code is a lightweight modification of an existing code base as a proof-of-concept for our simple upper bound, so we do not add extensive documentation.

14. Crowdsourcing and Research with Human Subjects

Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well as details about compensation (if any)?

Answer: [NA]

Justification: No human subjects.

15. Institutional Review Board (IRB) Approvals or Equivalent for Research with Human Subjects

Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?

Answer: [NA]

Justification: No human subjects.

Peer reviews:
{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper provides a lower bound, and an upper bound w.r.t the hard instances, for the problem of Density Estimation. Their lower bound is based on the ‘list-of-points’ model of computation, which captures all the upper bounds from existing results. Their bounds quantify the necessary tradeoff between sampling complexity, runtime, and space complexity. Their theoretical results are also complemented by experiments showing an improvement over previous methods.\n\nSTRENGTHS:\nSignificance: The paper considers the prominent problem of density estimation, which arises in various areas of machine learning. They prove a fundamental lower bound for the problem (and an upper bound for the hard instances), which paves the way for the construction of better algorithms for this problem (and for a deeper understanding of the fundamental problem). \n\nOriginality: the paper’s proof techniques are not entirely original, they start from lower bounds for set similarity from [3]. However, adapting these to their setting is non-trivial, and they have to deal with a complicated optimization problem for which closed-form solutions are not immediate, and their techniques for dealing with that seem unique. \n\nQuality and Clarity: The paper is well written and clear, and the results are tight. The theoretical results are also complemented with experiments showing significant improvement over previous methods.\n\nWEAKNESSES:\nI do not know of any significant weakness to point out in the work. There is always room to make the work even more clear, especially since the bounds for the different complexities are not always intuitive, so maybe more diagrams could make it more clear but they are not necessary.\n\nQUESTIONS:\nA quick question about the model of computation: do you suspect this to be the only and the main model of computation that is relevant for this problem? Are there any known algorithms (even inefficient) that do not fit this model of computation? In other words, do you expect this lower bound to hold universally over all algorithms (although, of course, maybe not provably)?\n\nLIMITATIONS:\nauthors have adequately addressed the limitations of their work.", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 4, "DATE": "2024-07-04"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper considers the discrete density estimation problem supported on n points. Specifically, given a set of k discrete distributions and samples from one distribution, we would like to recover the underlying distribution. The main focus of this paper is on the interplay between sample complexity and query complexity in solving this problem. The main contribution of this paper lies in establishing a trade-off between sample complexity and query complexity based on the data structure called “list-of-point-model”. The main message is that either we need a linear sample size or we need a number of queries proportional to k. The main tool used in this paper is based on the lower bound established in Ref. [3] and the technical contribution is on solving an implicit optimization problem for their problem.\n\nSTRENGTHS:\nThe statistical and computational trade-off result for density estimation is interesting and explains why the results in the literature are nearly the best possible. This paper also gives a matching upper bound for some special cases.\n\nWEAKNESSES:\nIt seems that the main hardness result the paper use is GapSS, which is from [3]. The reduction part from GapSS to URDE is new, but not sure what the novelty is there. \n\nThe writing in this paper is a little bit confusing and it would be helpful if the authors could explain what they mean by data structure in the paper. For example:\nl5: what does it mean “preserving polynomial data structure”? \nl38: “the data structures are subject to statistical-computational trade-offs”, it is unclear to me what it means.\n\nQUESTIONS:\n1.Could the authors explain where they incorporate the space information as a constraint in showing their lower bound? From Table 1, we know that if we allow superpolynomial space, then logarithmic sampling and query complexity are enough.\n2.Does the query complexity used in this paper connect to the statistical query complexity? The latter is often used to establish statistical-computational trade-offs in statistical problems.\n3.Does the result in this paper provide evidence for row 5 in Table 1, i.e., when s is a constant?\n4. l110 in Definition 2.1 is confusing. I am wondering P is a dataset that consists data or distributions? I think the word \"dataset\" usually refers to samples.\n\nLIMITATIONS:\nThis paper only considers discrete density estimation, while I think it might be more interesting to learn density in the continuous setting, such as in mixtures of Gaussians. It would be great if the authors could comment more on it.", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2024-07-12"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper considers the problem of constructing a data structure for density estimation: given a set of k distributions over [n], construct a data structure. Given samples from one of the distributions, use the data structure to identify a nearby distribution quickly. There is a three-way tradeoff between the number of samples, query time, and data structure space. The goal of this paper is to rule out any algorithm that is nearly optimal along all three axes: if you only have polynomial space, any sublinear sample complexity requires near-linear query time. [For contrast, with exponential space you can get logarithmic samples + time.]\n\nSTRENGTHS:\n* The lower bound is evidence against \"good\" data structures for this problem.\n * This sort of lower bound, involving all of sample complexity + query time + space complexity, is pretty new.\n * The lower bound is numerically quite tight, at least for \"half-uniform\" distributions, for o(n) samples.\n\nWEAKNESSES:\n* I'm not sure that NeurIPS is the best venue, this seems much more theoretical.\n * The lower bound is only for a particular kind of data structure.\n * The upper bound is just for the instances as used in the lower bound construction, and very synthetic.\n\nOverall, it seems like this paper makes some reasonable progress towards understanding the complexity of data structures for this density estimation problem. But I don't really see a strong motivation for this problem, where one gets samples from one of a fixed, large-but-finite, set of possible discrete distributions and must identify which one. \n\nThe chief argument, AFAICT, is something like: there is a line of work using density estimation to learn mixtures of Gaussians, and this paper shows limits on improving the density estimation part as a black box.  But of course mixtures of Gaussians are probably way easier than the half-uniform distributions considered here.\n\nQUESTIONS:\nAre there other settings where one would like to solve this problem, so knowing it's hard is useful?\n\nLIMITATIONS:\nFine.", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 4, "DATE": "2024-07-12"}

comments: SUMMARY:
The authors study the density estimation problem, i.e., given k distributions p1,...,pk over a domain [n] and a query based on samples from a query distribution q, the goal is to output a pi close to q in the 1-norm, i.e., |q-p_i|\le eps (realizable case). Note that usually k>>n.
This leads to a natural trade-off between number of samples, query time and data-structure space. Their upper bound is a modest improvement over Aamand et al. Their main result is Theorem 3.1, a lower bound for the URDE problem, based on a reduction from set similarity (Ahle and Knudson).

STRENGTHS:
(strengths and weakness) The sample complexity of the density estimation problem is important practically and thus the lower bound in the paper is of interest. The authors do a good job of illustrating the reduction from the GapSS problem (Ahle and Knudson), but at the same time they only do an okay job of illustrating the novelty of their ideas. I feel the paper would benefit from a discussion of novelty in their techniques as opposed to just a survey of known bounds. Without that it's difficult for someone like me to judge their contribution.

WEAKNESSES:
see strengths above

QUESTIONS:
see strengths above

LIMITATIONS:
Theory paper, no concerns
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 3
DATE: 2024-07-12