Distribution Free Fourier Sparsity Testing

Arijit Ghosh, Manmatha RoyNeurIPS 2026

TL;DR

Before burning expensive compute to learn a high-dimensional Boolean function, it helps to quickly check if that function actually has a simple, sparse Fourier representation. While previous algorithms could only run this check assuming uniformly random inputs, real-world data is rarely so neat. This paper introduces the first Fourier sparsity tester that works over any unknown data distribution—requiring surprisingly few queries and zero knowledge of the ambient dimension.

What Problem Does This Paper Address?

In machine learning and theoretical computer science, high-dimensional functions over the Boolean hypercube ($f: \mathbb{F}_2^n \to \mathbb{R}$) often depend on just a few underlying components. Just as a complex musical chord can be broken down into a few pure notes, many natural concept classes—like decision trees or graph cuts—are $s$-Fourier-sparse, meaning they have at most $s$ nonzero coefficients when expressed in the Fourier basis.

Learning these functions is a classic, computationally heavy task, and most learning algorithms assume your target is genuinely $s$-sparse. Property testing acts as a lightweight preprocessing step: by querying the function a tiny number of times, a tester decides whether $f$ is truly $s$-sparse or "far" from any $s$-sparse function.

Until now, all Fourier sparsity testers measured "farness" assuming inputs were drawn from a uniform distribution. In realistic learning scenarios, data distributions are biased, structured, and unknown. Moving to this distribution-free setting—where you get black-box query access to $f$ and random samples from an arbitrary unknown distribution $D$—usually causes query complexity to explode. For the closely related class of $k$-juntas (functions depending on at most $k$ variables), moving to a distribution-free nonadaptive setting causes query complexity to blow up exponentially. The authors ask: can we test Fourier sparsity under arbitrary distributions with only a modest, polynomial overhead?

Methods

The authors answer yes by combining a spectral check under the uniform distribution with a novel pointwise self-approximator (or self-corrector). Suppose $g^\star$ is the closest $s$-sparse function to $f$ under the uniform measure. The core insight is that we don't need to explicitly reconstruct $g^\star$ (which depends on the dimension $n$) to test $f$ under $D$; we only need to evaluate $g^\star(x)$ on a handful of points sampled from $D$.

They build this implicit evaluator using three main subroutines:

  1. FOURIER-SIEVE: Adapting "sketching by hashing," the algorithm randomly partitions the Fourier space into cosets of a random subspace. This scatters the heavy Fourier coefficients into separate buckets, isolating the dominant frequencies from background noise without scanning all $2^n$ possibilities.
The FOURIER-SIEVE algorithm hashes the Fourier domain into random cosets to isolate heavy spectral mass.
  1. LIST-CORRECTION: Once heavy cosets are isolated, the algorithm needs the values of their dominant Fourier characters $\chi_{\alpha_C}(x)$ at specific query points $x$. Borrowing ideas from Hadamard code self-correction, it queries $f$ at random shifts ($y_j$ and $x + y_j$) to reliably recover the character's sign (+1 or -1) without ever learning the frequency's actual $n$-bit identity $\alpha_C$.
  2. ESTIMATE-HEAVY-FOURIER-COEFFS: Combining oracle queries of $f$ with the self-corrected character evaluations, this step estimates the magnitudes of the top $s$ coefficients.

To test $f$, the algorithm first checks if the estimated top $s$ coefficients capture almost all of $f$'s total energy (using Parseval's identity). If not, $f$ isn't sparse even uniformly, so it rejects. If yes, it draws samples $z_i \sim D$, evaluates its implicit proxy for $g^\star(z_i)$, and checks if it matches $f(z_i)$. If $f$ is truly sparse, $f = g^\star$ everywhere; if $f$ is far from sparse under $D$, the mismatch will quickly catch it.

Datasets

Not discussed in the paper. (This is a purely theoretical computer science paper proving mathematical guarantees rather than evaluating on empirical benchmarks.)

