For a set of model completions
For each metric
and compute their Wasserstein-1 distance
To interpret
The observed distance is located within
Metrics are organised into groups (see Stylometric Metrics). Each group captures a distinct linguistic object (word length, vocabulary richness, etc.) and the metrics within it represent different ways of characterising that same object. Because they study the same underlying property, metrics in the same group are highly correlated; averaging within groups before aggregating across them prevents any single linguistic dimension from dominating the score simply by having more metrics defined for it.
Within each group the tail values are averaged:
The overall alignment score
This rewards consistent performance across all groups; a high score on one dimension cannot compensate for near-zero performance on another. The harmonic mean would impose an even harsher penalty on low groups, but it collapses discrimination when any group score is exactly zero, which occurs frequently in practice, making it unsuitable here.
A score of 1 would mean the completions are stylistically indistinguishable from the reference even relative to same-author variation; in practice this is unrealistic but the directionality is still informative.
The tail value
A classical hypothesis test asks whether there is sufficient evidence to reject a null hypothesis. That framing entails a binary decision and is sensitive to sample size: with enough data, even negligible stylistic differences will cross any fixed significance threshold.
VOICE is not concerned with whether two distributions are statistically indistinguishable. It asks how similar they are, on a continuous scale, relative to the natural within-author variation present in the training corpus. The calibration distribution
The uncertainty in
For each
Per-metric, group, and overall confidence intervals are all read directly from the empirical distribution of the corresponding jackknife replicates.
For an individual metric
For a group
and percentile intervals are read from
For the overall score, the replicate scores are the geometric mean of the per-group replicate averages:
and percentile intervals are read from
Suppose a model achieves an alignment score of 0.2. A natural reading is:
On average, across stylometric groups, the model's completions sit at the 80th percentile of same-author self-distances, meaning the completions are stylistically closer to the author reference than 20% of within-author sample pairs drawn from the training corpus.
The API exposes intermediate results for deeper inspection:
results = make_comparison(completions, true_ds) # uncertainty=True by default
# Per-metric tail values
results.metric_tails # dict[str, float]
# Per-group average tail values
results.group_tails # dict[MetricGroup, float]
# Overall score
results.score # float
# Jackknife percentile confidence intervals (default 90%)
results.metric_tail_cis() # dict[str, tuple[float, float]] | None
results.group_tail_cis() # dict[MetricGroup, tuple[float, float]] | None
results.score_ci() # tuple[float, float] | NonePer-metric tails are useful for identifying which stylometric dimensions are misaligned; per-group tails aggregate correlated metrics and correspond directly to the terms in the geometric mean.
The confidence interval methods accept a confidence keyword (default 0.90, see UNCERTAINTY_DEFAULTS). Passing uncertainty=False to make_comparison skips the jackknife pass, in which case the interval methods return None.