Synthetic Data › Synthetic Data Diversity
Language AI HandbookAll chapters Synthetic Data › Synthetic Data DiversityOne section · Sections in this chapter5 / 11 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
A common failure mode of synthetic data pipelines is topic collapse: the generated data looks superficially varied but is dominated by a few frequent topics. If your seed set contains many software engineering examples and few biology examples, the generated data will reflect that imbalance. Models trained on such data will be strong at programming questions and weak at biology questions, not because biology is inherently harder to teach with synthetic data, but because the pipeline never tried.
Topic collapse is particularly insidious because it is invisible to standard quality metrics. Each individual example might score highly on accuracy and helpfulness, and the aggregate dataset looks large and varied at a glance. The collapse only becomes apparent when you analyze the topic distribution quantitatively or evaluate the trained model on a diverse benchmark.
Diversity is therefore a first-class concern in synthetic data design, not an afterthought.
Measuring Diversity
Before you can improve diversity, you need to measure it. Several metrics are useful:
Embedding-based diversity measures the spread of examples in embedding space. You embed all generated examples using a sentence encoder, then compute the average pairwise cosine distance across the dataset. A high average distance indicates diverse coverage; a low distance indicates that examples cluster together, which corresponds to topic collapse. The mean pairwise distance is sensitive to outliers but provides a useful aggregate signal.
N-gram diversity measures the proportion of unique n-grams across the dataset. Self-BLEU is a standard metric: for each example, compute its BLEU score against the rest of the dataset. A low average self-BLEU score indicates low redundancy, meaning each example contains mostly novel n-grams not present in other examples. High self-BLEU indicates that examples share a lot of phrasing, which often means topic collapse or template overuse.
Topic distribution analysis uses a topic model (LDA or BERTopic) to identify the latent topics in the dataset and measure how evenly they are distributed. An ideal dataset has roughly equal coverage across topics rather than a long tail of rare topics and a few dominant ones. The entropy of the topic distribution is a useful summary statistic: maximum entropy corresponds to uniform coverage, and lower entropy corresponds to concentration in fewer topics.
Vocabulary coverage measures the unique types (distinct words) divided by total tokens across the dataset. A dataset dominated by a few topics will reuse the same technical vocabulary repeatedly, producing a lower type-token ratio than a truly diverse dataset.
To make this concrete, consider what topic collapse looks like when visualized. A biased seed set produces a training distribution heavily skewed toward a few categories, while a well-curated pipeline produces near-uniform coverage. The figure below shows the difference between a collapsed distribution and a diverse one.


