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

argmax centroid

Chengyue Gong, Mao Ye, Qiang Liu

In many machine learning problems, we aren't just looking for a single "best" answer; we're trying to understand the distribution of best answers across different scenarios. Whether it's Thompson sampling in reinforcement learning or meta-learning across diverse tasks, we often need to estimate the argmax distribution—the distribution of points that minimize a random function.

This paper introduces a clever way to approximate this distribution without the crushing computational cost of traditional methods.

TL;DR

The authors propose Argmax Centroids, a method to compactly approximate the distribution of optima for random functions by explicitly optimizing a small set of representative "centroid" points. This approach avoids expensive Monte Carlo sampling and provides a more accurate representation of multi-modal task distributions, leading to state-of-the-art performance in few-shot learning, personalized dialogue, and domain adaptation.

What Problem Does This Paper Address?

Imagine you are training a model to handle many different tasks (e.g., recognizing different types of objects or chatting with different personalities). Each task has its own optimal set of parameters. To be a good "meta-learner," you want to know the distribution of these optimal parameters.

The standard approach is Monte Carlo (MC) sampling: draw a random task, solve the optimization problem to find its optimum, and repeat this hundreds of times. This is incredibly slow because each "sample" requires a full training run. Furthermore, if you only have a small budget for samples, random sampling often misses important parts of the parameter space, especially in high-dimensional deep learning models.

Methods

Instead of drawing random samples, the authors propose to learn a set of $n$ "centroid" points $\{\theta_i\}_{i=1}^n$ that best represent the overall distribution.

The "Aha!" Objective

The core innovation is replacing the standard Wasserstein distance (which is hard to compute) with a surrogate objective. Instead of minimizing the distance between points, they minimize the expected value of the function itself:

$$L(\theta) = \mathbb{E}_{\xi \sim \pi} [\min_{i \in [n]} f_\xi(\theta_i)]$$

Intuitively, this objective says: "Find a set of points such that for any random task, at least one of these points is close to the optimum."

How it Works:

  1. Optimization: They use stochastic gradient descent (SGD) to update the centroids. For each batch of tasks, they find the "winning" centroid (the one with the lowest loss for that task) and update it.
  2. Re-sampling: To prevent "dead" centroids that never get picked, they include a re-sampling step that redistributes low-weight centroids to more promising areas.
  3. Selection at Test Time: When a new task arrives, they don't average the centroids. Instead, they use a few examples from the new task to select the single best centroid from their pool.
An illustration of the selection process: candidate models (centroids) are aligned to training datasets, and the best one is selected for the test task.

Datasets

The authors evaluated their method across several distinct domains:

  • Toy Examples: 2D and high-dimensional Gaussian mixture models to visualize distribution coverage.
  • Few-shot Image Classification: Mini-ImageNet and TieredImageNet, standard benchmarks for learning from limited data.
  • Personalized Dialogue: The Persona-Chat dataset, aimed at creating consistent chatbot personalities.
  • Multi-target Domain Adaptation: DomainNet, which contains 6 different styles and 345 classes of images.

Key Insights and Ideas

  • Selection > Averaging: Traditional ensembles average the outputs of multiple models. This works for unimodal distributions but fails when tasks are diverse. Argmax Centroids act like a "specialist pool"—you pick the specialist that fits the current task best.
  • Efficiency in High Dimensions: Random sampling suffers from the "curse of dimensionality." Optimized centroids, however, can capture the modes of a distribution much more efficiently. Optimized centroids achieve much lower Wasserstein distance than random samples, especially as the number of dimensions increases.
  • K-Means Connection: The authors show that their objective is actually a generalization of the K-means algorithm. If the loss function is a simple squared distance, their method reduces exactly to K-means.
Comparison of random vs. optimized centroids, showing optimized points aligning better with the true distribution and achieving lower Wasserstein error.

Key Results

  • Few-Shot Learning: Adding Argmax Centroids to existing SOTA methods like SIB and IFSL consistently boosted accuracy. For example, on Mini-ImageNet (1-shot), they improved SIB from 70.0% to 71.2%.
  • Personalized Dialogue: The method significantly improved chatbot performance, raising the BLEU score from 0.77 to 0.91 and lowering Perplexity (PPL) from 46.35 to 43.94.
  • Domain Adaptation: On DomainNet, using multiple centroids (specialized adaptors) outperformed a single shared adaptor by nearly 5% absolute accuracy (44.3% vs 39.5%).

Limitations and Future Work

  • Validation Requirement: To select the best centroid at test time, you need a small "validation" set for the new task. If this set is too small, the model can overfit and select the wrong specialist.
  • Overfitting with Many Heads: As the number of centroids ($n$) increases, the risk of overfitting on the selection set grows. While training accuracy keeps going up with more "heads," test accuracy can eventually plateau or drop if the validation set isn't robust enough.

Future work may explore how to better diversify these centroids or apply the method to even more complex "lifelong learning" scenarios where the distribution of tasks changes over time.

Summary updated

BibTeX
@inproceedings{gong2021argmax,
  author = {Chengyue Gong and Mao Ye and Qiang Liu},
  title = {{argmax centroid}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
}
Figure