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

Tree Learning: Optimal Sample Complexity and Algorithms

Dmitrii Avdiukhin, Grigory Yaroslavtsev, Danny Vainstein, Orr Fischer, Sauman Das, Faraz Mirza

Introduction

Hierarchical clustering is a fundamental tool in data science, essential for organizing complex data in fields ranging from genomics to computer vision. Traditionally, these hierarchies are constructed using distance metrics. However, in many modern contexts—particularly those involving human-in-the-loop systems like crowdsourcing—it is often more intuitive to collect relative comparisons. A common format is the "odd-one-out" triplet: given three items $(x, y, z)$, a user identifies which pair is most similar.

Despite the popularity of this approach, a rigorous theoretical understanding of the sample complexity required to learn these trees was previously lacking. This research establishes the first tight theoretical bounds for learning hierarchical tree representations from labeled triplets, addressing both PAC (Probably Approximately Correct) and online learning settings.

The Learning Framework

The study focuses on two primary learning paradigms:

  1. PAC Learning: Determining the number of samples needed from a fixed distribution to predict future labels with high accuracy.
  2. Online Learning: An adversarial setting where triplets are presented sequentially, and the goal is to minimize the total number of mistakes made by the algorithm.

The central question is: how many labeled triplets are necessary and sufficient to uniquely identify or approximate the underlying tree structure?

Theoretical Contributions: Intrinsic Dimensions

The authors derive their results by calculating the intrinsic dimensions of the hypothesis class of hierarchical trees.

Natarajan Dimension and PAC Learning

For PAC learning, the complexity is governed by the Natarajan dimension, which measures the capacity of a multi-class hypothesis space. Through a novel combinatorial argument involving "closed sets"—subsets of data where constraints are so interconnected they force a specific structure—the authors prove that for a set of $n$ elements, the Natarajan dimension is exactly $n-2$.

This result is significant because it shows that despite the number of possible trees being double-exponential in $n$, the sample complexity required to learn them remains linear.

Littlestone Dimension and Online Learning

In the online, adversarial setting, the complexity is determined by the Littlestone dimension. The authors demonstrate that this dimension is $\Theta(n \log n)$. This reveals a fundamental "online gap": learning a tree sequentially against an adversary is strictly harder than learning from a fixed distribution, as the adversary can exploit structural uncertainties in the tree's branches.

Reorientation Operations

To establish upper bounds, the researchers developed "reorientation operations." This technique involves systematically changing which item in a triplet is the "odd one out" to determine if a valid tree structure can still be maintained, effectively mapping the boundaries of the tree hypothesis space.

Experimental Validation

The theoretical bounds were tested across three distinct data environments:

  • Synthetic Trees: Randomly generated "ground truth" trees used to validate the realizable setting where a perfect tree exists.
  • ImageNet Hierarchy: A massive real-world dataset comprising over 48,000 visual concepts. This tested the algorithms' performance on non-binary and complex hierarchies.
  • Spambase Dataset: Feature vectors for email spam detection used to evaluate the "agnostic setting," where the data may not perfectly fit a tree structure, requiring the algorithm to find the best possible fit.

Key Results and Insights

  • Optimal Sample Complexity: For PAC learning, the required samples scale as $\Theta(\frac{n}{\epsilon} \cdot \text{polylog}(\frac{1}{\epsilon}, \frac{1}{\delta}))$. In the agnostic (noisy) case, the complexity scales with $1/\epsilon^2$.
  • Mistake Bounds: In online learning, the algorithm is guaranteed to make no more than $O(n \log n)$ mistakes.
  • Computational Efficiency: The authors provide algorithms that can construct consistent tree classifiers in near-linear time, ensuring that these theoretical bounds are practically applicable to large-scale datasets.
  • Empirical Confirmation: Experiments on ImageNet confirmed the theoretical $1/\epsilon$ relationship, showing that the product of the error rate and the number of samples remains nearly constant.

Conclusion and Future Directions

While this work provides a definitive answer to the sample complexity of tree learning, several avenues for future research remain. While sample complexity is optimal in the agnostic case, finding the absolute best-fitting tree for inconsistent data remains NP-hard. Current heuristics involve cutting minimal edges, but more efficient approximation algorithms are needed. Additionally, extending this framework to active learning—where the algorithm strategically selects which triplets to query—could further reduce the number of comparisons needed to reconstruct a hierarchy.

Summary updated

BibTeX
@inproceedings{avdiukhin2023tree,
  author = {Dmitrii Avdiukhin and Grigory Yaroslavtsev and Danny Vainstein and Orr Fischer and Sauman Das and Faraz Mirza},
  title = {{Tree Learning: Optimal Sample Complexity and Algorithms}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.1609/aaai.v37i6.25822},
}
Figure