Topic-Guided Generation
The most direct approach to diversity is to explicitly specify the topic during generation. Instead of letting the model choose what to write about, you provide a diverse list of topics and generate a fixed number of examples per topic. This hard allocation ensures that rare topics appear in the dataset regardless of how rarely they appear in the teacher's spontaneous outputs.
The challenge is building a sufficiently broad topic list. For general instruction-following, you can start with a broad taxonomy (science, history, math, code, creative writing, practical advice, and so on) and then expand each category into subcategories. Structured knowledge bases like Wikipedia's category tree, academic taxonomy lists from arXiv, or standard educational curriculum frameworks all provide good starting points for a coverage map.
Topic-guided generation ensures that rare topics appear in the dataset, but it requires manual work to maintain and expand the topic list as the model's capability scope evolves. A practical workflow is to start with a coarse topic list, generate an initial dataset, evaluate the model on a benchmark, identify the weakest domains, and expand the topic list with finer-grained categories in those domains for the next generation round. This feedback loop between evaluation and generation makes topic-guided generation an iterative process rather than a one-time setup.
One practical subtlety is that topics specified in the prompt are not the only determinant of what the model generates. If you specify "biology" but your template asks for a "technical question", the model will generate technical biology questions, not introductory biology questions. The combination of topic and framing in the template jointly determines the difficulty and style distribution within a topic. Varying both dimensions independently gives you a finer-grained control over the training distribution.
Persona-Based Generation
Persona-based generation is a complementary diversity strategy that varies the perspective rather than the topic. Instead of specifying the subject matter, you specify who is asking the question or what kind of responder is answering:
- A high school student struggling with algebra for the first time
- A software engineer debugging a production system under time pressure
- A non-native English speaker asking for writing feedback on a job application
- A medical professional researching drug interactions for a patient case
Different personas produce different question styles, vocabulary levels, and implicit context assumptions. A high school student's algebra question will be phrased differently from a university professor's algebra question, even if both concern the same underlying mathematical concept. The resulting dataset captures a wider range of the actual distribution of real users, which generalizes better than a dataset generated from a single implicit perspective (typically: educated, technical, native English speaker).
Persona-based generation is also useful for controlling response style. If you specify that the responder is a "patient, encouraging tutor who explains concepts from first principles", the generated responses will adopt that pedagogical style. This lets you deliberately shape the assistant persona encoded in the training data rather than accepting whatever implicit style the teacher model defaults to.
The Microsoft Persona Hub paper demonstrated that a diverse set of synthetic personas, generated from a model trained to represent a wide demographic and professional spread, produced significantly more diverse training data than generic prompt templates. The key insight is that personas encode implicit assumptions about vocabulary, domain familiarity, and communication style that naturally vary the generated content in ways that topic lists alone cannot capture.
Iterative Feedback and Self-Play
In iterative self-play, the model generates data, trains on it, and the improved model generates the next round of data. This bootstrapping process can progressively expand coverage if each round is designed to target the model's current weaknesses. The dynamic is appealing: as the model improves, the data generated in the next round can be harder and more demanding, because the improved model can produce and evaluate more sophisticated examples.
The Reinforcement Learning from AI Feedback (RLAIF) paradigm extends this idea by adding an explicit evaluation loop: an AI judge evaluates the model's outputs, provides feedback, and the model learns from that feedback through reinforcement learning. This creates a self-improvement loop that can operate at scale without human annotators. Constitutional AI, developed by Anthropic, is one example of this approach: a model trained to follow a set of principles uses those principles to critique and revise its own outputs, generating training data for further refinement.
The risk of iterative self-play is mode collapse: the model converges to a narrow set of high-reward outputs and loses diversity over successive rounds. A model might discover that verbose, well-structured responses always score highly regardless of content, and begin producing exclusively that style. Mitigation requires explicit diversity constraints in the generation process, such as requiring each batch to cover a minimum number of distinct topics, or using a reward model that explicitly penalizes stylistic uniformity alongside correctness.
A more subtle failure mode is capability stagnation: if the model can only generate data at its current capability level, iterative self-play may not push it beyond that ceiling. Each round produces data similar to the previous round, and the model plateaus. The most effective mitigation is to inject harder problems from external sources (benchmark datasets, human-designed challenges) into each round alongside the self-generated data, making sure that the training distribution always includes examples at and slightly above the model's current frontier.
Deduplication and Near-Duplicate Removal
Even with diversity controls in place, synthetic generation tends to produce near-duplicates. If the same seed appears multiple times in the generation queue, or if the model produces two responses to different seeds that happen to cover the same ground with slightly different wording, these near-duplicates add bulk without adding coverage.
As we discussed in the MinHash chapter, locality-sensitive hashing efficiently identifies near-duplicates across large datasets. Applying MinHash deduplication to the synthetic data after generation removes redundant examples and keeps the most diverse subset. The choice of Jaccard similarity threshold matters here: a very high threshold (0.95) only removes near-identical examples, while a lower threshold (0.7) removes paraphrases that cover the same ground. For instruction-following datasets, a threshold of 0.7-0.8 on the instruction text (ignoring the response) is typically appropriate.
An alternative to MinHash for small-to-medium datasets is embedding-based deduplication: embed all examples, then use a greedy selection algorithm to pick the largest subset where every pair has cosine similarity below a threshold. This approach is more semantically sensitive than MinHash but scales poorly to very large datasets. For datasets above 100,000 examples, MinHash or similar approximate methods are more practical.