Implementation · Cryptographic & computational
TOPLOC
TOPLOC is a hashing scheme from Prime Intellect that lets a verifier check whether an inference provider ran the model, prompt and precision it claims.
Also called TOPLOC v2
Summary
TOPLOC is a hashing scheme for checking that an inference provider ran the model, prompt and numerical precision it claims. During generation, the provider records a compact fingerprint of the model's largest last-layer activations. A verifier re-runs the sequence in one pass and checks that the fingerprints match within set tolerances. The tolerances absorb harmless differences between GPUs. The peer-reviewed paper reports catching every tested change to model, prompt or precision, with no false positives or negatives. Proofs take 258 bytes per 32 generated tokens. TOPLOC is open source. Prime Intellect, its developer, uses it to accept or reject work from untrusted computers in its decentralized training and data-generation runs. As of September 2026 no independent security evaluation has been published. The authors list attacks it cannot yet catch, such as speculative decoding with a cheaper model. Subtle changes are also harder to detect than large ones.
R2. The code is public and peer-reviewed tests ran on real GPUs, but only Prime Intellect relies on it and no one has evaluated its security independently.
Rubric assessment
- R1 met: the peer-reviewed paper sets out the design, the claim and the threat 1. The claim is that the provider used the stated model, prompt and precision. The threat is undisclosed changes to any of them.
- R2 met: a public MIT-licensed implementation exists 2. The paper reports results on A100 and RTX 4090 GPUs across several models, attention implementations and one- and two-GPU tensor parallelism 1. Prime Intellect also reports using it in a 32-billion-parameter decentralized training run 4.
- R3 not met. Criterion (a) asks for reliance by another party or production-grade availability. Prime Intellect's own production use might count 4 5. No other party is documented relying on TOPLOC for a verification decision. Criterion (b) asks for an independent evaluation, and it fails. No independent audit, red-team or peer-reviewed security analysis has been published. DiFR's comparison measures detection accuracy against communication cost 6. It is not a security evaluation.
- An independent public security evaluation, such as an audit, red-team or peer-reviewed analysis, that tests adaptive attacks like the spoofing and speculative-decoding cases the TOPLOC authors list.
- A party other than Prime Intellect relying on TOPLOC for a verification decision.
What it is
TOPLOC is a method for checking that an inference provider used the model configuration it claims 1. It hashes intermediate activations with a compact locality-sensitive hashing scheme, a kind of hash that gives similar outputs for similar inputs 1. Researchers at Prime Intellect and Together AI published it at ICML 2025 1.
The paper targets providers that run open-weights models on their own hardware and serve them through APIs 1. It considers four undisclosed changes such a provider might make 1:
- lower precision;
- KV-cache compression;
- altered weights, whether distilled, merged or pruned;
- an altered system prompt.
The code is MIT-licensed and installable as a Python package 2. Prime Intellect reports integrations with vLLM and a fork of SGLang 3.
How it works
The provider records the 128 largest-magnitude values of the last hidden layer, and their indices, as it generates 1 7. It encodes them compactly as a polynomial and stores the result as a proof 1 7. The verifier re-runs the full sequence in a single forward pass. It recomputes the same top values and compares them with the proof 1 7.
The verifier accepts if the number of exponent mismatches and the mean and median mantissa differences are all below set thresholds 1. The thresholds absorb reorderings of the computation caused by different GPU types, tensor-parallel layouts and attention kernels 1.
Prime Intellect's INTELLECT-2 run combined TOPLOC with other checks. Each inference worker generated a TOPLOC proof for every sequence 4. Validators also checked termination, the logit distribution and deterministic data sampling 4. Prime Intellect reports that a later version, TOPLOC v2, adds reproducible Gumbel noise so that verifiers can also check token sampling 5.
Evidence
- The TOPLOC paper reports detecting unauthorized changes to models, prompts or precision with 100% accuracy, and no false positives or negatives in its evaluations 1. The tests used Llama 3.1-8B-Instruct, INTELLECT-1-Instruct and Gemma-2-9B on UltraChat prompts. A model-differentiation test also included Llama 3.1-70B-Instruct 1. Proofs take 258 bytes per 32 new tokens 1.
- Validation held across A100 and RTX 4090 GPUs, one- and two-GPU tensor parallelism, and three attention implementations 1.
- Prime Intellect reports using TOPLOC to verify rollouts from untrusted inference workers when training a 32-billion-parameter model 4. Nodes whose files fail validation are "slashed and evicted" 4. Prime Intellect also reports using TOPLOC v2 to verify thousands of nodes in SYNTHETIC-2, a distributed data-generation run 5.
- The authors of DiFR, a related scheme, report that Activation-DiFR Pareto-dominates TOPLOC (does at least as well on both communication cost and detection accuracy) across their tested models 6.
- Amodo Design's status page lists TOPLOC among initial recomputation schemes now being tested on relevant hardware and models 9.
Limitations
The TOPLOC paper lists five limitations 1:
- The margin separating fp8 from bf16 generation is small, and the authors did not test KV-cache compression.
- The method cannot detect speculative decoding in which a cheaper model does the decoding.
- Inference consumers could mine for "unstable" prompts that tend to fail validation.
- An attacker could spoof last-layer activations by pruning intermediate layers or using a smaller model.
- Subtle modifications are harder to detect than large ones.
The original method checks activations, not token sampling 1. Prime Intellect reports that TOPLOC v2 adds sampling checks 5.
TOPLOC accepts approximate matches, so it shares the general limit of statistical schemes. It can bound an adversary's covert freedom but cannot eliminate it 8.
No independent red-team or audit has been published. All deployment evidence comes from the developer 4 5.
Known flaws
Published flaws, with their severity, kind and status. How flaws are rated.
Speculative decoding goes undetected
The TOPLOC authors state that it cannot detect speculative decoding. In speculative decoding, a provider decodes with a cheaper model and uses the larger model only for prefill.
Sources: [1]Last-layer activations could be spoofed
The TOPLOC authors name spoofing of the last hidden layer's activations as a potential attack. A provider could do this by pruning intermediate layers or by using a smaller model.
Sources: [1]Subtle modifications are harder to detect
The TOPLOC authors state that large changes to the model or prompt are straightforward to detect, but subtle modifications are harder. In preliminary experiments, the margin separating fp8 from bf16 generation was small. The authors did not test whether TOPLOC distinguishes types of KV-cache compression.
Sources: [1]Tolerance leaves covert bandwidth
TOPLOC accepts approximate matches. A check of this kind can put an upper bound on the covert bandwidth available to an adversary, but it cannot close that bandwidth. The limit applies to all statistical verification schemes.
Sources: [8]
Blockers
No independent security evaluation has been published, and Amodo Design rates red-teaming of recomputation schemes as 'not started'.
The verifier must run the model itself, which suits the paper's setting of providers serving open-weights models.
Technical detail
Show technical detail
- The prover commits to its activations every 32 generated tokens. It takes the top-k values of the last hidden layer, with k = 128 in the main configuration. It encodes their indices and values as a polynomial over an integer field, with a modulus chosen to be injective on the index set 1. The result is k two-byte coefficients. For Llama 3.1-8B-Instruct that is 258 bytes per 32 tokens, against 262 KB for storing the embeddings directly 1.
- The verifier decodes the proof and recomputes the top-k values with a prefill pass. It counts exponent mismatches and computes the mean and median mantissa differences. Validation succeeds if all three are below their thresholds. For bf16 the thresholds are 38, 10 and 8 1.
- The hardware tests used 1× A100, 1× RTX 4090 and 2× RTX 4090 GPUs, with FlashAttention 2, PyTorch SDPA and FlexAttention. The authors read the activations through a vLLM hook 1.
- Prime Intellect reports that validation is up to 100 times faster than the original inference 3 4. It reports that proof generation cut tokens-per-second throughput by about 1% in INTELLECT-2 4.
- Prime Intellect reports that TOPLOC v2 adds reproducible Gumbel noise for categorical sampling, so that verifiers can check token sampling. Version 2 also extends the scheme to pipeline-parallel inference 5.
- The package is published on PyPI as
toploc. The latest tag is v0.1.6 2.
Sources
- AJ. M. Ong et al. (2025). TOPLOC: A Locality Sensitive Hashing Scheme for Trustless Verifiable Inference. Proceedings of the 42nd International Conference on Machine Learning (PMLR 267), pp. 47196-47211. Source recordSupports: design, commitment and validation algorithm, thresholds, experiments, limitations · abstract; §3.1; §4; §5.1-5.7; §6.1-6.5
- BPrime Intellect (2025). PrimeIntellect-ai/toploc (GitHub repository). GitHub. Source recordSupports: public implementation, licence, release tag · README; releases
- CPrime Intellect (2025). TOPLOC: A Locality Sensitive Hashing Scheme for Trustless Verifiable Inference (blog post). Prime Intellect blog. Source recordSupports: provider-reported validation speed and SGLang/vLLM integrations · whole post
- BPrime Intellect Team et al. (2025). INTELLECT-2: A Reasoning Model Trained Through Globally Decentralized Reinforcement Learning. arXiv. Source recordSupports: provider-reported use in INTELLECT-2; checks; eviction of failing nodes; proof-generation overhead; validation speed · §2.3; §2.4.2
- CPrime Intellect (2025). SYNTHETIC-2. Prime Intellect blog. Source recordSupports: provider-reported TOPLOC v2 sampling verification, pipeline-parallel extension and pipeline replay in SYNTHETIC-2 · verification section
- BA. Karvonen et al. (2025). DiFR: Inference Verification Despite Nondeterminism. arXiv. Source recordSupports: independent comparison with Activation-DiFR · §6; Fig. comparing communication cost
- CAmodo Design (2026). Example Schemes for Verifying High-Stakes AI Agreements. Amodo Design. Source recordSupports: independent description of the TOPLOC scheme · TOPLOC section
- 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
- CAmodo Design (2026). AI 2040 Plan A — Verification SITREP. Amodo Design. Source recordSupports: status as an initial recomputation scheme under testing; recomputation red-teaming rated 'not started' · Recomputation algorithms and Recomputation red-teaming items