# Two-Level Softmax Sampling Done Right: Correcting Bias from Size Imbalance and Dispersion

*Walid Bendada, Guillaume Salha-Galvan*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/149214) · [OpenReview](https://openreview.net/forum?id=s3eaoMXlo8) · [alphaXiv](https://www.alphaxiv.org/abs/2610.10483) · [Open on the map](../papers.html#p149214)

Category: [Causality, Privacy & Learning Theory](../pcat/11.md) › [Risk Estimation and Evaluation under Uncertainty](../pgroup/591.md) · Type: new method · Keywords: softmax sampling, bias correction, cluster size imbalance, intra-cluster dispersion, sublinear sampling

## Summary
The paper identifies systematic biases in Two-Level Softmax (2LS) sampling caused by ignoring cluster size imbalance and intra-cluster similarity dispersion, and proposes Size-Corrected 2LS (S-2LS) and Size- and Dispersion-Corrected 2LS (SD-2LS) to correct these biases, delivering provably better softmax approximations with negligible computational overhead.

## Explained to a 5-year-old
When you have a huge list of choices, picking one the right way can take a long time. So people made a faster trick that picks a group first, then a choice inside the group. However, this trick sometimes picks groups that are too big or too similar, making the choices unfair. The researchers noticed this problem and made a new way to pick groups fairly by looking at how many items are in each group and how similar they are. Their new method still works fast and gives better, more balanced choices.

## Explained to a 5-year-old, longer
Imagine you have a huge box of crayons and you want to pick one at random. Looking at every crayon one by one would take a very long time. So someone thought of a clever shortcut: first pick a color family, like all reds together. Then inside that family, pick a specific crayon. However, sometimes the shortcut picks the wrong families because some families have many more crayons than others. Also, if the crayons in a family look almost the same, the shortcut might not notice the differences. This unfair picking can make the results not truly random. The researchers saw this problem and came up with a better way to choose families. Their new method counts how many crayons are in each family and also checks how similar the crayons are inside. By using both the size and the similarity, the families are chosen more fairly. This makes the final pick closer to a perfect random choice. The new method still works quickly, so you get fairness without waiting too long.

## For a technical reader
The paper points out that the common two-level softmax sampling technique can bias results because it ignores how many items belong to each cluster and how similar items inside a cluster are. To fix this, the authors propose two new sampling schemes, Size-Corrected 2LS (S-2LS) and Size-and-Dispersion-Corrected 2LS (SD-2LS), which weight clusters by both size and intra-cluster dispersion. These corrected methods still run in sub-linear time, adding only a small amount of computation to estimate the needed statistics. Experiments on several large datasets show that the corrected schemes provide more accurate sampling while maintaining the speed benefits of the original approach.

## Problem
Sampling from a softmax distribution at scale is computationally expensive, and approximate two-level sampling methods can introduce systematic bias because they do not account for how many items belong to each cluster or how similar items within a cluster are.

## Method
The approach partitions items into clusters, then samples a cluster proportionally to its size and intra-cluster similarity dispersion before selecting an item within the chosen cluster, thereby correcting the bias introduced by ignoring these factors.

## Contributions
The paper identifies systematic biases in two-level softmax sampling and proposes corrections that account for cluster size imbalance and intra-cluster similarity dispersion, providing provably better approximations with negligible computational overhead.

## Limitations and assumptions
The method assumes that items can be partitioned into clusters and that cluster sizes and intra-cluster similarity dispersion are known or estimable.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/149214)
