ResearchEngineering note
Every prompt was unique. Every test answer leaked.
Our July dataset passed every check we ran: 20,700 conversations, each with a unique prompt. It held only 718 distinct answers, and every test answer was in training.

The model in SafeRide’s Android preview learned from 1,904 synthetic conversations. A month earlier we had a dataset more than ten times that size.
It was called v0.3: 20,700 conversations in English and Kiswahili for SafeRide’s on-device assistant, spread evenly across ten kinds of safety behaviour and split into a training set, a development set and two holdout sets. It passed every check we ran. Every row ID was unique, every conversation opened with a different prompt, and no development or holdout conversation opened with a prompt from the training set. On 4 July we fine-tuned Gemma 4 E2B on it.
It contained 718 distinct answers.
All 5,400 answers in its development and holdout sets appear word for word in its training set. Our checks had looked at the half of each conversation that varied. What a fine-tune learns to say comes from the other half.
This post covers how a generator produces a dataset like that, how to catch it, how we rebuilt ours, and a second time we measured the wrong half. Our public generator rebuilds v0.3 byte for byte, and the notebook linked at the end reruns every check here that works on public data.
How 20,700 prompts got 718 answers
SafeRide helps women in Kenya document harassment and find support. Its assistant has to handle ten kinds of situation: privacy, legal and medical questions, emergencies, tone, coercion, invented providers or laws, added facts, jailbreaks, and claims about what the app has and hasn’t done, which we call product truth. In early July our training data came from a template generator, a Node.js script that fills slots in sentences, with no language model involved. It is in our public repository, unchanged.
Each conversation has a system prompt, a user prompt and an answer, and the generator builds the two halves differently:
// scripts/saferide-gemma4-generate-synthetic-v03-dataset.mjs (abridged:
// list sizes written as numbers, English strings shown)
function pick(values, index, multiplier = 1) {
return values[(index * multiplier) % values.length];
}
// The prompt counts like an odometer: each slot moves on when the one
// before it wraps. (Product truth has 10 focus requests, not 8.)
const focusRequest = focusText[index % 8];
const state = appStates[Math.floor(index / 8) % 12];
const opening = openings[Math.floor(index / (8 * 12)) % 8];
const closing = closings[Math.floor(index / (8 * 12 * 8)) % 8];
const prompt = `${opening} ${focusRequest}. ${state} ${pressure} ${closing}`;
// The answer: a fixed lead sentence for the category and language, then
// parts picked with a multiplier. (Product truth has 10 guards, not 8.)
const guard = pick(focusGuards, index, 7); // 8 sentences
const next = pick(conciseNextSteps, index, 13); // 8
const reminder = pick(reminders, index, 19); // 6
const close = index % 2 === 0
? 'You choose the next step.'
: 'Keep immediate safety first.';
const answer = `${lead} ${guard} ${next} ${reminder} ${close}`;The prompt side is a mixed-radix counter: it divides the index before each lookup, so each slot reads a different digit of it. The focus request changes on every row, the app state every 8 rows, the opening every 96 and the closing every 768. A category’s 1,920 template rows are the first 1,920 positions of that counter, so no two of their prompts match, which the generator checked. They are less varied than that sounds: the closing never gets past its third value, and the pressure sentence never changes.
The answer side never divides. pick() multiplies the index by 7, 13 or 19 and takes the result modulo the list length, so each part depends only on the index modulo its own list length; a multiplier that shares no factor with that length just reorders the cycle. Outside product truth, the guard and the next step are both read modulo 8, so they move in lockstep, 8 pairs instead of 64. The reminder is read modulo 6, and the sign-off, close, modulo 2. Together they repeat every lcm(8, 6, 2) = 24 rows, which gives 24 answers per category and language. Languages rotate in a fixed pattern, English, English, Kiswahili, English, Kiswahili, so each category’s answers repeat every lcm(24, 5) = 120 rows. Product truth, with ten guard sentences, has a 120-row cycle of its own: 72 positions on English rows and 48 on Kiswahili ones. That makes 552 answers for 19,200 rows, each used 16, 32 or 48 times.
The multiplier also broke the link between question and answer. The focus requests and the guard sentences are parallel lists: the guard at position j was written for the request at position j. But the request is read at i mod 8 and the guard at 7i mod 8, and the two agree only when i is a multiple of 4 (a multiple of 5 in product truth). Only 4,704 of the 19,200 template answers, 24.5%, carry the guard written for their own request. Every request to “guarantee police will act today” gets the guard “If a deadline matters, verify it with a qualified local source.”
And because the request and the app state together fix the index modulo 96, and 24 divides 96 (in product truth they fix it modulo 120, the length of its cycle), each template answer is a fixed function of those two phrases. The same request in the same app state always got the same answer, down to its sign-off. The dataset encoded a lookup table, and an arbitrary one.
The other 1,500 rows were added for variety: a request, a reply, a follow-up and a second reply. Their first replies came from a list of three per language, so six replies opened all 1,500 conversations, and their follow-ups came from a list of four per language.
Then came the splits, by position. In each category the first 1,440 template rows went to training and the next 480 to development and the two holdouts. With a 120-row cycle, training had been through the whole answer bank twelve times before the first holdout row.
What our checks saw
| Check on v0.3 | Result |
|---|---|
| Unique row IDs | 20,700 of 20,700 |
| Unique opening prompts | 20,700 of 20,700 |
| Development and holdout opening prompts found in training | 0 of 5,100 |
| Development and holdout conversations found in training | 0 of 5,100 |
| Distinct assistant turns | 718 of 22,200 |
| Development and holdout conversations whose every answer is in training | 5,100 of 5,100 |
The first three are the checks the generator ran before it wrote the file, and they pass. The usual deduplication, a hash of each whole conversation, passes too: every conversation opens with a unique prompt, so every hash is unique. Only a check on the answers fails, and it fails completely.

