SOL: Measuring Gaps between Text Distributions by Double Sliced Wasserstein Metrics

Gregor Kornhardt, Moritz Piening, Jannis Chemseddine, Gabriele SteidlarXiv 2026

TL;DR

The authors introduce SOL (Sliced Optimal transport for Language), a new sample-based metric for evaluating text generation models. By comparing the distributions of transformer hidden states using a "Double Sliced Wasserstein" distance, SOL provides a stable, model-agnostic way to measure how well a generator matches real data, successfully detecting failures like mode collapse that traditional metrics miss.

What Problem Does This Paper Address?

Evaluating Large Language Models (LLMs) is surprisingly difficult. For years, Perplexity (PPL) has been the gold standard, but it has a major flaw: it’s tied to the model's internal likelihood. This makes it impossible to fairly compare different model families—for instance, comparing a standard autoregressive GPT model to a newer diffusion-based or flow-based model.

Existing sample-based alternatives also fall short. Generative Perplexity rewards models that imitate a specific reference model rather than the actual data distribution. MAUVE, a popular recent metric, suffers from two main issues:

  1. Instability: Its scores fluctuate wildly depending on the number of samples and the choice of clustering hyperparameters.
  2. Positional Bias: Because it typically relies on the last hidden state of a causal transformer, it is often "blind" to errors or repetitions occurring at the beginning of a sequence.

Methods

SOL moves away from representing a text as a single vector. Instead, it treats each sequence as a "token cloud"—an empirical measure of all its contextual hidden states under a fixed transformer backbone.

To compare these distributions of distributions without the massive computational cost of nested optimal transport, the authors use the Double Sliced Wasserstein (DSW) distance. The process works as follows:

  1. First Slicing: Project the high-dimensional hidden states onto random one-dimensional directions ($\xi$).
  2. Quantile Representation: Represent these 1D projections as quantile functions.
  3. Second Slicing: Slice these functions again using a Gaussian process ($g$).
  4. Sorting: Compute the final distance using simple sorting, which is computationally efficient.
Figure 1: Illustration of one SOL slice for fixed directions ξ and g using a causal transformer. A sequence is represented by the point cloud T θ(x) ∈P2(Rd) of its contextual hidden states, and a corpus becomes a collection of such clouds. The first slice projects each cloud along ξ; its one-dimensional empirical distribution is then represented by a quantile function and sliced again along g. This maps the corpus to P2(R), where the final Wasserstein distance is computed. SOL integrates this quantity over ξ and g.

The authors prove that if the underlying transformer is injective (which recent research suggests is true for trained LLMs), SOL is a mathematically valid metric.

Datasets

The researchers evaluated SOL across several standard benchmarks:

  • OpenWebText (OWT): The primary dataset for evaluating modern diffusion-based language models.
  • WebText: Used for controlled experiments on model size, sequence length, and sampling temperature.
  • AG News: Used to test "mode collapse" (loss of diversity) and "support expansion" (generating off-topic content).
  • LM1B (One Billion Word Benchmark): Used to study the numerical stability of the metric.

Key Insights and Ideas

  • Distributional Awareness: Unlike Perplexity, SOL is sensitive to the diversity of the generated corpus. If a model collapses and generates the same high-quality sentence repeatedly, SOL will spike, correctly identifying the failure.
  • Sensitivity to the Whole Sequence: By using the entire "cloud" of hidden states rather than just the final token, SOL detects perturbations anywhere in the text.
  • Stability is King: SOL converges much faster than MAUVE as the number of samples increases. It doesn't require the sensitive K-means clustering step that makes MAUVE difficult to reproduce reliably.
  • The Bidirectional Advantage: The authors found that using a bidirectional encoder (like the Dream model) as a backbone for SOL provides the most balanced sensitivity across all token positions, avoiding the "prefix bias" inherent in causal models.

Key Results

  • Detecting Mode Collapse: In experiments where a portion of a dataset was replaced with a single repeated sequence, SOL rose sharply while Generative Perplexity actually improved, showing that PPL can be dangerously misleading (see Figure 4 in the paper).
  • Human Correlation: SOL achieved higher Spearman rank correlation with human judgments of "human-like," "interesting," and "sensible" text than MAUVE across multiple embedding backbones.
  • Positional Sensitivity: SOL correctly identifies random token insertions at the beginning of a sequence, a failure mode that MAUVE completely misses.
Figure 3: Replacing random to- kens in the sequence beginning is not detected by MAUVE, but by SOL.
  • Benchmarking Diffusion: The authors provided a comprehensive re-evaluation of recent diffusion models (like MDLM and vMF). They found that "better" perplexity in these models often just reflects a tighter evidence lower bound (ELBO) rather than a better fit to the data distribution.

Limitations and Future Work

  • Backbone Sensitivity: While SOL is model-agnostic in its inputs, the absolute value of the score depends on the chosen reference transformer (e.g., GPT-2 vs. Dream). Scores are only comparable when using the same backbone.
  • Computational Overhead: Although the DSW calculation itself is very fast (~1s for 5000 samples), the initial step of generating hidden states for a large corpus requires a full forward pass of the reference transformer, which can be time-consuming for very large models.
  • Future Directions: The authors suggest exploring how SOL could be used as a training objective (a loss function) to directly optimize the distributional fit of generative models.

Summary updated

BibTeX
@misc{kornhardt2026sol,
  author = {Gregor Kornhardt and Moritz Piening and Jannis Chemseddine and Gabriele Steidl},
  title = {{SOL: Measuring Gaps between Text Distributions by Double Sliced Wasserstein Metrics}},
  year = {2026},
  eprint = {2610.06513},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.06513},
}
Figure