Key Insights and Ideas

  • No exponential penalty for nonadaptivity: Unlike $k$-junta testing, where nonadaptive distribution-free testing requires $2^{\Omega(k)}$ queries, Fourier sparsity testing needs only a polynomial overhead. Moreover, the tester is completely nonadaptive—all oracle queries can be chosen in advance before seeing any answers.
  • Dimension-free complexity via implicit evaluation: Explicitly writing down which frequencies are nonzero takes $\Omega(n)$ bits, tying complexity to the ambient dimension. By self-correcting character values directly at sampled points, the query and sample complexities become completely independent of $n$.
  • Uniform closeness anchors arbitrary distributions: If $f$ passes the uniform spectral check, it must be close to $g^\star$ globally. And if $f$ is truly $s$-sparse, $g^\star$ is $f$. Checking $f(z_i) \approx g^\star(z_i)$ on samples from $D$ neatly bridges the uniform Fourier algebra and the unknown distribution $D$.

Key Results

  • Main Complexity Bound: Given error threshold $\varepsilon$, distance parameter $\delta$, and sparsity $s$, the randomized nonadaptive algorithm distinguishes $s$-Fourier-sparse functions from those where $\Pr_{x \sim D}[|f(x) - g(x)| > \varepsilon] > \delta$ (for all $s$-sparse $g$) with probability at least $2/3$.
  • Query & Sample Efficiency: It uses $\widetilde{O}\left(\frac{s^4}{\delta^4 \varepsilon^8}\right)$ oracle queries to $f$ (simplified to $\widetilde{O}((s/\delta)^4)$ for constant $\varepsilon$) and draws just $\widetilde{O}(1/\delta)$ samples from the unknown distribution $D$.
  • Modest Overhead: Compared to optimal uniform-distribution testers requiring $\widetilde{O}(s/\varepsilon^2)$ queries, generalized distribution-free testing incurs only a quartic overhead in $s$.

Limitations and Future Work

  • Tolerant testing remains open: The tester only guarantees acceptance when $f$ is exactly $s$-sparse. If $f$ is merely close to $s$-sparse under $D$, it might have chaotic behavior outside the support of $D$, ruining its uniform Fourier spectrum and causing the initial spectral check to fail.
  • Fixed canonical basis: The paper tests sparsity in the standard uniform Fourier basis while measuring distance under $D$. Adapting the basis itself to be orthonormal under $D$ breaks the algebraic shift-invariance and subspace structures that hashing and self-correction rely on. Extending these tools to structured measures—like product distributions—is a prime target for future work.

Summary updated

Abstract

Learning functions $ f : \mathbb{F}_2^n \to \mathbb{R} $ with sparse Fourier representations plays a central role in computational learning theory, as such functions capture many natural concept classes in machine learning. In recent years, Fourier sparsity has also been studied from the related perspective of property testing, where the goal is to determine, given query access to a function, whether it is $ s $-Fourier-sparse or far from every such function under an appropriate distance measure. Such testers can serve as a preprocessing step for model selection in agnostic learning of Fourier-sparse functions, where validating the structural assumption is crucial before applying computationally expensive learning algorithms. However, all prior work on testing Fourier sparsity considers distance with respect to the uniform distribution over the hypercube. In this work, we initiate the study of Fourier sparsity testing in the distribution-free setting, the property-testing analogue of the PAC+MQ learning framework. In this model, the tester is given oracle access to an unknown function and sample access to an arbitrary and unknown input distribution, and must distinguish $ s $-Fourier-sparse functions from those that are $ \delta $-far from every such function with respect to the underlying distribution. We design a nonadaptive randomized tester that succeeds with high probability using $ \widetilde{O}((s/\delta)^4) $ oracle queries and $ \widetilde{O}(1/\delta) $ samples from the unknown distribution.
BibTeX
@inproceedings{ghosh2026distribution,
  author = {Arijit Ghosh and Manmatha Roy},
  title = {{Distribution Free Fourier Sparsity Testing}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=Yptam5J8AE},
}
Figure