Two training sets can match in size and quality, yet one teaches a model far more. Measure their diversity in a small model's gradients, not in their words, and you can tell which: across 300 training runs the ranks agree at a correlation near 0.9. Then generate data where the gradients are thin. Accuracy climbs to 70.45% at 100,000 examples, where plain generation stalls near 60%.
Pick a yardstick and let it judge two math datasets of the same size. Then train on both and see who was right. Switch to Grow and add data three ways. Then we build it all from zero: per-example gradients, random projection, the Vendi score, the fair test, and the synthesis loop.
You need what a gradient is (the direction that lowers a model's loss on one example) and what fine-tuning is (training a pretrained model further on your own data). We build the rest.
Pick a yardstick. It scores both datasets and bets on the one it calls more diverse. Then press Train both.
Judge: DiverseReason and DiversePersona, diversity scores and out-of-distribution accuracy (mean of 5 runs) from Table 2. The run cloud is simulated: 100 dots drawn so their rank correlation matches Table 1 (math, 100k scale: Embedding Vendi 0.754, G-Vendi 0.899). The dot clouds inside the cards are drawings, not real data.
Chapter 0
Watch synthetic data hit a ceiling, and find the question that the rest of the paper answers
Say you want a small model that is good at math. You have no budget for human annotators. But you do have a large model that can write new math problems and solve them. So you show it five example problems and ask for a new one. Then you do that a hundred thousand times.
This is synthetic data: training data written by a model, not by people. It is cheap, it never runs out, and most open reasoning models today are trained on it. You would expect that more of it gives a better model. Up to a point, it does.
Drag the slider from 1,000 to 100,000 examples. Each curve is a 7B math model fine-tuned on that many synthetic examples and tested on 7 hard benchmarks. Watch how much each tenfold step buys.
Vanilla few-shot and persona-guided curves from Fig. 1 (right): Qwen2.5-7B-Math fine-tuned on 5 subsets per size, average pass@1 over the 7 benchmarks of Table 4. The paper prints no numbers for these two curves; we read them off the plot, so treat them as about ±0.5 points. The x axis is spaced by step, as in the figure, not by value.
Look at the vanilla curve between 10,000 and 100,000 examples. Ten times the data buys about two points. The paper calls this early saturation. The generator keeps writing new problems, but the model stops learning from them.
Why? A natural guess is that the new problems are not really new. A model asked a hundred thousand times for "a problem like these five" drifts back to the same kinds of problems. The data grows, but its diversity does not.
The persona curve tries a known fix. Before each request, it adds a random person to the prompt: "a chef", "a pilot", "a retired chemistry teacher". The problems now come in many costumes. That helps at 1,000 examples. By 100,000 it ends up close to vanilla.
So "make the data more diverse" is good advice that nobody can follow. Diverse in what sense? In words? In topics? In the steps of the solution? Each answer gives a different number, and the numbers disagree. This paper asks two questions:
The answer to the first question is a score called G-Vendi. The answer to the second is a loop called Prismatic Synthesis. A prism splits one beam of light into many colours; the loop splits one seed dataset into many kinds of problem. Here is the road.
Chapter 1
Meet five common diversity yardsticks, then compare a problem's nearest neighbour in meaning with its nearest neighbour in gradients
Before we can fix diversity, we need a number for it. People already use several. Each one looks at a dataset through a different lens. Here are the five the paper tests against.
| Yardstick | What it looks at | High when |
|---|---|---|
| 2-gram entropy | Pairs of neighbouring words | Many different word pairs appear, each about equally often |
| Embedding dissimilarity | An embedding model's vector for each sample | The average 1 minus cosine similarity over all pairs is large |
| Embedding Vendi | The same vectors, scored by the Vendi score (Chapter 5) | The vectors point in many independent directions |
| Average perplexity | How surprised a small model is by each sample | The samples are unusual for the model |
| Skill-set entropy | An LLM's list of math skills used by each problem | Many skills appear, each about equally often |
An embedding is a vector that a model assigns to a piece of text, so that texts with similar meaning get nearby vectors. The paper uses gte-Qwen-7B-Instruct, a strong embedding model with 7 billion parameters. The skill lists come from a taxonomy that GPT-4 extracted from MATH and GSM8k; Qwen2.5-72B-Instruct tags each problem with it.
The first four look at the surface: the words, or what the text is about. The fifth tries to look at the reasoning, but it needs a big model to label every sample, and it only exists for math. Is there a cheap lens that sees the reasoning? Compare two ways of finding a problem's nearest neighbour.
Pick one of the paper's three examples. Then switch the space. Purple marks words the two problems share. Teal marks steps of the solution they share.
Problems and the two neighbours are the paper's Examples 1 to 3 (App. F.1), found in its math data pool. The step outlines under each problem are our summary of the solution, not the paper's text. The map above is a drawing that places the three problems by the chosen similarity; distances are illustrative.
In embedding space the Pokémon problem's neighbour is another Pokémon problem. Same theme, same keywords. But it is solved differently: doubling, halving, then a division among four siblings.
In gradient space the neighbour is about lemons. The words share almost nothing. The solution is the same chain: start from a given count, add, multiply, then total everyone. The coins example is even clearer. Its gradient neighbour is about stocks and bonds, and both are solved by one linear equation in one unknown.
The paper states its finding carefully. The gradient neighbour "often does not exhibit strong semantic relevance" to the original, "but often shares a very similar solution strategy". These three examples were picked to be easy to read. The paper says many gradient clusters are hard to interpret.
Still, the pattern suggests the lens we want. The next chapter explains why a gradient should see the solution strategy at all.
Chapter 2
Take one training step on one example, and predict how much it helps another from the dot product of their gradients
Every training example pulls on the model's weights. The loss on an example measures how wrong the model is on it. The gradient of that loss is a vector with one number per weight. It points in the direction that would make the loss on this example go up fastest. Training moves the weights a small step the other way.
Now take two examples: z, which we train on, and z′, which we only test on. When we take a step on z, what happens to the loss on z′? If their gradients point the same way, the step that helps z also helps z′. If they point in opposite directions, it hurts z′.
The left panel is a tiny classifier with two weights, and seven labelled examples A to G. The right panel shows each example's gradient as an arrow in weight space. Pick a training example and a test example, then take one step. Compare the predicted change in test loss with the real one.
A real computation: logistic regression p = σ(w·x + b) with cross-entropy loss, two weights (w, b), seven made-up examples. "Predicted" is the first-order formula below; "actual" is the loss recomputed after the step.
Write the step as a formula. One step of gradient descent with step size η on example z changes the weights by minus η times z's gradient. A first-order Taylor expansion then gives the change in loss on z′:
Where does it come from? The new weights are θ′ = θ − η∇ℓ(z). For a small step, the loss on z′ changes by its gradient times the weight change: ∇ℓ(z′) · (θ′ − θ) = −η ∇ℓ(z′) · ∇ℓ(z). Flip the sign to get the drop. That is the whole derivation.
Worked number: ∇ℓ(z) = (0.30, −0.20), ∇ℓ(z′) = (0.25, −0.10), η = 0.5 → predicted drop = 0.5 × (0.075 + 0.020) = 0.0475
This formula is old. It is the core of TracIn (Pruthi and colleagues, 2020), a method to trace which training examples influenced a prediction. Prismatic Synthesis starts from it.
Now the key step of the argument. Suppose we do not know what the test problems will be. The paper assumes every kind of test problem is equally likely. Then the best training set is one whose gradients point in as many different directions as possible, so that some training example helps whatever test example arrives. Diversity of gradients is a stand-in for coverage of the unknown test set.
That is a hypothesis, not a theorem. The paper tests it with experiments, which we reach in Chapter 7. First we need to compute these gradients for a real language model.
Chapter 3
Follow a math problem through a small frozen model, from text to a loss to a gradient of half a billion numbers, and see the shape at each step
To measure a dataset in gradient space, we need one gradient per example. Which model's gradient? Not the student we will train: it does not exist yet. The paper uses a proxy model, a small model that stands in for any student. It is Qwen2.5-0.5B-Instruct, used as it is, with no extra training.
That choice is the paper's main practical shortcut. Earlier gradient methods first train the model on the target data, or combine gradients from several checkpoints. G-Vendi does none of that. The paper argues this is fine because it only compares training examples with each other, not with a target set.
Press Next step. Each box is the data at that point, with its shape. Blue is data, teal is a gradient. The bar under the boxes is the memory one example needs at that point, on a log scale.
From Sec. 2.1: proxy Qwen2.5-0.5B-Instruct, the normalized gradient of −log P(y | x), projection to d = 1024, G of shape |D| × d. The token counts (60 and 240) are illustrative. The memory sizes are our arithmetic: 0.5 billion weights at 2 bytes, 1,024 numbers at 4 bytes; the paper does not give them.
Follow the steps. A sample is a pair (x, y): x is the input, here the problem, and y is the output, here the full solution. The proxy reads x and then scores every token of y, one at a time. The loss is minus the log of the probability it gave to the whole solution:
Why only the direction? Our reading: a long solution adds up many token losses, so its raw gradient is long. Without normalizing, long samples would dominate every comparison. After normalizing, the dot product of two gradients is their cosine similarity, which is exactly the "do they point the same way" question from Chapter 2.
Now count. The proxy has about half a billion weights. Stored in 16-bit floats, one gradient takes about 1 GB. The paper's data pool has 1.5 million samples per task. Storing all their gradients would take about 1.5 million GB. Comparing every pair would be worse.
So the gradient cannot be kept as it is. It must shrink by a factor of about half a million, without losing the one thing we need: the angles between gradients. The next chapter shows a trick that does this with nothing but coin flips.
Chapter 4
Shrink each gradient from half a billion numbers to 1,024 with random plus and minus signs, and check that the angles survive
Here is the trick. Make a big table of random signs, +1 or −1, like coin flips. It has one row per weight of the proxy and d columns. To shrink a gradient, multiply it by the table. Each of the d outputs is a sum of all the gradient's entries, each with its own random sign.
That sounds like it should scramble everything. It does scramble each vector. But it scrambles every vector with the same table, and that keeps the angles between them. Try it.
There are 24 unit vectors with 2,000 entries each, in four loose groups. Each dot is one pair: its true cosine across, its cosine after projection up. Dots on the diagonal mean the angle survived. Lower d and watch the cloud spread.
A real computation in your browser: 24 vectors in 2,000 dimensions (a stand-in for half a billion), a fresh ±1 matrix scaled by 1/√d, all 276 pairs. The paper projects to d = 1024.
In symbols, with Π the table of signs:
Why do angles survive? Take two gradients g and h. Their projected dot product is a sum over the d columns. In each column, every pair of entries gihj is multiplied by two random signs. When i = j the two signs are the same sign, so their product is always +1. When i ≠ j the product is +1 or −1 at random, and those terms cancel on average.
So on average each column gives exactly g · h, and the d columns together give d times g · h. Divide by d and you get the true dot product, plus noise. The noise shrinks like one over the square root of d. That is the Johnson-Lindenstrauss lemma in its simplest form.
Worked number: two unrelated unit gradients (true cosine 0), d = 1024 → typical error ≈ 1 / √1024 = 0.031 · d = 64 → 0.125
The surprise is what d does not depend on. It does not depend on the half billion. The error is the same whether the gradient had two thousand entries or five hundred million. Only d matters.
One practical point, from us, not the paper. The full table would have half a billion times 1,024 entries, far too many to store. Real systems regenerate the signs on the fly from a fixed random seed, block by block, as they read the gradient. The result is the same table every time.
After this step every sample is a row of 1,024 numbers. Stack the rows of the dataset D and you get a matrix G of shape |D| × 1024. For 1.5 million samples that is about 6 GB in 32-bit floats: large, but it fits on one machine. Now we need one number that says how diverse those rows are.
Chapter 5
Turn a matrix of gradients into one number, the effective count of different examples, using the eigenvalues of their similarity matrix
Imagine a choir of 40 singers. If all 40 sing the same note, you hear one voice, only louder. If they split into four parts, you hear four. If one part has 30 singers and the others have 3 each, you hear mostly one part, with a little colour. We want a number that says "about 1", "4" and "a bit more than 1" for these three choirs.
The Vendi score (Friedman and Dieng, 2023) is that number. It counts the effective number of different items in a set. Given vectors of length 1, it works in three steps.
Work it by hand with three samples. If all three gradients are the same, every entry of K is 1/3. The eigenvalues are 1, 0, 0. The entropy is 0, and exp(0) = 1: one effective sample. If the three are at right angles, K is the identity divided by 3. The eigenvalues are 1/3 each, the entropy is log 3, and the score is 3.
Two the same, one different: eigenvalues 2/3 and 1/3 → entropy = −(⅔ log ⅔ + ⅓ log ⅓) = 0.637 → Vendi = e0.637 = 1.89
So a duplicate does not count as a new sample, and a lopsided set counts for less than its size. Now build the choirs.
There are 48 samples in 12 dimensions, split into groups that point in different directions. Change the number of groups, how tightly each group holds together, and whether one group holds most of the samples. The bars are the 12 eigenvalues of K; the big number is the Vendi score.
A real computation: 48 random unit vectors, K's eigenvalues found from the 12 × 12 matrix GᵀG / 48 (the trick below), entropy in natural log. With 12 dimensions the score can never pass 12, just as G-Vendi can never pass 1,024.
Why eigenvalues and not just the average distance between pairs? An average misses structure. Forty points split into two tight groups far apart can have a large average distance, yet they are two kinds, not forty. The eigenvalues see the groups. The Vendi paper also notes that the score stays sensible when features are correlated with each other.
There is one more trick, and it makes G-Vendi cheap. K is |D| × |D|: for 100,000 samples, ten billion entries. But GGT and GTG share their non-zero eigenvalues, and GTG is only 1,024 × 1,024. Building it costs about d² × |D| multiply-adds. For 100,000 samples that is about 1011, seconds on a GPU. The eigenvalues of a 1,024 × 1,024 matrix then take a moment.
Compare the average pairwise similarity, a common alternative. It needs every pair: |D|² × d, about 1013 for the same set, a hundred times more. The gap grows with the dataset.
Chapter 6
Build hundreds of datasets that differ only in diversity, train a model on each, and score the models against a reference
We now have a yardstick. How do we know it is a good one? The paper states the test plainly. Take two datasets of the same size and quality. Train the same base model on each. A good diversity measure f should rank the datasets in the same order as the models' scores on unseen benchmarks:
The hard part is "same quality". Real datasets differ in many ways at once: who wrote them, how they were checked, how hard they are. So the paper builds every dataset from one pool. Qwen2.5-72B-Instruct writes 1.5 million samples per task, each from five random seed examples. For math the seeds come from GSM8k and MATH; for NLI they come from WANLI. Every sample passes through the same pipeline, so quality is held fixed.
NLI, natural language inference, is a classification task: given a premise and a hypothesis, decide whether the premise entails the hypothesis, contradicts it, or neither. It is the paper's second task, with a very different output from math.
From each pool the paper draws subsets of fixed size: 100k, 50k and 10k for math, 50k and 10k for NLI. There are 300 subsets in all. But random draws from one pool all have about the same diversity, the way random samples from one population have about the same mean. So the paper uses four ways to draw.
The pool has 640 samples in 16 groups of very different sizes. Pick a strategy and press Draw to take 80 samples. The Vendi score of each draw lands as a tick on the axis below. Draw several times with each strategy and compare the ranges.
Strategies follow App. A.1 and Algorithms 1 and 2: higher diversity picks a random cluster and draws ⌈N/k⌉ from it until full; lower diversity starts from a few seeds and adds batches of samples whose cosine to some member passes a threshold; mixture combines two subsets. The pool is a toy in 12 dimensions; the paper's pools hold 1.5 million samples, and it ran these strategies on both gradient and embedding vectors so that no measure is favoured.
Random draws cluster in a narrow band. Cluster-balanced draws reach higher, because they take as many samples from a small group as from a big one. Similarity growth reaches lower, because it keeps adding near-copies of what it already has. Mixtures fill the middle. Together they spread the 300 subsets across a wide range.
Next, the models. For math the paper fine-tunes Llama-3.2-1B; for NLI, DeBERTa-v3-large. Both are small, so one training run needs one H100 GPU, and up to eight H100 nodes run many in parallel. Then each model takes seven benchmarks that the seed data did not come from. For math: SAT-Math, three MMLU math sections, GSM-IC, AQuA-RAT and Minerva-Math. For NLI: HANS, WNLI, ANLI, QNLI, NLI Diagnostics, BigBench NLI and ConTRoL.
These are out-of-distribution (OOD) tests: problems unlike the training data. How to average seven benchmarks of very different difficulty? Three points on an easy arithmetic test are not three points on an olympiad test. So the paper divides each score by a reference model's score first:
Worked number: easy benchmark 60% vs reference 80% → 0.75 · hard benchmark 6% vs 12% → 0.50 → Perf = (0.75 + 0.50) / 2 = 0.625, shown as 62.5%
On the hard benchmark the model lost 6 points and that cost it half its relative score. On the easy one it lost 20 points and that cost a quarter. That is the intended effect. The paper keeps only math benchmarks where the reference model scores above 10%, so the division is never by a tiny number.
Chapter 7
Put every yardstick against the same training runs, and see which one ranks the trained models best
This is the hero's run cloud, opened up. Each training run is one subset, one fine-tuned model and one OOD score. For each yardstick we score every subset, then ask how well the score ranks the models. The paper reports two numbers per yardstick.
Spearman's ρ (rho) compares ranks only. Sort the subsets by diversity score, then by OOD score, and correlate the two orderings. ρ = 1 means the orders match exactly and 0 means no relation. A negative ρ means the order is reversed. R² is how much of the spread in OOD score a fitted trend line explains. The paper fits both a straight line and a log curve and reports the better R².
Pick a yardstick and a task. The dots re-sort along the x axis by that yardstick's score. The bars on the right rank all six yardsticks by Spearman's ρ. Press Draw two runs to test Equation 4 on a random pair.
ρ and R² for every yardstick and task are from Table 1 (100k scale; for NLI the largest size is 50k). The 100 dots per view are simulated so that their rank correlation matches the table; they are not the paper's runs. "Pairs ordered correctly" is computed on these simulated dots. Skill-set entropy exists only for math.
Read the bars for Math OOD. G-Vendi reaches ρ = 0.899 and R² = 0.823. The next best is skill-set entropy at 0.812, which needs GPT-4's taxonomy and a 72B model to tag every problem. Embedding Vendi, with a 7B embedding model 14 times larger than the proxy, reaches 0.754. 2-gram entropy reaches 0.736.
NLI tells the same story: G-Vendi 0.893, Embedding Vendi 0.841. Perplexity is the odd one out. It correlates negatively on math (−0.631) and positively on NLI (0.597). A yardstick whose sign flips between tasks is not measuring the same thing in both.
| Yardstick | Math OOD ρ | NLI OOD ρ | Math ID ρ |
|---|---|---|---|
| Embedding Vendi | 0.754 | 0.841 | 0.614 |
| Embedding DisSim | 0.751 | 0.806 | 0.574 |
| 2-gram entropy | 0.736 | 0.664 | 0.548 |
| Average perplexity | −0.631 | 0.597 | −0.341 |
| Skill-set entropy | 0.812 | not run | 0.695 |
| G-Vendi | 0.899 | 0.893 | 0.780 |
The fit is close to a log curve: each doubling of G-Vendi adds a roughly fixed number of points. It holds within each data size, too. For math, ρ is 0.918 at 10k, 0.898 at 50k and 0.899 at 100k; for NLI, 0.913 at 10k and 0.893 at 50k.
Now size against diversity. Larger datasets do better on average. But the paper reports that a 10k subset with high diversity often beats a 100k subset with low diversity, drawn from the same pool. Ten times less data, better OOD score. That is the paper's strongest claim about diversity and scale.
In-distribution tells a different story. On the test sets of MATH and GSM8k, the same kind as the seed data, G-Vendi still correlates (ρ = 0.780 at 100k) but less strongly. There, size dominates: a diverse 10k subset rarely beats a 50k one. Very low diversity still hurts, for example a G-Vendi below about 40 at 100k samples. The paper's reading: scale fills in the familiar kinds of problem; diversity reaches the unfamiliar ones.
Chapter 8
Build two datasets that differ on purpose, see which one each yardstick prefers, and check that the result holds for other proxies and other students
G-Vendi ranks the runs better. But why? Maybe it just measures the same thing as Embedding Vendi, with less noise. To find out, the paper builds two datasets that should split the two yardsticks apart. These are the two datasets in the hero.
Both use persona-guided generation with Qwen2.5-72B-Instruct, and both have 100,000 problems. DiverseReason comes from 10,000 seed problems and only 100 personas: many kinds of reasoning, a narrow cast of characters. DiversePersona comes from only 100 seed problems and 10,000 personas: few kinds of reasoning, dressed in many costumes. The paper draws subsets of 10k and 50k from each, five times.
Two datasets: which one does each yardstick call more diverse, and which one trains the better model? Proxy model: does G-Vendi change if a different small model computes the gradients? Student model: does the ranking hold for students of other sizes?
The two yardsticks disagree, and the training runs settle it. Embedding Vendi gives DiversePersona the higher score: 24.49 against 22.03 at 10k. G-Vendi gives DiverseReason the higher score: 63.22 against 51.94. The model trained on DiverseReason reaches 54.77% relative OOD accuracy; the one trained on DiversePersona reaches 38.15%. G-Vendi bet right.
At 50k the gap holds: 63.48% against 42.14%, with G-Vendi 103.63 against 87.86. Embedding Vendi now calls the two nearly equal, 30.79 against 31.16, still leaning toward DiversePersona. So personas add variety to the words and topics, which embeddings notice. They add little variety to the reasoning, which is what the model must learn.
The proxy test asks whether G-Vendi is an accident of Qwen2.5-0.5B-Instruct. On 10k math subsets, the paper swaps in two other proxies. Llama-3.2-1B-Instruct ranks the subsets almost the same way (ρ = 0.899 with the original scores) and predicts OOD slightly better (0.909 against 0.898). The paper suggests why: the student, Llama-3.2-1B, comes from the same base model.
The third proxy is Qwen2.5-0.5B without instruction tuning. It agrees less with the original (0.811) and predicts OOD worse (0.772). So an instruction-tuned proxy helps. Our reading: an instruction-tuned model already "speaks" problem and solution, so its gradients reflect solving rather than raw text statistics.
The student test runs the other way. The paper takes five random 10k math subsets and trains three different students on each: Llama-3.1-8B, Qwen2.5-7B and Qwen2.5-0.5B. For all three, higher G-Vendi gives higher OOD accuracy. For Llama-3.1-8B, the spread between the least and most diverse subset is 25.4 points, with the same data size.
Chapter 9
Run the loop that grows a dataset where its gradients are thin: cluster, generate, keep only the samples that land in sparse clusters, repeat
If G-Vendi predicts generalization, the next move is obvious: raise it on purpose. But G-Vendi is a score for a whole set. To grow a set, we need a rule for each new sample: keep it or throw it away. Prismatic Synthesis turns the score into that rule.
The idea is a crowded room. If you want more kinds of people at a party, you do not invite more friends of the biggest group. You look for the corners where few people stand, and invite people who would stand there. In gradient space, the corners are the small clusters.
Blue dots are the pool, drawn in a 2-D stand-in for gradient space. Each round the generator writes 60 new samples near random members of the pool, so it favours crowded areas. Two pools grow side by side from the same seed. The Prismatic pool keeps only samples that land in the smaller half of its clusters; the other keeps the same number of samples, unfiltered. Run rounds and compare the two diversity lines.
A toy that follows the loop of Sec. 3: k-means on the pool, generation by perturbing random pool members, keep a candidate only if its nearest cluster is among the smallest half (Sec. 3.1). The toy uses k = 8% of the pool so that clusters are visible; the paper uses 1%. "Diversity" here is the effective number of occupied cells, a simple stand-in for G-Vendi; both lines use the same generator and the same number of kept samples per round.
Here is one round of the real loop, with the paper's settings for math.
The paper describes the quality filter and the diversity filter separately and does not state their order inside a round. We show the quality filter first, because the diversity filter needs a solution to compute a gradient on.
For NLI the loop is the same, with one generation step: Qwen2.5-72B-Instruct writes the premise, the hypothesis and the label together, from 5 examples. The seed is WANLI, 103,000 samples. The check is 2 labels out of 2 in agreement.
Two more filters run at the end. Decontamination removes any generated problem that matches a test benchmark: first by exact 10-gram overlap, then by asking Qwen2.5-72B-Instruct whether the closest test problem is a paraphrase. What is left is 1.0 million problem-solution pairs (Nemotron-PrismMath) and 515,000 NLI samples (PrismNLI).
One detail worth noticing. Section 3 describes the rule with an example threshold, "the top 20% of clusters with the smallest number of members". The datasets themselves use the smallest half. The paper does not report an ablation over this threshold.
Chapter 10
Grow the data three ways, then compare the models trained on Prismatic data with models trained on data from a much larger generator
First the direct test, which is also the causal one. Generate math data three ways, train the same student on 1k to 100k examples of each, and test on the same 7 hard benchmarks. Only the way of choosing new samples differs. This is the hero's Grow mode.
Grow: the three curves of Fig. 1. Math: PrismMath-7B against five 7B models, one benchmark at a time. NLI: a DeBERTa model trained on PrismNLI against the same model trained on human-built datasets.
Growth. Prismatic Synthesis climbs from 48.21% at 1k to 55.07, 61.72, 64.45 and 70.45% at 100k. The two baselines flatten near 60 to 62% from about 50k on. At 1k, persona prompts are ahead; Prismatic passes them between 5k and 10k. At 100k the gap is about 9 points over personas and 10 over vanilla, and the curve has not flattened.
Math models. PrismMath-7B fine-tunes Qwen2.5-Math-7B-Instruct on the 1.0M Prismatic samples, with supervised fine-tuning only. It averages 75.25% over 7 benchmarks. R1-Distill-Qwen-7B averages 72.80% and OpenThinker2-7B 72.36%. Those two learned from solutions written by DeepSeek-R1, a 671B model, and checked against ground-truth answers. PrismMath's solutions come from a 32B model and are checked only by majority vote.
Read the claim with care. Against R1-Distill-Qwen-7B, PrismMath wins 6 of 7 benchmarks; it loses MATH500 by 0.2 points. Against all five baselines, it is best on 4 of 7: AIME24 (57.08), AIME25 (38.33), AMC23 (93.75) and MATH2 (80.95). OpenThinker2 is ahead on OlympiadBench (69.63 vs 68.30), and OpenR1-Qwen-7B on GSM8K-Platinum (96.69 vs 95.95). The introduction's "state-of-the-art on 6 out of 7" holds against R1-Distill alone.
NLI. DeBERTa-v3-large trained on PrismNLI (515k samples, fully synthetic) averages 74.28% over 8 OOD benchmarks. The best human-built mixture, WANLI plus MNLI plus SNLI (943k samples), reaches 66.18%. That is 8.1 points higher with about half the data, and PrismNLI is best on every one of the 8 benchmarks. Again the sources differ: Qwen2.5-72B for PrismNLI; human annotators and ChatGPT for the others, as the table lists them.
So which result tests the paper's idea most cleanly? The growth curves. Same student, same benchmarks, same final sizes; the way of choosing new samples is the intended difference. (The appendix describes the two baselines as other generation strategies in the same setup; it does not list their generator models separately.) The headline models show that the recipe scales to strong systems, but many things differ between them and their baselines.
Chapter 11
Lock in the cheat sheet, name the limits, run the core in code, and place the paper in the field
You can now read this paper and defend each of its choices. Why a gradient sees the solution strategy that an embedding misses. Why a random sign table can shrink half a billion numbers to 1,024. Why the Vendi score counts kinds, not samples. Why the test holds quality fixed. And why filling thin clusters keeps a dataset improving. Let's lock it in.
Diverse training data helps a model generalize, but common diversity measures look at words and topics. G-Vendi looks at gradients. A small frozen proxy, Qwen2.5-0.5B-Instruct, gives each sample a unit gradient. A random ±1 projection shrinks it to 1,024 numbers. The Vendi score, the exponentiated entropy of the eigenvalues of the samples' similarity matrix, turns the set of gradients into an effective count.
Across 300 subsets of one synthetic pool, with size and quality held fixed, G-Vendi ranks the fine-tuned models' OOD scores at ρ ≈ 0.9 for math and NLI, ahead of every surface measure. Prismatic Synthesis then grows data by clustering the pool in gradient space and keeping only new samples that land in the smallest clusters. Where plain and persona generation flatten near 60%, it keeps climbing, to 70.45% at 100k. The resulting datasets train a 7B math model and an NLI model that beat baselines built from a far larger generator or from human data, though not in matched comparisons.
| Quantity | Value | Source |
|---|---|---|
| Proxy model | Qwen2.5-0.5B-Instruct, frozen | Sec. 2.1 |
| Projection | Rademacher ±1, d = 1,024 | Eq. 2 |
| Analysis pool | 1.5M samples per task, Qwen2.5-72B-Instruct, 5-shot | Sec. 2.2 |
| Training runs | 300 subsets; math 10k / 50k / 100k, NLI 10k / 50k | Sec. 2.2 |
| Math OOD ρ | G-Vendi 0.899; skill-set 0.812; Emb. Vendi 0.754 | Table 1 |
| NLI OOD ρ | G-Vendi 0.893; Emb. Vendi 0.841 | Table 1 |
| Math ID ρ | G-Vendi 0.780 | Table 1 |
| DiverseReason vs Persona, 10k | OOD 54.77 vs 38.15; G-Vendi 63.22 vs 51.94 | Table 2 |
| Student spread, Llama-3.1-8B | 25.4 points across five 10k subsets | Fig. 3 |
| Clusters | k = 1% of pool; keep the smallest k/2 | Sec. 3.1 |
| Quality check | majority vote: 2 of 3 (math), 2 of 2 (NLI) | Sec. 3.1 |
| Growth at 100k | Prismatic 70.45%; baselines about 60 to 62% (read off the plot) | Fig. 1 |
| PrismMath-7B | 1.0M samples, avg 75.25 vs R1-Distill-7B 72.80 | Table 4 |
| PrismNLI | 515k samples, avg 74.28 vs 66.18 (943k mixture) | Table 4, 6 |
Four short functions carry the method. The first turns one sample into its 1,024-number fingerprint with the proxy. It runs as written with PyTorch and Hugging Face Transformers, but the projection does about half a billion times 1,024 multiply-adds per sample, so use a GPU. The other three are plain NumPy: the G-Vendi score with the small-matrix trick, k-means on unit vectors, and the keep-or-drop rule. The toy at the end runs in a second on a laptop.
pythonimport numpy as np, torch from transformers import AutoModelForCausalLM, AutoTokenizer PROXY, D, CHUNK = "Qwen/Qwen2.5-0.5B-Instruct", 1024, 1 << 14 dev = "cuda" if torch.cuda.is_available() else "cpu" tok = AutoTokenizer.from_pretrained(PROXY) proxy = AutoModelForCausalLM.from_pretrained(PROXY, torch_dtype=torch.float32).to(dev).eval() def fingerprint(x, y): """Eq. 1 and 2: unit gradient of -log P(y|x), projected to D random +/-1 directions.""" px = tok(x, return_tensors="pt").input_ids py = tok(y, return_tensors="pt", add_special_tokens=False).input_ids ids = torch.cat([px, py], 1).to(dev) labels = ids.clone(); labels[:, :px.shape[1]] = -100 # score only the solution's tokens proxy.zero_grad() (proxy(ids, labels=labels).loss * py.shape[1]).backward() # mean token loss x tokens = -log P(y|x) out, sq = torch.zeros(D, device=dev), 0.0 for i, p in enumerate(proxy.parameters()): # about 0.5 billion weights in all g = p.grad.reshape(-1); sq += float(g @ g) for s in range(0, g.numel(), CHUNK): # the same signs on every call: seeded per block gen = torch.Generator(dev).manual_seed(i * 1_000_003 + s // CHUNK) blk = g[s:s + CHUNK] signs = torch.randint(0, 2, (blk.numel(), D), generator=gen, device=dev) * 2.0 - 1 out += blk @ signs # Pi^T g, one block of rows at a time return (out / sq ** 0.5).cpu().numpy() # dividing by |g| = projecting the unit gradient unit = lambda X: X / np.linalg.norm(X, axis=1, keepdims=True) def g_vendi(G): """Eq. 3. Eigenvalues of G G^T/n equal those of the d x d matrix G^T G/n.""" G = unit(G) # unit rows, so the eigenvalues sum to 1 lam = np.linalg.eigvalsh(G.T @ G / len(G)) lam = lam[lam > 1e-12] return float(np.exp(-(lam * np.log(lam)).sum())) def kmeans(X, k, iters=20, seed=0): """k-means on unit vectors (nearest centre by cosine); returns centres and cluster sizes.""" C = X[np.random.default_rng(seed).choice(len(X), k, replace=False)].copy() for _ in range(iters): a = np.argmax(X @ C.T, axis=1) for j in range(k): m = X[a == j].sum(0) if m.any(): C[j] = m / np.linalg.norm(m) return C, np.bincount(a, minlength=k) def keep_sparse(pool_G, cand_G): """Sec. 3.1: k = 1% of the pool; keep a candidate if its nearest cluster is among the smallest k/2.""" k = max(2, len(pool_G) // 100) C, sizes = kmeans(pool_G, k) sparse = np.argsort(sizes)[: k // 2] return np.isin(np.argmax(cand_G @ C.T, axis=1), sparse) # toy: 8 kinds of problem in 1,024-d; the generator writes kind 0 most of the time rng = np.random.default_rng(0) kinds = unit(rng.normal(size=(8, D))) def generate(n): z = rng.choice(8, n, p=[.65] + [.05] * 7) return unit(kinds[z] + rng.normal(size=(n, D)) / 64) pool = generate(400); plain = pool.copy() for r in range(5): cand = generate(400); keep = keep_sparse(pool, cand) pool = np.vstack([pool, cand[keep]]) plain = np.vstack([plain, cand[: keep.sum()]]) # same size, no filter print(r, len(pool), round(g_vendi(pool), 1), round(g_vendi(plain), 1)) # G-Vendi of the filtered pool climbs (about 15 to 23); the unfiltered one stays near 16
The fingerprint follows Equations 1 and 2 with one shortcut. It projects the raw gradient and divides by the raw length afterwards, which gives the same result as normalizing first. Real systems, such as TRAK, use fused GPU kernels for the projection; this loop is the readable version.
This lesson belongs to a series about AI systems that keep learning after they are built: from the problem in front of them, from feedback, from their users. Prismatic Synthesis is not a deployment method. It builds a dataset offline, once. So why is it here?
Our reading: any system that keeps learning must keep choosing what to learn from next. More of the same stops helping, as Chapter 0 showed. This paper gives that choice a measurable target: look at where the model's own gradients are thin, and seek examples there. Test-time training, self-distillation and agent orchestration each answer a different question about learning on the job. This paper answers "which new experience is worth having?"
Related lessons: in test-time reinforcement learning, a model learns from unlabeled test questions. In RL via self-distillation, a model becomes its own teacher; see also on-policy distillation. AlphaEvolve and the Darwin Gödel Machine search for programs and keep the novel ones, and self-improving harnesses improve the scaffolding around a model. The series hub, Learning on the Job, and its other papers (Learning to Discover at Test Time, Introspective Training, ToolOrchestra, AgentFlow) are being added.
Now press Present or Teach and explain, out loud and from memory, why two problems with no words in common can share a gradient, and how the Vendi score counts them as one. If you can, you own this paper. Then go back to the two datasets and let G-Vendi make its bet.