Paraphrase and Perturbation Tests for Memorization Detection
Paraphrase and Perturbation Tests for Memorization Detection
When a model scores 94% on a benchmark, the first question isn't whether the architecture is good. It's whether the model has seen those exact problems during training. Paraphrase and perturbation tests for memorization detection are the operational tools that separate genuine capability from surface-level recall. Without them, evaluation scores are evidence of something, but not necessarily what you think.
This post explains how paraphrase and perturbation tests work mechanically, when to use each, how to design them for non-software domains, and where they break down. If you're building evals or auditing benchmark integrity, this is the decision framework you need.
Answer Capsule: Paraphrase tests restate a benchmark problem in different surface form while preserving the underlying reasoning requirement; perturbation tests modify the problem's parameters or structure to create a near-neighbor variant. A model that memorized training data will score high on originals but drop sharply on paraphrases or perturbations. Measuring that score gap is the primary signal for contamination.
What Paraphrase and Perturbation Tests Actually Measure
The two methods target different failure modes, and conflating them produces noisy signals.
Paraphrase tests change the linguistic surface of a problem while holding the logical structure constant. If a model solved the original by pattern-matching the phrasing it saw during training, its accuracy drops on a well-constructed paraphrase. If it reasoned through the problem, accuracy holds.
Perturbation tests change the underlying parameters: swap a coefficient, change a boundary condition, reverse a logical relation, or introduce a distractor. A model that generalized should handle the perturbation. A model that recalled the original answer will either reproduce the wrong answer or hallucinate a plausible-sounding one.
Method | What changes | What stays the same | Primary signal |
|---|---|---|---|
Paraphrase | Wording, syntax, framing | Logical structure, correct answer | Surface memorization |
Perturbation | Parameters, values, relations | Task type, reasoning path length | Answer-level memorization |
Combined | Both surface and parameters | Domain and difficulty tier | Generalization vs. recall |
Running both together and comparing the score gaps gives you a cleaner decomposition of the contamination signal than either method alone.
How to Design Paraphrase Tests That Are Actually Diagnostic
A paraphrase that a model can solve by n-gram matching the original is not a paraphrase test; it's a near-duplicate. Diagnostic paraphrases require structural rewriting, not synonym substitution.
A three-step authoring protocol
Identify the minimal reasoning skeleton. Strip the problem to its logical core: what information is given, what is asked, what reasoning steps connect them. This skeleton is what must be preserved.
Rewrite from the skeleton, not from the original text. An expert author who has not read the original wording writes the paraphrase from the skeleton alone. This prevents unconscious borrowing of phrasing.
Verify semantic equivalence programmatically where possible. For math and code tasks, run both versions through a verifier to confirm the correct answer is identical. For open-ended tasks, use a rubric-based expert review to confirm the reasoning requirement is unchanged.
Step 2 is where most in-house teams cut corners. Paraphrases written by someone who just read the original will share n-grams with it. That's enough for a model trained on web data to bridge the gap and produce a false negative on the contamination test.
How to Design Perturbation Tests That Preserve Difficulty
The common failure in perturbation design is changing a parameter in a way that accidentally makes the problem trivially easier or harder. Either outcome invalidates the comparison.
Perturbation design decision tree
Is the correct answer computable by a verifier? If yes, perturb freely and recompute the answer. If no, perturb only dimensions that a domain expert can re-evaluate against the same rubric.
Does the perturbation change the number of reasoning steps? If yes, you're measuring difficulty change, not memorization. Adjust until step count is equivalent.
Does the perturbation introduce a new concept not in the original? If yes, you're measuring knowledge coverage, not memorization. Scope the perturbation back.
Is the perturbed answer distinguishable from the original answer? If not (for example, changing a variable name in a trivial algebra problem), the perturbation is too weak to detect recall.
For domains with a ground-truth verifier, such as G-code simulation or circuit SPICE checks, perturbation tests are more reliable than paraphrase tests because the answer can be verified independently of expert judgment. For domains without a computable verifier, such as structural engineering design rationale or financial audit reasoning, paraphrase tests with rubric-based scoring are often the more tractable path. You can read more about verifier design and its role in evaluation integrity in our coverage of expert-authored evals.
Measuring the Memorization Signal: The Score Gap Method
The memorization signal is the difference in accuracy between original and paraphrase or perturbation variants, measured at the same pass@k setting across the same model.
The score gap formula
Let A_orig be accuracy on original problems and A_para be accuracy on paraphrased or perturbed variants, both measured at pass@1 with temperature 0 or at pass@k with the same k.
Score gap = A_orig - A_para
A gap near zero suggests generalization. A gap above a domain-specific threshold suggests memorization or contamination. The threshold is not universal; it depends on task difficulty, domain, and the variance you'd expect from prompt sensitivity alone.
Calibrating the threshold
Run the same paraphrase or perturbation test on a model that was provably not trained on the benchmark (for example, a model trained only on a controlled corpus, or an earlier checkpoint predating the benchmark's public release). Its score gap is your baseline for prompt sensitivity without contamination. Any gap significantly above that baseline is a contamination signal worth investigating.
This calibration step is routinely skipped in practice, which means many contamination reports conflate genuine memorization with ordinary prompt sensitivity. Don't skip it.
Worked Example: Perturbation Test for a Manufacturing Reasoning Task
Illustrative example: all numbers and outcomes below are constructed for demonstration and do not represent any specific model or benchmark.
Suppose the original task asks a model to determine the correct cutting speed for a turning operation given material hardness, tool material, and depth of cut. The correct answer is derivable from standard machining formulas and requires the model to select the right formula, substitute values, and flag whether the result exceeds the machine's spindle limit.
Original: Material is 304 stainless steel, tool is uncoated carbide, depth of cut is 2mm, spindle limit is 3000 RPM. What is the recommended cutting speed in m/min, and does it exceed the spindle limit at 80mm workpiece diameter?
Perturbation: Material is 316L stainless steel, tool is TiN-coated carbide, depth of cut is 1.5mm, spindle limit is 2500 RPM. Same question structure.
The perturbed version requires the model to apply updated material machinability data and coating correction factors. A model that recalled the original answer will produce the wrong cutting speed and the wrong spindle comparison. A model that reasoned through the formula will adapt correctly.
In a simulated evaluation run, a model scoring 78% on originals drops to 51% on perturbations in this task class. The 27-point gap, against a calibrated baseline of 8 points for prompt sensitivity, flags this task class as high-contamination-risk. The evals team then audits the training data provenance for machining content.
This is precisely the kind of domain where original, expert-authored tasks provide the most leverage: the perturbation space is large, the verifier (machining formula computation plus spindle check) is reliable, and web-scraped training data is likely to contain standard textbook problems but not novel parameter combinations authored by a practicing CNC instructor.
Common Failure Modes in Paraphrase and Perturbation Testing
1. Paraphrases that share n-grams with the original
Detection: Compute character n-gram overlap between original and paraphrase at n=4 and n=6. Overlap above 30% at n=4 suggests the paraphrase is too close.
Fix: Use the skeleton-first authoring protocol; never rewrite from the original text directly.
2. Perturbations that change task difficulty
Detection: Run both versions on a held-out model and compare solve rates. A difference greater than 15 percentage points suggests a difficulty shift, not a memorization signal.
Fix: Adjust the perturbed parameter until solve rates on a clean model are within a reasonable band of the original.
3. No baseline calibration for prompt sensitivity
Detection: You have a score gap but no comparison against a model that wasn't trained on the benchmark.
Fix: Run the test on an earlier checkpoint or a model with a documented training cutoff before the benchmark was released.
4. Verifier mismatch on perturbed tasks
Detection: The verifier was written for the original parameters and returns incorrect results on perturbed variants.
Fix: Parameterize the verifier so it accepts the correct answer as an input computed from the new parameters, not hardcoded from the original.
5. Expert-authored paraphrases that inadvertently introduce new difficulty
Detection: An expert who understands the domain deeply may write a paraphrase that adds implicit context the original lacked, making the paraphrase easier for a knowledgeable model.
Fix: Calibrate paraphrases with a gold-standard rubric review before including them in the eval set.
6. Treating a score gap as proof of contamination rather than a signal for investigation
Detection: A team flags a model as contaminated based solely on the score gap, without auditing training data provenance.
Fix: The score gap is an indicator, not a verdict. Pair it with a training-data audit or a membership inference approach before drawing conclusions.
Where This Approach Breaks Down
Paraphrase and perturbation tests are necessary but not sufficient for contamination detection. They don't work well when the task space is so constrained that all valid paraphrases are semantically near-identical (for example, single-digit arithmetic). They also don't distinguish between contamination from the benchmark itself and contamination from the underlying knowledge domain, which matters when you're trying to separate memorized answers from genuine expertise.
For tasks without a reliable verifier, the paraphrase equivalence check depends on expert judgment, which introduces inter-rater variance. And score gaps are only interpretable if you have a clean baseline model, which isn't always available in practice.
Finally, as models improve, the gap between original and paraphrase performance narrows for reasons unrelated to memorization: better models are simply less sensitive to surface variation. Thresholds that were diagnostic at one capability level may not be at the next. Difficulty calibration is a moving target, and any contamination detection framework needs to be re-calibrated as the frontier moves. This is one reason why task provenance, not just score monitoring, is the more durable investment. For more on how task provenance connects to contamination resistance, see our writing on contamination and data provenance.
Frequently Asked Questions
How many paraphrase variants do I need per original task to get a reliable memorization signal?
There's no universal number, but the signal stabilizes faster with harder tasks. For tasks where pass@1 accuracy on the original is above 80%, you need fewer variants to detect a meaningful gap. For tasks near 50% accuracy, variance is high and you need more. A practical starting point is three to five paraphrases per task, then check whether the gap estimate has stabilized across that set.
Can I use an LLM to generate paraphrases automatically?
You can use an LLM to generate candidate paraphrases, but you need expert review before using them in an eval. LLM-generated paraphrases often preserve the original's phrasing more than they appear to, and they can introduce subtle errors in technical domains. Treat LLM output as a draft, not a finished paraphrase.
Does a high score gap always mean the model was trained on the benchmark?
No. A high score gap can also reflect prompt sensitivity, domain-specific brittleness, or a paraphrase that inadvertently changed the difficulty. The score gap is a signal for investigation, not a verdict. Pair it with training-data provenance analysis before concluding contamination.
How do perturbation tests differ from adversarial robustness tests?
Perturbation tests for memorization detection change problem parameters to create near-neighbor variants with different correct answers. Adversarial robustness tests typically change inputs in ways designed to cause model failures regardless of memorization. The goals overlap but are distinct: memorization tests target training-data leakage; robustness tests target generalization under distribution shift.
Are paraphrase tests useful for multimodal tasks, such as engineering drawing interpretation?
Yes, but the authoring cost is higher. A paraphrase of a visual task requires creating a new image with equivalent information in different layout or notation, not just rewriting text. For domains like PCB schematics or engineering drawings, this typically requires the original expert to author the paraphrase image, not just rewrite a caption.
What This Means in Practice
Paraphrase and perturbation tests are not a silver bullet for contamination detection. They're a structured way to generate evidence that either supports or undermines the validity of a benchmark score. The signal is most useful when you have a clean baseline, a reliable verifier, and paraphrases authored from the reasoning skeleton rather than the original text.
The domains where these tests are hardest to run well, manufacturing, engineering, finance, clinical reasoning, are also the domains where contamination is hardest to detect through other means and where the cost of a false-positive eval score is highest. That's not a coincidence. Difficulty and verifiability are correlated, and both require domain expertise to get right.
If you're building evals or RL environments where contamination resistance and difficulty calibration matter, talk to Chiron Data Labs about expert-authored tasks for your domain.
When a model scores 94% on a benchmark, the first question isn't whether the architecture is good. It's whether the model has seen those exact problems during training. Paraphrase and perturbation tests for memorization detection are the operational tools that separate genuine capability from surface-level recall. Without them, evaluation scores are evidence of something, but not necessarily what you think.
This post explains how paraphrase and perturbation tests work mechanically, when to use each, how to design them for non-software domains, and where they break down. If you're building evals or auditing benchmark integrity, this is the decision framework you need.
Answer Capsule: Paraphrase tests restate a benchmark problem in different surface form while preserving the underlying reasoning requirement; perturbation tests modify the problem's parameters or structure to create a near-neighbor variant. A model that memorized training data will score high on originals but drop sharply on paraphrases or perturbations. Measuring that score gap is the primary signal for contamination.
What Paraphrase and Perturbation Tests Actually Measure
The two methods target different failure modes, and conflating them produces noisy signals.
Paraphrase tests change the linguistic surface of a problem while holding the logical structure constant. If a model solved the original by pattern-matching the phrasing it saw during training, its accuracy drops on a well-constructed paraphrase. If it reasoned through the problem, accuracy holds.
Perturbation tests change the underlying parameters: swap a coefficient, change a boundary condition, reverse a logical relation, or introduce a distractor. A model that generalized should handle the perturbation. A model that recalled the original answer will either reproduce the wrong answer or hallucinate a plausible-sounding one.
Method | What changes | What stays the same | Primary signal |
|---|---|---|---|
Paraphrase | Wording, syntax, framing | Logical structure, correct answer | Surface memorization |
Perturbation | Parameters, values, relations | Task type, reasoning path length | Answer-level memorization |
Combined | Both surface and parameters | Domain and difficulty tier | Generalization vs. recall |
Running both together and comparing the score gaps gives you a cleaner decomposition of the contamination signal than either method alone.
How to Design Paraphrase Tests That Are Actually Diagnostic
A paraphrase that a model can solve by n-gram matching the original is not a paraphrase test; it's a near-duplicate. Diagnostic paraphrases require structural rewriting, not synonym substitution.
A three-step authoring protocol
Identify the minimal reasoning skeleton. Strip the problem to its logical core: what information is given, what is asked, what reasoning steps connect them. This skeleton is what must be preserved.
Rewrite from the skeleton, not from the original text. An expert author who has not read the original wording writes the paraphrase from the skeleton alone. This prevents unconscious borrowing of phrasing.
Verify semantic equivalence programmatically where possible. For math and code tasks, run both versions through a verifier to confirm the correct answer is identical. For open-ended tasks, use a rubric-based expert review to confirm the reasoning requirement is unchanged.
Step 2 is where most in-house teams cut corners. Paraphrases written by someone who just read the original will share n-grams with it. That's enough for a model trained on web data to bridge the gap and produce a false negative on the contamination test.
How to Design Perturbation Tests That Preserve Difficulty
The common failure in perturbation design is changing a parameter in a way that accidentally makes the problem trivially easier or harder. Either outcome invalidates the comparison.
Perturbation design decision tree
Is the correct answer computable by a verifier? If yes, perturb freely and recompute the answer. If no, perturb only dimensions that a domain expert can re-evaluate against the same rubric.
Does the perturbation change the number of reasoning steps? If yes, you're measuring difficulty change, not memorization. Adjust until step count is equivalent.
Does the perturbation introduce a new concept not in the original? If yes, you're measuring knowledge coverage, not memorization. Scope the perturbation back.
Is the perturbed answer distinguishable from the original answer? If not (for example, changing a variable name in a trivial algebra problem), the perturbation is too weak to detect recall.
For domains with a ground-truth verifier, such as G-code simulation or circuit SPICE checks, perturbation tests are more reliable than paraphrase tests because the answer can be verified independently of expert judgment. For domains without a computable verifier, such as structural engineering design rationale or financial audit reasoning, paraphrase tests with rubric-based scoring are often the more tractable path. You can read more about verifier design and its role in evaluation integrity in our coverage of expert-authored evals.
Measuring the Memorization Signal: The Score Gap Method
The memorization signal is the difference in accuracy between original and paraphrase or perturbation variants, measured at the same pass@k setting across the same model.
The score gap formula
Let A_orig be accuracy on original problems and A_para be accuracy on paraphrased or perturbed variants, both measured at pass@1 with temperature 0 or at pass@k with the same k.
Score gap = A_orig - A_para
A gap near zero suggests generalization. A gap above a domain-specific threshold suggests memorization or contamination. The threshold is not universal; it depends on task difficulty, domain, and the variance you'd expect from prompt sensitivity alone.
Calibrating the threshold
Run the same paraphrase or perturbation test on a model that was provably not trained on the benchmark (for example, a model trained only on a controlled corpus, or an earlier checkpoint predating the benchmark's public release). Its score gap is your baseline for prompt sensitivity without contamination. Any gap significantly above that baseline is a contamination signal worth investigating.
This calibration step is routinely skipped in practice, which means many contamination reports conflate genuine memorization with ordinary prompt sensitivity. Don't skip it.
Worked Example: Perturbation Test for a Manufacturing Reasoning Task
Illustrative example: all numbers and outcomes below are constructed for demonstration and do not represent any specific model or benchmark.
Suppose the original task asks a model to determine the correct cutting speed for a turning operation given material hardness, tool material, and depth of cut. The correct answer is derivable from standard machining formulas and requires the model to select the right formula, substitute values, and flag whether the result exceeds the machine's spindle limit.
Original: Material is 304 stainless steel, tool is uncoated carbide, depth of cut is 2mm, spindle limit is 3000 RPM. What is the recommended cutting speed in m/min, and does it exceed the spindle limit at 80mm workpiece diameter?
Perturbation: Material is 316L stainless steel, tool is TiN-coated carbide, depth of cut is 1.5mm, spindle limit is 2500 RPM. Same question structure.
The perturbed version requires the model to apply updated material machinability data and coating correction factors. A model that recalled the original answer will produce the wrong cutting speed and the wrong spindle comparison. A model that reasoned through the formula will adapt correctly.
In a simulated evaluation run, a model scoring 78% on originals drops to 51% on perturbations in this task class. The 27-point gap, against a calibrated baseline of 8 points for prompt sensitivity, flags this task class as high-contamination-risk. The evals team then audits the training data provenance for machining content.
This is precisely the kind of domain where original, expert-authored tasks provide the most leverage: the perturbation space is large, the verifier (machining formula computation plus spindle check) is reliable, and web-scraped training data is likely to contain standard textbook problems but not novel parameter combinations authored by a practicing CNC instructor.
Common Failure Modes in Paraphrase and Perturbation Testing
1. Paraphrases that share n-grams with the original
Detection: Compute character n-gram overlap between original and paraphrase at n=4 and n=6. Overlap above 30% at n=4 suggests the paraphrase is too close.
Fix: Use the skeleton-first authoring protocol; never rewrite from the original text directly.
2. Perturbations that change task difficulty
Detection: Run both versions on a held-out model and compare solve rates. A difference greater than 15 percentage points suggests a difficulty shift, not a memorization signal.
Fix: Adjust the perturbed parameter until solve rates on a clean model are within a reasonable band of the original.
3. No baseline calibration for prompt sensitivity
Detection: You have a score gap but no comparison against a model that wasn't trained on the benchmark.
Fix: Run the test on an earlier checkpoint or a model with a documented training cutoff before the benchmark was released.
4. Verifier mismatch on perturbed tasks
Detection: The verifier was written for the original parameters and returns incorrect results on perturbed variants.
Fix: Parameterize the verifier so it accepts the correct answer as an input computed from the new parameters, not hardcoded from the original.
5. Expert-authored paraphrases that inadvertently introduce new difficulty
Detection: An expert who understands the domain deeply may write a paraphrase that adds implicit context the original lacked, making the paraphrase easier for a knowledgeable model.
Fix: Calibrate paraphrases with a gold-standard rubric review before including them in the eval set.
6. Treating a score gap as proof of contamination rather than a signal for investigation
Detection: A team flags a model as contaminated based solely on the score gap, without auditing training data provenance.
Fix: The score gap is an indicator, not a verdict. Pair it with a training-data audit or a membership inference approach before drawing conclusions.
Where This Approach Breaks Down
Paraphrase and perturbation tests are necessary but not sufficient for contamination detection. They don't work well when the task space is so constrained that all valid paraphrases are semantically near-identical (for example, single-digit arithmetic). They also don't distinguish between contamination from the benchmark itself and contamination from the underlying knowledge domain, which matters when you're trying to separate memorized answers from genuine expertise.
For tasks without a reliable verifier, the paraphrase equivalence check depends on expert judgment, which introduces inter-rater variance. And score gaps are only interpretable if you have a clean baseline model, which isn't always available in practice.
Finally, as models improve, the gap between original and paraphrase performance narrows for reasons unrelated to memorization: better models are simply less sensitive to surface variation. Thresholds that were diagnostic at one capability level may not be at the next. Difficulty calibration is a moving target, and any contamination detection framework needs to be re-calibrated as the frontier moves. This is one reason why task provenance, not just score monitoring, is the more durable investment. For more on how task provenance connects to contamination resistance, see our writing on contamination and data provenance.
Frequently Asked Questions
How many paraphrase variants do I need per original task to get a reliable memorization signal?
There's no universal number, but the signal stabilizes faster with harder tasks. For tasks where pass@1 accuracy on the original is above 80%, you need fewer variants to detect a meaningful gap. For tasks near 50% accuracy, variance is high and you need more. A practical starting point is three to five paraphrases per task, then check whether the gap estimate has stabilized across that set.
Can I use an LLM to generate paraphrases automatically?
You can use an LLM to generate candidate paraphrases, but you need expert review before using them in an eval. LLM-generated paraphrases often preserve the original's phrasing more than they appear to, and they can introduce subtle errors in technical domains. Treat LLM output as a draft, not a finished paraphrase.
Does a high score gap always mean the model was trained on the benchmark?
No. A high score gap can also reflect prompt sensitivity, domain-specific brittleness, or a paraphrase that inadvertently changed the difficulty. The score gap is a signal for investigation, not a verdict. Pair it with training-data provenance analysis before concluding contamination.
How do perturbation tests differ from adversarial robustness tests?
Perturbation tests for memorization detection change problem parameters to create near-neighbor variants with different correct answers. Adversarial robustness tests typically change inputs in ways designed to cause model failures regardless of memorization. The goals overlap but are distinct: memorization tests target training-data leakage; robustness tests target generalization under distribution shift.
Are paraphrase tests useful for multimodal tasks, such as engineering drawing interpretation?
Yes, but the authoring cost is higher. A paraphrase of a visual task requires creating a new image with equivalent information in different layout or notation, not just rewriting text. For domains like PCB schematics or engineering drawings, this typically requires the original expert to author the paraphrase image, not just rewrite a caption.
What This Means in Practice
Paraphrase and perturbation tests are not a silver bullet for contamination detection. They're a structured way to generate evidence that either supports or undermines the validity of a benchmark score. The signal is most useful when you have a clean baseline, a reliable verifier, and paraphrases authored from the reasoning skeleton rather than the original text.
The domains where these tests are hardest to run well, manufacturing, engineering, finance, clinical reasoning, are also the domains where contamination is hardest to detect through other means and where the cost of a false-positive eval score is highest. That's not a coincidence. Difficulty and verifiability are correlated, and both require domain expertise to get right.
If you're building evals or RL environments where contamination resistance and difficulty calibration matter, talk to Chiron Data Labs about expert-authored tasks for your domain.