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

A Penalty Goes a Long Way: Measuring Lexical Diversity in Synthetic Texts Under Prompt-Influenced Length Variations

Vijeta Deshpande, Ishita Dasgupta, Uttaran Bhattacharya, Somdeb Sarkhel, Saayan Mitra, Anna RumshiskyarXiv 2025 · DOI

Abstract: As Large Language Models (LLMs) are increasingly used to generate synthetic datasets, measuring the lexical diversity of their outputs has become critical to preventing model collapse. However, standard metrics like Type-Token Ratio (TTR) and Compression Ratio (CR) suffer from a fundamental length bias rooted in Herdan-Heap’s Law: shorter texts naturally appear more diverse. This paper introduces Penalty-Adjusted Type-Token Ratio (PATTR), a metric that incorporates a task-specific target length penalty to provide a more robust, length-agnostic measure of diversity. Through an extensive study of 120,000 video scripts across 11 LLMs, the authors demonstrate that PATTR effectively mitigates length bias and identifies high-quality, "natural" responses that traditional metrics overlook.

1. Introduction

The quality of synthetic data is often judged by its diversity. In the context of LLMs, "lexical diversity"—the variety of unique words used—is a primary indicator of creative richness. If synthetic training data is repetitive or overly constrained, the resulting models risk "model collapse," where they lose the ability to generate novel or varied content. Despite its importance, accurately measuring lexical diversity remains a challenge due to the inherent mathematical relationship between text length and word variety.

2. The Length Bias Problem

The most common metric for lexical diversity is the Type-Token Ratio (TTR), calculated as the number of unique words (types) divided by the total number of words (tokens). However, Herdan-Heap’s Law states that the rate of new word introduction decreases as a text grows longer. Consequently, a short, simple sentence will almost always yield a higher TTR than a long, nuanced essay.

In modern prompt engineering, this bias is particularly problematic. Adding formatting instructions or stylistic constraints can significantly alter the length of an LLM's response. Standard metrics like TTR or Compression Ratio (CR) often "reward" models for being brief, mistakenly labeling short, repetitive outputs as more diverse than longer, more complex ones.

3. PATTR: A Length-Agnostic Metric

To address these shortcomings, the authors propose the Penalty-Adjusted Type-Token Ratio (PATTR). The key innovation is the introduction of a task-specific target length ($L_T$). PATTR modifies the traditional TTR denominator by adding a penalty term based on the absolute deviation of the actual length ($|w|$) from the target length:

$$PATTR(w, L_T) = \frac{|\text{set}(w)|}{|w| + |||w| - L_T||_1}$$

This bi-directional penalty ensures that responses that are either too short or too long relative to the task requirements are penalized. By adjusting $L_T$, researchers can tune the metric to be neutral toward length, allowing for a fair comparison of diversity across varying response sizes.

4. Experimental Setup and Dataset

The researchers evaluated PATTR using a massive synthetic corpus of over 20 million words. The task chosen was creative video script generation, which requires high abstractive diversity. They utilized 11 instruct-tuned models from the LLaMA 3.1/3.2, OLMo-2, and Phi-3 families.

To test the robustness of diversity metrics, the authors systematically perturbed the prompts across four dimensions: task descriptions, formatting instructions (varying from 0 to 9 specific constraints), stylistic features (audience, mood, video type), and 120 unique user topics.

The data generation pipeline, showing how system prompts and user inputs are varied to produce a large-scale synthetic corpus of video scripts.

5. Results and Discussion

The study revealed that prompt engineering is a significant driver of response length. As more formatting instructions are added, models tend to produce shorter, more constrained outputs. Traditional metrics like CR and TTR closely track these length changes, showing a high bias toward shorter responses.

Comparison of metrics across varying numbers of instructions. Traditional metrics (CR, TTR) are heavily influenced by the resulting changes in response length, whereas PATTR provides a more stable measure of diversity relative to the target length.

Key findings include:

  • Mitigating Bias: In tests measuring how often a metric favors the shortest text, CR showed a bias of up to 67%. PATTR reduced this bias to nearly 0% when tuned to the appropriate target length.
  • Identifying Natural Diversity: PATTR identified "natural" responses (those with zero extra formatting instructions) as the most diverse. Traditional metrics failed to capture this, instead favoring the most constrained outputs.
  • Structural Richness: Despite being a lexical metric, PATTR scores correlated strongly with Part-of-Speech (POS) diversity, suggesting it captures deeper structural variety better than its predecessors.

6. Conclusion

PATTR offers a significant advancement in the evaluation of synthetic text. By decoupling diversity from length, it allows for more accurate curation of high-quality datasets for model training. While the requirement of a pre-defined target length ($L_T$) is a limitation for open-ended tasks, PATTR provides a robust framework for structured generation tasks where quality and compliance are both paramount.

Summary updated

BibTeX
@misc{deshpande2025penalty,
  author = {Vijeta Deshpande and Ishita Dasgupta and Uttaran Bhattacharya and Somdeb Sarkhel and Saayan Mitra and Anna Rumshisky},
  title = {{A Penalty Goes a Long Way: Measuring Lexical Diversity in Synthetic Texts Under Prompt-Influenced Length Variations}},
  year = {2025},
  eprint = {2507.15092},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.15092},
}
Figure