Most tools for checking whether a language model has seen a benchmark's test questions during training work by reading the model's probabilities. A model that memorized a question assigns that text unusually high likelihood, especially on the words that would otherwise surprise it. Those probabilities, however, come from a training objective, and a growing family of objectives deliberately changes how confident a model becomes on text it has already learned. Focal loss is the clearest example. It is a training loss that shrinks the penalty on examples the model already predicts well, so learning concentrates on the hard ones. This note asks a simple question with uncomfortable implications. If a model is trained with a loss of this kind, can it still get the benefit of leaked test answers (higher benchmark accuracy) while leaving a much fainter probability trace for auditors to find?
The core claim is that confidence-dependent losses separate two quantities that contamination audits assume move together: how much a model's accuracy is inflated by leakage, and how strongly leakage raises its likelihoods. If the claim holds, likelihood-based detectors under-report contamination for any model trained this way. The note proposes a controlled pretraining study that measures this separation directly. It also proposes a simple fix to test alongside it: score tokens by their rank in the model's predicted ordering of the vocabulary rather than by their probability, so that the score is unchanged by any order-preserving reshaping of the model's predictions.
Why this gap exists
The detection side supplies the signal under threat. Detecting Pretraining Data from Large Language Models introduced Min-K% Prob. It averages the log-probabilities of the k% least likely tokens in a passage, on the observation that memorized text loses its low-probability outliers. Min-K%++ grounds this in the fact that maximum-likelihood training pushes training samples toward local maxima of the model's distribution, and it standardizes each token's log-probability by the vocabulary-wide mean and spread at that position. Both detectors are motivated by how cross-entropy training behaves. Neither asks what happens when the training objective is not plain cross-entropy.
The loss side supplies the mechanism. Focal loss, introduced for dense object detection in Focal Loss for Dense Object Detection, multiplies the cross-entropy on a token with predicted probability $p_t$ by $(1-p_t)^\gamma$, where $\gamma \ge 0$ controls how sharply well-predicted tokens are discounted. Once a leaked answer token is predicted with moderate confidence, its training signal largely disappears. Its probability should therefore level off well below where cross-entropy would push it, while the token can still be the model's top choice. Functional Properties of the Focal-Entropy makes this precise. The distribution that minimizes focal loss is a reshaped version of the data distribution: mid-range probabilities are inflated, high ones are suppressed, and the result moves toward uniform as $\gamma$ grows. Geometric Insights into Focal Loss shows that increasing $\gamma$ flattens loss curvature and reduces overconfidence.
At the sample level, Dynamic Loss-Based Sample Reweighting down-weights low-loss documents during LLM pretraining using a capped linear rule (LinUpper) and reports downstream gains on LLaMA-7B. Under that rule, a benchmark copy seen a second time is already low-loss and would be quietly discounted. None of these papers measures contamination. None of the detection papers considers non-cross-entropy training. The research file confirms that no work connects the two.
To be honest about scope: focal loss is not a standard LLM pretraining objective today. It is used inside LLM components, for example the layer routers in Dr.LLM, and sample-level loss reweighting is entering pretraining practice. The proposal therefore studies a family of confidence-dependent objectives: token-level focal loss, sample-level LinUpper, and label smoothing. The goal is to tell auditors which detectors remain trustworthy as training recipes drift away from plain cross-entropy.
Core Claim and Predictions
The main prediction is that, compared at the same level of accuracy inflation on leaked items, models trained with focal loss or LinUpper will show substantially lower item-level detection power for absolute-likelihood detectors (Min-K%) than cross-entropy models.
Different detectors should be affected to different degrees, and the predictions follow from how each one works:
- Min-K%++ should be only partly affected. Standardizing by the vocabulary removes any shift common to all tokens, but not a change in shape that depends on probability.
- The sharded rank comparison test of Proving Test Set Contamination in Black-Box Language Models should be largely robust. It compares the canonical ordering of a dataset against shuffled orderings under the same model, so any distortion common to both cancels.
- ConStat from ConStat should be robust. It detects contamination from inflated accuracy relative to reference benchmarks and never reads probabilities.
The proposed repair rests on one property. The focal minimizer is reshaped but order-preserving: a more likely token stays more likely. We define a rank score for each token $x_t$ as
$$r_t = \log \big(1 + \#\{v : p(v \mid x_{<t}) > p(x_t \mid x_{<t})\}\big),$$
where the count runs over vocabulary items $v$ that the model ranks above the observed token. The rank detector, called Min-K% Rank, averages $r_t$ over the k% highest-rank (most surprising) tokens. Any order-preserving distortion of the predicted distribution leaves $r_t$ unchanged, temperature scaling included. Rank is coarser than probability, so this robustness may cost some power under cross-entropy training, and measuring that cost is part of the study.
Research Program
The central object is a grid of small models pretrained from scratch, with deliberately leaked benchmark data. Each model is trained on a fixed-size slice of FineWeb-Edu (FineWeb dataset; The FineWeb Datasets). Models come in two sizes, roughly 124M and 1B parameters, matching the low end of the range explored by the dynamic reweighting paper.
Into each corpus we inject test items from GSM8K, ARC-Challenge, HellaSwag and a subset of MMLU:
- Each benchmark is randomly split into an injected half and a held-out half.
- The injected half appears 1, 2, 4 or 10 times. This spans the low-exposure regime where Proving Test Set Contamination reports its test still works and the repeated regime where it reports p-values as small as $10^{-38}$.
- Copies are inserted in canonical order with answers attached, which is label-level contamination in the taxonomy of the Benchmark Data Contamination survey.
- A second variant inserts paraphrased copies, which tests the semantic-leakage regime the survey identifies as hard.
The training objective is crossed with this grid. The objectives are cross-entropy, token-level focal loss with $\gamma \in \{1, 2, 3, 5\}$, LinUpper sample reweighting as specified in its paper, and label smoothing. Every run uses the same token budget and optimizer schedule.
Every model then receives the same measurements:
- Accuracy inflation: accuracy on injected items minus accuracy on held-out items from the same benchmark.
- Item-level detection AUROC (injected versus held-out items) for Min-K%, Min-K%++ and Min-K% Rank.
- The dataset-level p-value from the sharded rank test.
- ConStat's inflation estimate, using rephrased reference items and the cross-entropy models without injected data as reference models.
The headline analysis plots detection power against accuracy inflation across all runs, so that objectives are compared at equal real contamination rather than at equal exposure count. A second, cheaper arm repeats the injection during fine-tuning of a released open model under cross-entropy versus focal loss. This is closer to how leaked test sets enter practice through instruction data.
Baselines
Naive reference. The reference point is cross-entropy training audited with Min-K%. This is what current detectors implicitly assume. Every other condition is reported relative to its detection-versus-inflation curve. There is no reported result found on Lacuna for absolute Min-K% AUROC on injected GSM8K or ARC. The file reports only relative figures: a 7.4% AUC improvement over prior methods on WikiMIA (Detecting Pretraining Data). So the cross-entropy curve is measured here, not borrowed.
Strongest likelihood-based detector. This is Min-K%++. The file reports that it improves AUROC over Min-K% by 6.2% to 10.5% on WikiMIA (Min-K%++), and its vocabulary normalization is the existing mechanism most likely to absorb a loss-induced distortion. It is run with its published settings and with k tuned on a held-out validation split of injected items, with the same tuning budget given to Min-K% Rank. The rank score beats it if, on focal-trained and LinUpper-trained models, it recovers detection AUROC to within a few points of the cross-entropy level at matched inflation, where Min-K%++ does not.
Strongest detectors that do not read single-token probabilities. These are the sharded rank test and ConStat, which reports detecting 89% of syntax-contaminated and 98% of sample-contaminated models in its controlled experiments (ConStat). They work at the dataset level, not per item. The comparison is therefore whether they flag every contaminated run at the same false-positive rate on the uncontaminated cross-entropy controls. The rank score adds value only if it gives item-level evidence these tests cannot, at comparable reliability.
Ablation of the key ingredient. The ablation trains cross-entropy with hard confidence clipping: the token loss is zeroed once $p_t$ exceeds a threshold. This keeps the "stop learning what is already learned" ingredient and drops focal loss's smooth reshaping. If clipping alone produces the same separation between inflation and detection, the mechanism is confidence-dependent gradient removal in general, and the result extends beyond focal loss. Label smoothing serves as the contrasting control. It caps confidence uniformly rather than selectively.
Why not just…?
Why not just temperature-scale the model's outputs before running Min-K%? If focal training only made the model uniformly less confident, rescaling the logits would undo it and the concern would vanish. This is a real threat. Focal-entropy theory argues the reshaping is not a single temperature: the minimizer inflates mid-range probabilities and suppresses high ones, and repeated optimization keeps changing it (Functional Properties of the Focal-Entropy). Still, a fitted temperature might recover most of the signal in practice. We therefore include temperature-scaled Min-K% and Min-K%++ as explicit conditions, with the temperature fitted on held-out clean text. If they close the gap, the finding becomes a short audit protocol (recalibrate first) rather than a new detector, and the rank score is unnecessary.
Why not just use ConStat, which never looks at probabilities? If performance-based detection survives every objective, auditors could simply switch to it. ConStat needs reference models and rephrased reference benchmarks, and it gives a model-level verdict rather than identifying which items leaked. It may also miss contamination at low exposure counts, where inflation is small. The experiments report ConStat's detection rate in each cell of the exposure-by-objective grid. If it dominates the rank score everywhere, we will say so.
Why not just decontaminate the pretraining corpus with n-gram filters? That addresses developers who control their data, not auditors of models whose corpora are hidden (Proving Test Set Contamination). Filtering also misses paraphrased leakage: ConStat still finds inflation of about 8.2% on GSM8K for Mistral-7B (ConStat). The paraphrased-injection arm measures detection in exactly the regime that filtering cannot reach.
Decisive Checks
Three outcomes would settle the question.
The hypothesis fails if, at matched accuracy inflation, focal and LinUpper models show Min-K% AUROC statistically indistinguishable from cross-entropy models across seeds. In that case leaked answers leave the same likelihood trace whatever the loss.
The hypothesis is reduced to a calibration issue if temperature-scaled Min-K%++ restores detection. The proposed detector earns its place only if Min-K% Rank restores item-level detection where recalibration does not, while losing little power on cross-entropy models.
A further, more alarming result would be single-exposure cells where focal training yields measurable inflation and every detector, including the sharded rank test, falls to chance. That would mark a regime in which current audits cannot certify a benchmark score.
References
- Detecting Pretraining Data from Large Language Models
- Min-K%++: Improved Baseline for Pre-Training Data Detection from Large Language Models
- Focal Loss for Dense Object Detection
- Functional Properties of the Focal-Entropy
- Geometric insights into focal loss: Reducing curvature for enhanced model calibration
- Dynamic Loss-Based Sample Reweighting for Improved Large Language Model Pretraining
- Dr.LLM: Dynamic Layer Routing in LLMs
- Proving Test Set Contamination in Black-Box Language Models
- ConStat: Performance-Based Contamination Detection in Large Language Models
- The FineWeb Datasets: Decanting the Web for the Finest Text Data at Scale
- Benchmark Data Contamination of Large Language Models: A Survey