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

Learning to Link

Maria-Florina Balcan, Travis Dick, Manuel Lang

Clustering is often treated as a "black box" step in data science. You pick an algorithm (like K-Means or Single Linkage), choose a distance metric (like Euclidean), and hope for the best. But what if you could mathematically prove which combination is best for your specific data?

In their paper "Learning to Link," Maria-Florina Balcan, Travis Dick, and Manuel Lang move clustering from a game of trial-and-error into the realm of automated, data-driven optimization.

The Challenge of Clustering Optimization

The "No Free Lunch" theorem applies heavily to clustering: no single algorithm or distance metric works best for every dataset. For example, clustering hand-written digits requires a different approach than clustering social network connections.

Traditionally, researchers manually tune these pipelines. This is difficult because the "loss function" for clustering—how much the output differs from a ground-truth target—is piecewise constant. If you nudge a parameter slightly, the clustering output usually doesn't change at all, until it suddenly jumps to a completely different structure. This makes standard optimization tools like gradient descent useless.

The authors tackle two main gaps:

  1. Theoretical: How many "training" clustering tasks do we need to see before we can guarantee our chosen parameters will work on new, unseen tasks? (Sample Complexity).
  2. Algorithmic: How do we efficiently search the massive space of possible algorithm/metric combinations when the loss function is so "jumpy"?

A Data-Driven Methodology

The authors focus on linkage-based clustering, a bottom-up approach where the algorithm starts with every point in its own cluster and repeatedly merges the "closest" pair.

1. Parameterization

Instead of picking one fixed rule, they learn a convex combination:

  • Metrics ($\beta$): They mix multiple base distance functions (e.g., interpolating between Euclidean and Cosine distances).
  • Merge Functions ($\alpha$): They mix different linkage rules (e.g., interpolating between Single Linkage and Complete Linkage).

2. The Execution Tree

To solve the optimization problem, they use a data structure called an execution tree.

Execution tree tracking cluster merges across parameter ranges

This tree tracks how the sequence of merges changes as the parameters ($\alpha$ or $\beta$) vary. By traversing this tree, they can partition the parameter space into intervals where the clustering output remains constant.

3. Sweep-line Optimization

Within each node of the execution tree, they use a "sweep-line" algorithm.

Sweep-line optimization finding critical values

This efficiently identifies the "critical values" where the algorithm would switch from merging one pair of clusters to another. By finding these intersections, they can locate the global optimum without having to check every possible parameter value.

Key Insights and Results

The authors evaluated their approach on a diverse set of benchmarks, including MNIST, CIFAR-10, Omniglot, and synthetic datasets, simulating a distribution of related clustering tasks.

  • The Power of Interpolation: The "best" algorithm is rarely a pure standard like Single Linkage. For MNIST, the optimal $\alpha$ was 0.874—a specific blend that outperformed any off-the-shelf linkage rule.
  • Significant Error Reduction: On a synthetic "Rings and Disks" dataset, the learned algorithm reduced the Hamming error by 20% compared to standard methods.
  • Metric Synergy: On the Omniglot dataset, mixing a hand-designed "stroke" metric with a neural network embedding improved clustering accuracy by 10%. Learning the metric and the linkage rule together provides a significant boost over learning them in isolation.
  • Massive Speedups: While the theoretical worst-case number of "jumps" in the loss function is $O(n^8)$, the authors found that in real-world datasets, the number of discontinuities is many orders of magnitude smaller. Their execution-tree approach is astronomically faster than previous combinatorial methods. For a 1,000-point MNIST instance, they estimate a speedup factor of roughly $10^{21}$ over the brute-force alternative.

Limitations and Future Work

While highly effective, the current efficient algorithms are optimized for 1D or 2D parameter spaces (interpolating between two metrics or two rules). Scaling this to learn weights for dozens of metrics simultaneously remains a computational challenge. Additionally, including "Average Linkage" in the family makes the math exponentially more complex, though their sample complexity theory still holds.

Ultimately, extending this "data-driven selection" framework beyond linkage to other families like spectral clustering or K-Means variants represents a promising next step for the field.

Summary updated

BibTeX
@inproceedings{balcan2020learning,
  author = {Maria-Florina Balcan and Travis Dick and Manuel Lang},
  title = {{Learning to Link}},
  booktitle = {International Conference on Learning Representations},
  year = {2020},
  url = {https://openreview.net/forum?id=RLpNlAc-F3},
}
Figure