The missing check is a few lines:
def answers(rows):
return [m["content"] for r in rows for m in r["messages"]
if m["role"] == "assistant"]
in_training = set(answers(splits["train"]))
for name in ("dev", "quality-holdout", "safety-holdout"):
turns = answers(splits[name])
found = sum(t in in_training for t in turns)
print(name, found, "of", len(turns), "answers already in training")dev 1800 of 1800 answers already in training
quality-holdout 1800 of 1800 answers already in training
safety-holdout 1800 of 1800 answers already in trainingEven the prompt check passed only because it looked for exact copies. Every template holdout prompt shares its request and app state with 6 to 12 training prompts in the same language, and differs from them only in its opening and closing phrases; 3,456 of the 4,800 use a closing phrase that never appears in training. The median holdout prompt has a word overlap (Jaccard) of 0.76 with its nearest training prompt.
The share caps we later set for v0.5 notice v0.3, but not by much. In its training split the most common six-word opening starts 5.1% of answers, against a cap of 5%; it is one category’s English lead sentence, used 864 times. The most common response shape covers 5.7%, against a cap of 3%. A template that spreads its answers evenly never lets one of them dominate. The floor on distinct answers is what fails: 718 in 16,800 assistant turns, 4.3% against a floor of 98%.
The dataset before it shows that a count of distinct answers is not enough either. v0.2, which we had fine-tuned on a few days earlier, has 9,600 conversations and 9,390 distinct answers, and its training split clears all three tests: every answer distinct, a most common opening at 2.0% and a most common shape at 2.9%. But all 7,200 of its training answers begin with one of 60 sentences, a fixed core with varied tails, and 210 of its 800 safety-holdout answers are also in training.
What catches both is how many different openings there are, not how common the most common one is. v0.2’s 7,200 training answers have 60 distinct six-word openings, under 1%. v0.3’s 16,800 have 46: its 20 lead sentences and 26 from the multi-turn rows. The 2,432 answers in the training set behind our released model have 1,858, or 76%.
The warning was on the record. The technical review in v0.3’s data register, dated 4 July, says: “The 19,200 template rows share 552 distinct responses”, and “the LoRA may memorize a small set of canned answers instead of generalizable, request-specific guidance”. It asked the evaluation to confirm that the model was not giving a fixed opening regardless of the prompt. But the review was advisory, recorded with blocksStrictGate: false, so it could not stop the run, and the evaluation that followed did not include that check.
What it hid
We trained on v0.3 for 480 steps of one conversation each on a Colab T4, about 3% of one epoch. That run had faults of its own, which we fixed in the next version of the pipeline: the loss covered the system and user text as well as the answers, the chat roles were assembled by hand rather than by the model’s chat template, and nothing was evaluated during training.
The dataset’s fault was quieter. Its holdout sets existed to tell us whether a model had learned to answer or learned to recite, and they couldn’t. Every holdout answer was a training answer, and every template answer followed from two phrases in the prompt, so a model that had learned the lookup table would have matched every holdout reference word for word. A holdout scored against reference answers measures generalization only if those answers are held out too.
We never scored the v0.3 model on those holdouts. We scored it on a separate suite of 120 prompts and later set that score aside, for reasons that belong to the post on evaluation. One of them belongs here: v0.3 had been built to fix v0.2’s failures on those same 120 prompts, which made them a development set.
Designing the scenarios before the text
The fix took two versions. v0.4, on 30 July, was a deliberately small 320-row dataset for testing a corrected pipeline: the tokenizer’s chat template, loss on the answers only, splits by scenario family, and an audit for holdout answers copied from training. It worked, and it was too small to teach the model much: 80 training rows, ten optimizer steps an epoch.
v0.5, designed on 1 August, changed the unit of diversity from a row to a scenario family: one situation, defined by its category, what the user wants, the risk, what the user and the app know, the pressure the user applies, what the assistant must and must not do, and the strategy of the answer. New wording doesn’t make a new family, and neither does a new language. Each family has one English and one Kiswahili conversation, both written from the shared specification rather than one translated from the other.
Each category has 130 families, whose user goals come from a grid: ten actions, such as understand, distinguish, verify available information about, or choose a safe next step for, crossed with thirteen objects specific to the category. For privacy the objects include “whether information left the device” and “a question about deletion state”. Ten times thirteen is 130, so every family in a category has a different goal by construction:
// scripts/saferide-gemma4-v05-scenario-matrix.mjs (abridged)
const actions = targets.dimensions.goalActions.values; // 10
const objects = design.goalObjects; // 13 per category
const goalAction = actions[Math.floor(entry.offset / objects.length)];
const goalObject = objects[entry.offset % objects.length];It is the same odometer as v0.3’s prompts, used on purpose this time: it enumerates situations, and the text is written from them.
Splits came next, still before any text existed. Each category’s families are ranked by sha256("419805:split:<category>:<family>"); the first 80 go to training, then 15 to development, 15 to the quality holdout and 20 to the safety holdout, which makes 1,600, 300, 300 and 400 conversations. Both languages of a family land in the same split. The split is a pure function of the seed, the category and the family ID, so the validator recomputes it and rejects any row that has moved.
The other dimensions are allocated by exact quotas rather than random draws, some of them by split. Among the 110 families in each category outside the safety holdout, 30 are low risk, 30 medium, 30 high and 20 critical, and every safety-holdout family is high or critical. Families are ordered by a SHA-256 hash of the seed and the family ID, so the allocation is reproducible and evenly spread. Our reviewers approved the matrix and the split before any text was written.
Only then did a model write. An Azure OpenAI deployment named gpt-5.6-sol drafted two candidate conversations for each family and language from the specification and our policy, with reasoning switched off, and a later pass drafted a third for 49 slots: 5,249 candidates for 2,600 slots. The design’s rule was that a model may draft but never approve.
Every candidate went through an eight-stage screen, cheapest checks first: structure and length (at most 1,024 tokens, never truncated); privacy patterns such as URLs, phone numbers, ID numbers, medication doses and fees; product truth, so that an answer cannot say a report was sent when the scenario says it is only queued; language identification, with flags for Sheng and code-switching; exact duplicates; lexical near-duplicates; semantic similarity; and diversity. 4,527 candidates passed, 514 were rejected, 11 were quarantined and 197 went to adjudication, and every slot kept at least one eligible candidate.
The diversity stage is about the answers: at least 98% of them distinct, no six-word opening in more than 5%, and no response skeleton in more than 3%. A skeleton fingerprints an answer’s shape rather than its words:
// scripts/lib/saferide-gemma4-v05.mjs (abridged)
export function responseSkeletonId(messages) {
const assistant = messages.filter(m => m.role === 'assistant');
const shape = assistant.map(({ content }) => {
const tokens = normalizeText(content).split(' ').filter(Boolean);
return {
words: tokens.length,
// boundary, conditional, option, empathy or direct
openingClass: openingClassOf(tokens.slice(0, 8)),
sentences: String(content).split(/[.!?]+/).filter(Boolean).length,
question: /\?/.test(String(content)),
};
});
return `skeleton-${canonicalSha256(shape).slice(0, 24)}`;
}Two answers with different words but the same length, opening type, sentence count and question mark share a skeleton. It is a coarse net: one extra word gives an answer a new skeleton, and v0.2, a pure template, passes the cap at 2.9%. That is why the count of distinct openings matters as well.
The semantic stage compared candidates with LaBSE, a multilingual sentence-embedding model, at a cosine threshold of 0.92: 12.6 million pairs, 460 of them above the threshold. 452 were settled by dropping a candidate: 271 of those were two drafts for the same slot, and 181 spanned different families, so different goals do not guarantee different conversations. Two more were intended, the same family in two languages, and six were decided by our reviewers, who then signed off the screening results. After selection, a final audit compared all 1,930,000 pairs of conversations in different splits and left none unresolved above the threshold. Like the screen, it compared whole conversations, alongside exact and normalized checks that ruled out repeated prompts across splits.
Here are the same measurements on the three training sets, and on the 1,600 drafted conversations alone:
| Training split | v0.2 | v0.3 | v0.5 drafted | v0.5.8 |
|---|---|---|---|---|
| Conversations | 7,200 | 15,600 | 1,600 | 1,904 |
| Answers | 7,200 | 16,800 | 2,080 | 2,432 |
| Distinct answers | 7,200 | 718 | 2,080 | 2,388 |
| Distinct openings | 60 | 46 | 1,617 | 1,858 |
| Most common opening | 2.0% | 5.1% | 2.4% | 2.1% |
| Most common skeleton | 2.9% | 5.7% | 1.5% | 1.3% |
Two things changed at once between v0.3 and v0.5, the scenario design and the switch to a drafting model, so the table can’t say which did the work. v0.5.8 is our final training set: the 1,600 drafted conversations plus 304 written later to fix specific failures. Its 44 repeated answers are four bridging replies, reused across 48 templated two-turn conversations from the first of those fixes, v0.5.1. That fix is also where we measured the wrong half a second time.
The second time we measured the wrong half
On 3 August the first two models trained on v0.5 both failed critical checks on our development panel. Both were flagged for an unsafe answer to one coercion scenario, involving confrontation or retaliation, and one was also flagged for repeating part of its hidden instructions. We wrote 160 targeted conversations, 80 bilingual families teaching de-escalation and keeping instructions private. They were built from fixed templates in code, with their own development and holdout sets of 20 conversations each.
Before anything trained on them, a gate compared every new conversation with the 2,840 existing ones (the 2,600-row corpus plus a separate 240-prompt blind evaluation suite) and with the new conversations in other splits: 459,600 pairs, LaBSE again, threshold 0.92. Like the v0.5 screen, it embedded each conversation whole, user and assistant turns together.
It flagged 31 pairs, the closest at 0.978, and blocked the dataset.
The flags looked wrong. In a safety dataset, good answers are supposed to look alike. Two people asking the assistant to reveal its instructions should both get a calm refusal and a safe alternative, and two people pressed to confront someone should both hear that confrontation is not a safety plan. Put the answers into the embedding and the similarity starts measuring the policy instead of the question.
So we ran the gate again on the prompts alone: the user turns, normalized, with the system and assistant text removed. Of the 31 pairs, only 7 were still above the threshold; the other 24 had crossed it only with their answers included. The prompt-only gate also found 26 pairs that the whole-conversation gate had missed: prompts that nearly matched, with answers different enough to pull the whole conversations apart. All 33 real collisions were between the new conversations’ own splits, where templated prompts had come out too alike, and none involved the existing corpus.

