Implementation · Cryptographic & computational

DiFR (Divergence From Reference)

DiFR checks that an inference provider ran its declared model by comparing output tokens or activations with a trusted re-run using the same random seed.

Also called Token-DiFR; Activation-DiFR

R2DemonstratedProvider-reported

Summary

DiFR (Divergence From Reference) is a pair of methods for checking that an inference provider ran the model and settings it declared. Both tolerate the small numerical differences that make re-runs disagree. In Token-DiFR, provider and verifier share the random seed for token sampling. The verifier re-runs the sequence and scores how far each claimed token departs from the reference model's choice. Activation-DiFR compares compressed fingerprints of internal activations instead. On models of 8 to 30 billion parameters on A100 and H200 GPUs, both detected 4-bit quantization almost perfectly (AUC above 0.999). Token-DiFR did so within 300 output tokens and Activation-DiFR within 2. The code is public, with a vLLM integration, and a separate team has re-implemented it. The verifier needs the model weights and must know the provider's sampling procedure. Its statistical tolerance leaves a covert channel, which an independent study widened in a related exfiltration detector.

ReadinessR2Demonstratedmedium confidence · rubric v1.0 · 2026-09-23

R2. The code is public and the results reproduce on data-centre GPUs, but only its developers rely on it and no one has independently evaluated its consistency check.

Rubric assessment
  • R1 met: the paper states the verification claim, the specification the provider must follow and the trust assumptions 1. The assumptions are a trusted reference, calibration on trusted hardware and synchronized seeds. A companion paper embeds the method in a formal security game 2.
  • R2 met: public MIT-licensed code with a vLLM integration exists 3. Results are reproducible on A100 and H200 GPUs with models of 8 to 30 billion parameters 1. A separate team re-implemented it with models of up to 120 billion parameters 4.
  • R3 not met. On criterion (a), Amodo's prototype is a research demonstration. Amodo is not relying on DiFR for a verification decision 4, and the code is research-grade. On criterion (b), no independent audit, red-team or peer-reviewed security analysis of DiFR's consistency check has been published as of September 2026. Amodo lists recomputation red-teaming as not started 7. The one independent attack targets a weight-exfiltration detector built on the same Gumbel-margin statistic 8. That attack bears on the supporting exfiltration use, assessed under Bounding unexplained information in outputs. It does not bear on the primary use.
Gaps to the next level
  • Reliance by a party other than the developers on DiFR for a verification decision, or a production-grade release.
  • An independent public security evaluation (audit, red-team or peer-reviewed analysis) against adaptive adversaries.

What it is

DiFR (Divergence From Reference) is a pair of methods for checking that an inference provider performed inference correctly. The checks work despite the benign numerical noise that makes re-runs of the same model differ 1. Authors at the ML Alignment and Theory Scholars (MATS) programme, FAR AI, Anthropic and Harvard University introduced it in a 2025 preprint 1.

  • Token-DiFR compares the tokens a provider generated with the predictions of a trusted reference run that uses the same random seed 1.
  • Activation-DiFR compares compressed fingerprints of internal activations 1.

A companion paper uses the same family of estimators to detect model weights hidden in inference outputs 2. The code is public under an MIT licence 3.

How it works

The provider commits to a specification: model and weights, numerical precision, sampling settings and random seed 1. Token-DiFR relies on Gumbel-Max sampling, which picks each token by adding seeded random noise to the model's scores and taking the largest. With a shared seed, the verifier knows the random noise the provider used 1. It can therefore compute which token the reference model would have chosen at each position, and how far the claimed token falls short of it 1.

The verifier pools these margins over many tokens into a score. It compares the score with a threshold calibrated on trusted hardware 1. The verifier feeds the prompt and output through the model once, which gives logits and activations for every position at once 1. Because the seed pins down sampling, over 98% of tokens match exactly between provider and verifier 1.

