NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Testing Juntas Optimally with Samples

Lorenzo Beretta, Nathaniel Harms, Caleb Koch · DOI

Introduction

In high-dimensional machine learning, identifying the small subset of relevant features is a core challenge. A function $f: \{0, 1\}^n \to \{0, 1\}$ is defined as a $k$-junta if it depends on at most $k$ of its $n$ input variables. This paper addresses two fundamental questions in the distribution-free sample-based model:

  1. Testing: Determining if a function is a $k$-junta or $\epsilon$-far from being one.
  2. Feature Selection: Identifying the $k$ relevant variables, assuming the function is a $k$-junta.

The central contribution of this work is proving that these two tasks are statistically equivalent in terms of sample complexity, settling a long-standing debate in property testing.

The "Obvious" Algorithm

A key insight of the paper is that a simple brute-force approach, which the authors call the "Obvious Algorithm," is actually sample-optimal. This algorithm draws $m$ samples and checks every possible subset of $k$ variables for consistency with the observed data.

Algorithm 1: The brute-force approach for testing if a function is a $k$-junta.

While computationally expensive—checking $\binom{n}{k}$ sets—this strategy achieves the theoretical lower bound for sample count. The authors further generalize this approach to any hypothesis class $\mathcal{H}$, demonstrating a broader principle of "obvious" optimality in testing versus learning.

Algorithm 2: A generalized version of the obvious algorithm for testing or learning a hypothesis class $\mathcal{H}$.

Methodological Innovations

To establish these bounds, the authors introduce several novel techniques:

  • SOPP Reduction: They define a new distribution testing problem, "Supported on One-Per-Pair" (SOPP), and show that junta testing can be reduced to parallel SOPP tests.
  • Balls-and-Bins Lemma: For the lower bound, they model function outputs as "balls" thrown into "bins" (label sequences). They prove that with insufficient samples, the label distribution of a random junta is indistinguishable from noise.
  • Negative Associativity: The proof utilizes concentration inequalities for negatively associated random variables to manage the dependencies between overlapping sets of variables.

Key Results

The paper provides the first tight bound for a natural class of boolean functions in the distribution-free model. The optimal sample complexity for both testing and selection is: $$\Theta\left(\frac{1}{\epsilon} \left(\sqrt{2^k \log \frac{n}{k}} + \log \frac{n}{k}\right)\right)$$

This result highlights a "Birthday Paradox" connection: the $\sqrt{2^k}$ term represents the samples needed to likely observe a collision on the $k$ relevant bits, which is necessary to rule out a candidate set of variables.

Discussion and Future Work

The findings reveal a significant statistical-computational gap. While the "Obvious Algorithm" is sample-optimal, it is not time-efficient. Under the Strong Exponential Time Hypothesis (SETH), it may be impossible to achieve both optimal samples and polynomial runtime.

Future research remains focused on finding algorithms that balance these trade-offs and determining which other function classes follow the "obvious algorithm is optimal" rule. Currently, juntas stand as a primary example where the evidence required to reject a property is as substantial as the proof required to learn the underlying structure.

Summary updated

BibTeX
@inproceedings{beretta2026testing,
  author = {Lorenzo Beretta and Nathaniel Harms and Caleb Koch},
  title = {{Testing Juntas Optimally with Samples}},
  booktitle = {SODA},
  year = {2026},
  doi = {10.1137/1.9781611978971.20},
}
Figure