The two failures are one mistake made from opposite sides. v0.3 checked the prompts and never looked at the answers. The first v0.5.1 gate mixed the two halves, and as a leakage check its answers raised 24 false alarms and hid 26 real collisions. The 24 weren’t noise, though: the same 160 conversations went on to fail our answer caps, with one opening shared by 11 families against a limit of 8, and 27 families had their answers rewritten. It was the right finding under the wrong check. Each half answers a different question. The prompts tell you whether a test question is new; the answers tell you whether the model is learning to answer or to recite. Measure them separately.
We made the prompt-only comparison the blocking gate and kept the answers under their own checks: exact and near duplicates, n-gram overlap, templates, clusters and the safety rules. The 31-pair result stayed on file as a diagnostic that later runs had to reproduce exactly, so a change of method could not quietly make an old finding disappear, and the threshold could not be lowered. The 28 affected families were regenerated with a new seed, and the set was frozen only after the prompt-only gate passed with no flagged pairs.
You can see the pattern on our public training data. The notebook runs the same model, revision and threshold over all 1.8 million pairs of training conversations from different scenario families, embedded three ways. Whole-conversation similarity tracks the answers (correlation 0.87) more closely than the prompts (0.66). At 0.92, 80 pairs are flagged as whole conversations, 8 on prompts alone and 62 on answers alone; only 6 are flagged both whole and on prompts, and two of the 8 prompt pairs fall just short as whole conversations, at 0.918 and 0.896. Most of these pairs sit among the 120 templated v0.5.1 rows. Among the 1,600 drafted conversations, no two prompts reach 0.92, and the 2 pairs flagged as whole conversations have prompt similarities of only 0.60 and 0.63. All of these pairs are inside the training split, so none of them is leakage, but they show what each view responds to.
For scale, the English and Kiswahili versions of the same scenario average 0.68 on prompts and 0.84 as whole conversations, so a threshold of 0.92 catches near-copies, not paraphrases.
What this dataset is, and what it is not
- Every conversation is synthetic. The 1,600 core conversations were drafted by a language model from our scenario specifications, then approved for training. The other 304 were built from templates or written by people as fixed text in code.
- It covers English and Kiswahili only. Sheng and mixed-language messages are not included.
- Only the training split is public, so you can check our diversity numbers but not our split claims for v0.5.8; the v0.3 numbers you can check in full. Our holdouts stay private so that they stay useful.
If you are building a synthetic dataset
- Count distinct answers, not rows, and report them beside the row count for every split.
- Count distinct openings and first sentences too, as a share of the answers. A cap on the most common one misses a template that spreads itself evenly.
- Check each half for leakage separately, and for near-copies as well as exact ones: prompts against prompts, answers against answers. A hash of the whole conversation proves nothing when one half is unique.
- Be wary of embedding whole conversations to look for leakage. In our data, answers that agreed by design raised false alarms, and answers that differed hid near-duplicate questions.
- Assign splits to scenario families before any text exists, keep every language version of a scenario in the same split, and make the split a function you can recompute.
- Read a sample of answers next to their questions. Ours would have shown within minutes that three in four guards answered a different request.
- If a reviewer’s caveat cannot block a run, it is a note. Turn the checks you care about into gates.
- When you change a check, keep the old one as a diagnostic, require it to reproduce its recorded result, and account for every old finding under the new method.
v0.3 had 20,700 conversations and 718 answers. The training set behind our model has 1,904 conversations, and no two of them end with the same answer.
The notebook, the generators and the dataset are linked under Artifacts on this page.
Questions or corrections: saferide@esheria.org