Activation-DiFR uses a shared random orthogonal projection to compress activations into short fingerprints. The verifier compares distances between its fingerprints and the provider's 1. This checks the forward pass but not the sampling step 1.

Evidence

  • The authors tested Llama 3.1 8B-Instruct, Qwen3-8B and Qwen3-30B-A3B on 2,000 UltraChat prompts 1. The four inference configurations were H200 with four-way tensor parallelism, A100 with and without it, and H200 without it running Hugging Face 1.
  • The faults tested were FP8 key-value cache quantization, 4-bit model quantization, a temperature of 1.1 instead of 1.0, an incorrect seed, and a simulated sampling bug that picks uniformly among the top-k tokens 1% of the time 1.
  • The authors report that Token-DiFR detects 4-bit quantization with an AUC above 0.999 within 300 output tokens 1. Activation-DiFR does so within 2 tokens, while cutting communication by 25–75% relative to existing methods 1.
  • The authors report that Activation-DiFR Pareto-dominates TOPLOC in communication cost against detection accuracy 1. They also cite a report that a distributional test called RUT failed to reliably separate 8-bit quantized models. Token-DiFR detects such differences within a few thousand tokens 1.
  • The companion paper's detector limited exfiltratable information to under 0.5% at a false-positive rate below 0.01% on a mixture-of-experts Qwen 30B model, under benign prompt traffic 2. An independent study found that choosing the prompts roughly doubles the leakage per token 8.
  • Amodo Design, a separate team, re-implemented DiFR in an asynchronous recomputation prototype 4 5. It tested the prototype on models of 1.5 to 120 billion parameters on H100 and H200 GPUs 4.

Limitations

  • The methods need the model weights 1. Providers can check their own traffic and users can check open-weights models, but the methods cannot verify closed-weights providers 1.
  • Deployment requires knowing the provider's sampling procedure 1. In Amodo's prototype, vLLM v0.25.1 used a different random-number implementation from the one DiFR expected. This produced large logit differences until Amodo forced the older model runner 4.
  • For Qwen3-30B-A3B, mixing A100 and H200 reference runs made the smallest tested change harder to separate from honest runs 1.
  • Only single-model sampling was studied. Speculative decoding was not evaluated 1.
  • A statistical tolerance can bound covert bandwidth but cannot close it 6.
  • Adversarial testing is limited. The authors show that simple adversarial temperature tuning defeats a cross-entropy baseline, while Token-DiFR still detects the change 1. An independent study reports that attacker-chosen prompts roughly double the leakage allowed by a weight-exfiltration detector built on the same Gumbel-margin statistic. This cut the detector's slowdown to 60–118 times 8. Amodo rates red-teaming of recomputation schemes as not started 7.

Known flaws

Published flaws, with their severity, kind and status. How flaws are rated.

  • Statistical tolerance leaves a covert channelSignificantDemonstrated attackOpen

    Statistical schemes can put an upper bound on an adversary's covert bandwidth, but cannot close it 6. In the companion exfiltration study, the detector cut exfiltratable information to under 0.5% under benign prompt traffic. It did not cut it to zero 2. An independent study attacked that detector, which uses the same Gumbel-margin statistic. An adversary who controls the prompts roughly doubled the bits leaked per token. This cut the slowdown from over 200 times to 60–118 times 8. The attack widens the exfiltration bound. It does not target DiFR's check that outputs match the declared configuration.

  • Mixed hardware widens the honest baselineMinorOpen questionOpen

    For Qwen3-30B-A3B, benign differences between A100 and H200 deployments broadened the honest score distribution. This made the smallest tested change, a temperature raised by 0.1, harder to separate.

    Sources: [1]
  • Speculative decoding and multi-model sampling not evaluatedSignificantOpen questionOpen

    The algorithms and experiments cover sampling from a single LLM. Speculative decoding was not evaluated. The authors sketch an extension to one speculative-decoding algorithm, without experiments. They note that other variants would need modified verification and extra metadata.

    Sources: [1]

