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

Binary Hypothesis Testing for Softmax Models and Leverage Score Models

Yuzhou Gu, Zhao Song, Junze Yin

Reference: Gu, Y., Song, Z., & Yin, J. (2025). Binary Hypothesis Testing for Softmax Models and Leverage Score Models. Proceedings of the 42nd International Conference on Machine Learning (ICML).

As Large Language Models (LLMs) grow in complexity, they increasingly operate as "black boxes." While their empirical success is undeniable, understanding exactly how specific parameter changes alter their behavior across different domains remains a significant challenge. A fundamental question arises for practitioners and theoreticians alike: How can we tell two similar models apart merely by observing their outputs?

This paper, accepted for ICML 2025, provides a rigorous theoretical framework to answer this question. By analyzing the mathematical engines driving modern AI—specifically Softmax and Leverage Score models—the authors establish the fundamental limits on the number of "queries" (or samples) required to distinguish between two slightly different models.

The Core Problem: Binary Hypothesis Testing

The authors approach model distinguishability through the lens of Binary Hypothesis Testing. Imagine possessing two models, $A$ and $B$, which share a similar architecture but differ slightly in their underlying parameters. Given a "mystery" model guaranteed to be either $A$ or $B$, how many times must one query the model and observe its output to confidently identify it?

The research focuses on two specific model types:

  1. Softmax Models: The foundational mathematical operation behind the "Attention" mechanism in Transformer-based LLMs.
  2. Leverage Score Models: A critical tool in theoretical computer science and randomized linear algebra, widely used for matrix sketching, graph sparsification, and optimization.

The inherent challenge is that both models are non-linear and output probability distributions rather than deterministic answers. Minute parameter shifts might result in nearly indistinguishable output distributions, or conversely, cause the model to behave entirely differently depending on the specific input vector provided.

Theoretical Framework and Methodology

Because this is a purely theoretical paper, it relies on mathematical proofs and worst-case synthetic constructs rather than empirical datasets. The authors leverage tools from Information Theory to bound the "sample complexity"—the minimum number of queries needed to distinguish the models.

  • Hellinger Distance ($H^2$): The researchers demonstrate that sample complexity is inversely proportional to the squared Hellinger distance between the probability distributions generated by the two models.
  • Energy Constraints: A critical contribution of this work is the application of "energy constraints" to the input vectors. Without such constraints, a theoretical user could feed an infinitely large input into a softmax model, forcing the output distribution to become entirely deterministic (e.g., assigning 100% probability to a single token). This would make distinguishing models trivial. By capping the "energy" (or norm) of the input, the authors simulate realistic operational conditions, akin to the effects of batch normalization in neural networks.
  • Perturbation Theory: To analyze leverage score models, the authors utilize matrix perturbation theory. This allows them to track how minor alterations in an input matrix propagate through matrix inversion, ultimately shifting the resulting leverage score distribution.

Key Findings and Insights

The paper bridges the theoretical foundations of LLMs with classical randomized linear algebra, revealing that "attention" in AI and "importance sampling" in linear algebra share deep theoretical similarities.

Sample Complexity Bounds

  • Softmax Complexity: For two softmax models whose parameters differ by a distance of $\epsilon$, the number of queries required to distinguish them scales asymptotically as $\Theta(\epsilon^{-2})$.
  • Leverage Score Complexity: The authors establish a lower bound of $\Omega(\epsilon^{-1})$ and an upper bound of $O(\epsilon^{-2})$ for leverage score models. This indicates that under certain conditions, leverage score models may be slightly easier to distinguish than softmax models, though the quadratic dependence on $\epsilon$ frequently remains the bottleneck.
  • Tightness: The proofs confirm that these bounds are mathematically "tight." No algorithm can significantly outperform these established limits.

The Invariance Problem and Sensitivity

The research highlights the Invariance Problem: different parameter matrices can yield identical softmax outputs (for instance, adding a constant to every row of a matrix leaves the softmax distribution unchanged). Consequently, models cannot always be distinguished by inspecting their parameters alone; their functional outputs must be evaluated.

To address this, the authors introduce a sensitivity parameter, $\nu$, representing the maximum variance of a model's output relative to a specific parameter change. A model that is highly sensitive to its inputs requires fewer samples to be distinguished from a neighboring model. Furthermore, the paper distinguishes between "global" lower bounds (worst-case sample requirements) and "local" upper bounds (sample requirements when the specific direction of parameter divergence is known).

Limitations and Future Directions

While the paper establishes robust theoretical limits, it also outlines several avenues for future research:

  • Computational Cost of Optimal Inputs: The proofs guarantee that an algorithm exists to distinguish models in $O(\epsilon^{-2})$ queries, but this relies on finding an "optimal" input vector $x$. Calculating this optimal vector is framed as an optimization problem that may be computationally prohibitive in high-dimensional spaces.
  • Beyond Binary Testing: The current framework is restricted to comparing two known models. Future work could expand into "Goodness-of-fit" testing (determining if a model is $A$ or something entirely unknown) or "Two-sample testing" (determining if two mystery models are identical).
  • Practical NLP Mapping: Translating these theoretical "energy-constrained vectors" into actual, discrete natural language prompts for LLMs represents a significant leap. Bridging this gap between continuous vector spaces and discrete token prompts remains a compelling challenge for applied researchers.

Summary updated

BibTeX
@inproceedings{gu2025binary,
  author = {Yuzhou Gu and Zhao Song and Junze Yin},
  title = {{Binary Hypothesis Testing for Softmax Models and Leverage Score Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=eKXicUVKCs},
}
Figure