
Verifiable inference for native-FP LLM APIs (vLLM, CUDA Graphs): folded ZK-Basefold + FracLogUp-GKR prover, zero-dep Rust verifier, and 28 Lean 4 modules.
Verifiable inference for production LLM APIs. By Liang Song.
English · 简体中文 · Project Homepage · Reviewer Guide · Paper (PDF) · Specs (01–11)
When you call a closed-weight LLM API, you have no cryptographic proof of what ran behind the endpoint: whether the server routed your request to a smaller model under load, quantized a bf16 checkpoint to int4, skipped layers, truncated context, or shortened a hidden system prompt to save reasoning tokens.
FlashProve-Next attaches a verifiable zero-knowledge-masked proof to an API response under two constraints:
bf16/fp8/mxfp4 with fp32 GEMM reductions), with temperature/top-$p$ sampling, FlashAttention, CUDA Graphs, continuous batching, and prefix caching. Proving runs asynchronously after streaming finishes.CoT) text, intermediate activations, and multi-turn encrypted state. In v1.0.0, dense full-reply profiles still expose coarse geometry (layer/width tier); cross-architecture hidden-table privacy is deferred to v2.FPN2 verifier (~10 ms per 8 MiB container)Verify an exact 8,388,608 B zero-padded FPN2 container (fpn2-llm-std-v1, Q = 72, 64-row reference circuit) using both the zero-dependency #![forbid(unsafe_code)] Rust CLI (core/) and the detached pure-Python reference (verifier/python/, AST-tested for zero prover imports):
pip install numpy # needed by the Python harness; Rust fpn-verify has zero dependencies
cargo build --release --manifest-path core/Cargo.toml --bin fpn-verify
python demo/run_v1_relation2_demo.py
On an unloaded Apple M1 CPU, the honest 8 MiB container verifies in ~10 ms (warm Rust CLI) and ~110 ms (Python), while all 8 negative checks (E_CIRCUIT_UNPINNED, E_CIRCUIT_PINNED, E_STMT_UNPINNED, E_STMT_PINNED, E_PADDING, E_LENGTH, gate forgery E_SUMCHECK, range forgery E_GKR_ROOT) reject identically across both verifiers and re-proving shares 0 aligned 64-byte private blocks.
Qwen3-0.6B API proof bundles (demo/run_demo.py)Verify bundled proofs (Stage 1 FPNZK1 gzip format, ~10.1 MiB each) generated by unsliced Qwen/Qwen3-0.6B (L = 28, d = 1024, V = 151,936) on live vLLM 0.33 (CUDA_VISIBLE_DEVICES="" is enforced automatically; ~30–145 s total on Apple M1 depending on CPU load):
pip install -e ".[tokenizers]"
python -m flashprove_next.build_ext # optional C++ Goldilocks speedup; pure NumPy works too
python demo/run_demo.py
Checks 3 honest replies (VERIFIED: hidden system prompt + hidden <think> CoT, Turn-1 multi-turn St_prev -> St_new chain, strict JSON-Schema constrained decoding) and 6 attacks (REJECTED: live int4-quantized server, missing --allow-reduced-security, altered reply token, replayed nonce, tampered St_prev, injected schema). Bundled proofs use the compact qwen3-0.6b-demo profile (4 + 2 draws); production profiles use NI-315 (210 + 105) or ExtSeed-153 (102 + 51).
v1.0.0)One boundary is worth stating upfront: in v1.0.0, the zero-dependency Rust binary verifies self-contained FPN2 containers (Relations 1–6), whereas full 12-round interactive LLM replies (FPNZK2) still run through the Python verifier.
| Format | What It Proves | Prover | Verifier | Lean 4 Coverage |
|---|---|---|---|---|
FPN2 (binary, fixed size) | Self-contained Relations 1–6: Relation 2 (8 MiB 64-row demo), Relation 4 AIR, Relations 5–6 (32×1024 tiles, incl. live vLLM 30B MoE) | prover/fpn_prover/backend/ | Zero-dep Rust core/ (fpn-verify, 10–24 ms) & detached Python verifier/python/ | Executable verifiers for Rel 1, 3–5 (131/131 golden vectors) + conditional Fpn2EndToEnd (THEOREM.md §2.4); Rel 2 & 6 open |
FPNZK2 (8 MiB transitional zero-padded JSON) | Full 12-round interactive replies (Qwen3-0.6B ExtSeed-153, Qwen3-4B dev 4+2, 14/14 cheating matrix) | flashprove_next/reply_zk.py → folded_engine.py (ZK-masked; simulator open) | Isolated Python CPU verifier verifier/fpn_verify.py (10.8 s 0.6B / 7.2 s 4B; shares Python stack) | Protocol-level RBR, sampling, mask, and blinding modules only; no executable Lean verifier yet |
FPNZK1 (Stage 1 gzip) | Historical v0.3.0 NI-315 (149.8 MB) & bundled laptop demo (demo/run_demo.py) | Legacy flashprove_next/zk_flat.py (--backend legacy) | Isolated Python CPU verifier verifier/fpn_verify.py | Protocol-level RBR, sampling, mask, and blinding modules only |
Anthropic's FlashProve showed that closed-weight 400B MoE inference can be proved without hardware enclaves by proving exact full-layer execution of a deterministic 4-bit integer surrogate. FlashProve-Next targets a different point in the design space: keeping native floating-point production serving unchanged.
| Dimension | FlashProve (2026-11) | FlashProve-Next |
|---|---|---|
| Guarantee | Exact full-layer execution of a committed 4-bit integer surrogate | Cost-weighted spot-check threshold ($\sigma = \rho = 0.5$): NI-315 ($\varepsilon \le 2^{-40}, Q \le 2^{64}$) or external-seed ExtSeed-153 ($\varepsilon \le 2^{-20}, Q_{\rm samp} \le 2^{30}$ with pre-recorded C_pre) |
| Committed model | Deterministic 4-bit integer surrogate | Deployed bf16/fp8/mxfp4 weights, per-operator rounding bounds, hidden prompts, and sampling key |
| Serving stack | Greedy or fixed-seed integer execution across all layers | Native FP (fp32 GEMM reductions), random temperature/top-$p$ sampling, FlashAttention, CUDA Graph, continuous batching, prefix caching |
| Privacy | Weights only; architecture public; no hidden prompts, CoT, or multi-turn state | Weights, hidden prompts, hidden CoT, activations, and multi-turn state (v1.0.0 dense reply_zk fixes coarse geometry per profile; cross-architecture hiding in v2) |
| Commitment lifetime | Exhausts after 688,127 batches | Non-depleting static RS commitment opened inside proofs (HCO, specs/09) |
| Proving structure | Proves every layer of every token | Proves a fixed cost-weighted sample (315 or 153 draws), independent of depth $L$ |