Blockers

  • The verifier needs the model weights, so outsiders cannot use the method to verify providers of closed-weights models.

    Privacy & leakage[1]
  • The verifier must know and match the provider's sampling procedure, and in one re-implementation a sampling mismatch in a newer vLLM version produced large spurious logit differences.

    Performance & compatibility[1][4]
  • No independent red-team of DiFR's consistency check has been published, Amodo rates recomputation red-teaming 'not started', and the one independent attack study targets an exfiltration detector built on the same statistic.

    Adversarial validation[7][8]

Technical detail

Show technical detail
  • The specification φ fixes the architecture and weights, numerical precision, sampling hyperparameters and the seed of the pseudorandom number generator 1.
  • Token-DiFR works with Gumbel-Max sampling. From the shared seed, both parties derive the same Gumbel noise vector g. The verifier computes post-Gumbel scores z_i = l_i + T·g_i from its reference logits l and temperature T, and takes the token it would have chosen. It scores each claimed token by the logit-margin difference between the two tokens, clipped at a maximum. Scores are pooled per batch. A batch is flagged if the statistic exceeds a threshold set on a calibration set generated under φ on trusted hardware 1. Verification is one prefill pass over prompt plus output 1. The companion exfiltration paper gives a variant for inverse-probability-transform samplers 2.
  • Activation-DiFR has both parties generate the same random orthogonal projection P from a shared seed. P is k by D, with k much smaller than D. The provider sends f = P·a for activation vector a, possibly only for every J-th token. The verifier checks the L2 distance to its own projection 1. The authors report an AUC of at least 0.9999 with under 0.5 bytes per token 1.
  • DiFR works with unmodified vLLM, which exposes per-request seeds as a standard sampling parameter 1.
  • At temperature zero, Token-DiFR needs no seed synchronization. The verifier checks that the provider chose the most likely token at each position. The authors warn that such greedy spot checks are open to selective cheating. A provider could serve the declared model at temperature zero and a degraded one otherwise 1.

Sources

  1. BA. Karvonen et al. (2025). DiFR: Inference Verification Despite Nondeterminism. arXiv. Source recordSupports: method, specification, experiments, results, comparison with TOPLOC and distributional methods, deployment considerations, limitations, speculative-decoding sketch · abstract; §2-3; §5; §5.1; §7.2-7.4; Appendix F
  2. BR. Rinberg et al. (2025). Verifying LLM Inference to Detect Model Weight Exfiltration. arXiv. Source recordSupports: companion security game and exfiltration results using Token-DiFR estimators · abstract; contributions; §4
  3. BA. Karvonen (2025). adamkarvonen/difr (GitHub repository). GitHub. Source recordSupports: public code, licence, vLLM and API modes · README
  4. CAmodo Design (2026). Scaling Recomputation Inference Verification. Amodo Design. Source recordSupports: independent re-implementation, scale and vLLM sampling mismatch · whole note
  5. BAmodo Design (2026). Amodo-Design/Inference-Recomputation-Prototype (GitHub repository). GitHub. Source recordSupports: re-implementation code · README
  6. BN. Cankaya (2026). Bit-Exact AI Inference Verification Without Performance Tradeoffs. ICML 2026 Workshop on Technical AI Governance Research. Source recordSupports: limits of statistical verification · §1
  7. CAmodo Design (2026). AI 2040 Plan A — Verification SITREP. Amodo Design. Source recordSupports: status of red-teaming · status items
  8. BN. Kezins (2026). Adversarial Entropy Inflation Against Gumbel-Based Inference Verification. arXiv. Source recordSupports: independent attack on a weight-exfiltration detector built on the Token-DiFR Gumbel-margin statistic; scope limited to the exfiltration bound · abstract; introduction

I-0002JSONSource-checked 2026-09-23 · changed 2026-09-24Suggest a correction

Drafted with AI assistance and checked against the cited sources by an independent verifier. Expert review pending. Readiness assessed by the AI draft on 2026-09-23. How records are made.