arXiv:2610.06513cs.CLOct 2026

Manuscript Offprint

arXiv:2610.06513

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

Gregor Kornhardt, Moritz Piening, Jannis Chemseddine, Gabriele Steidl

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Evaluating text generation requires measuring how well the generated distribution matches the data distribution. For autoregressive models, this is done by the perplexity. Diffusion and flow-based language models can only provide a likelihood bound, whose tightness differs between model families. Sample-based substitutes such as generative perplexity with entropy do not consider the distribution fit. We propose SOL, a distance between text distributions. Each sequence is represented by the empirical measure of its hidden states under a fixed transformer and the distributions of these measures are compared by the double sliced Wasserstein distance. We prove that SOL is a metric if the transformer is injective. Experiments show that SOL detects distributional failures, recovers expected model trends, and provides stable sample-based estimates. We put forward SOL to fill the gap in the current evaluation protocol used for non-autoregressive models. As a first step we use SOL to re-evaluate a variety of models trained on OpenWebText.

1 INTRODUCTION

Large language models based on autoregressive decoding are the prevailing approach to text generation. Recently, diffusion and flow-based models, which generate the whole sequence iteratively by reversing a noising process, have become a serious alternative. Discrete diffusion models corrupt tokens by masking or uniform replacement (Austin et al., 2021; Lou et al., 2024; Sahoo et al., 2024; 2025), while continuous models embed tokens into a continuous space and define the noise process there (Li et al., 2022; Dieleman et al., 2022; Gulrajani & Hashimoto, 2023; Hu et al., 2026; Chen et al., 2026; Chemseddine et al., 2026). This raises the question of how well the generated distribution pgenp_{gen} matches the data distribution pdatap_{data}.

For autoregressive models, the standard answer is the perplexity of held-out data, which is computed from the exact likelihood pθp_{\theta}. For diffusion models, the likelihood is intractable. Instead, an upper bound of the perplexity is reported, based on an evidence lower bound (ELBO). This causes two problems. First, an ELBO is often not available. For continuous models, the bound holds only in expectation over the noise, requires the change-of-variables formula along the flow and has only been derived for selected models (Gulrajani & Hashimoto, 2023; Chen et al., 2026). Moreover, most recent models use self-conditioning, where the network receives its own previous prediction as input. This input arises along the sampling trajectory and cannot be recovered for a given data sequence. Second, even when an ELBO exists, it is not comparable across model families. Sahoo et al. (2026) observe that perplexity ranks models correctly within one family of diffusion models but not between families. The reason is that the gap between ELBO and likelihood is a property of the noise process and its parameterization, not of the model alone. For masked diffusion, the bound is tight (Sahoo et al., 2024; Shi et al., 2025), whereas for uniform diffusion it is looser and not even optimized by the training objective (Gourevitch et al., 2026). A better perplexity may thus reflect a tighter bound rather than a better model.

Since every model can be sampled, the generative perplexity (Gen. PPL) together with the token entropy has become the common substitute (Zheng et al., 2025; Franca & Tong, 2026; Hu et al.,

∗^{*}Corresponding author.

2026; Chen et al., 2026; Chemseddine et al., 2026). Here, Gen. PPL is the perplexity of the generated texts under a fixed reference model such as GPT-2 Large, and the entropy is computed from token frequencies within sequences. Since both are averaged over sequences, they do not reward variety in generated outputs, see Figure 4 for an example of mode collapse. Moreover, Gen. PPL measures agreement with the reference model and not with pdatap_{data}. Hence, it rewards imitation of the reference model instead of actual data. In short, neither quantity measures the distance between pgenp_{gen} and pdatap_{data}.

For image generation, the dominant evaluation method is FID (Heusel et al., 2017). It maps samples of both distributions into the feature space of a fixed network and compares the two feature distributions there. We therefore seek an analogous score for text distributions that

(1) requires only samples from pgenp_{gen} and pdatap_{data},

(2) is a distance, i.e., it is zero if and only if the two distributions agree,

(3) reflects both the quality of the generated texts and their coverage of pdatap_{data},

(4) has an estimator which is stable in the number of samples, and

(5) is cheap to compute.

The most popular alternative to Gen. PPL is MAUVE (Pillutla et al., 2021; 2023). It embeds each text by a single latent representation, quantizes both samples by K-means clustering, and compares the resulting histograms through a KL-divergence frontier. However, MAUVE is not a distance, its value depends on the number of samples and clusters, and its behavior depends strongly on the chosen representation. The standard last hidden state of a causal transformer is insensitive to changes near the beginning of a sequence (He et al., 2023), while mean pooling can map distinct token clouds to the same representation (Hara et al., 2026).

Instead, we represent each text by the empirical distribution of all its contextual hidden states. A text distribution therefore becomes a distribution over token clouds. Comparing these distributions naturally leads to a Wasserstein-on-Wasserstein problem. Since solving this nested transport problem directly is expensive, we use the double-sliced Wasserstein distance (Piening & Beinert, 2026b). It first projects the hidden states onto one-dimensional directions, represents the resulting measures by their quantile functions, and then slices these functions again in L2([0,1])L_{2}([0,1]). This sorting-based construction gives sliced optimal transport for language (SOL), illustrated in Figure 1.