Zero-Knowledge Proof Provenance for AI Responses: Principles, Testing, and Limits

    Model relay and aggregation platforms face two recurring trust problems: users may receive answers from a cheaper model than the one they paid for, and a system prompt can make an arbitrary model claim another model’s identity. This article explains how zero-knowledge proofs, specifically zkSNARKs, can attach independently verifiable evidence to each inference. It covers the proof’s public inputs and witness, what the proof can and cannot establish, the prover/verifier/registry/governance components, a realistic verification test plan, suitable deployment scenarios, and operational limits such as proving overhead, version changes, trust roots, verifier defects, denial-of-service risk, and the distinction between correct computation and trustworthy output.

    1. Why AI Responses Need Provenance

    Model relay and aggregation platforms commonly face two problems. One is model substitution: a user pays to call a high-performance model but actually receives an answer from a cheaper model. The other is identity impersonation through system prompts, where an arbitrary model is told to declare that it is some target model.

    Most existing detection methods rely on indirect inference. Comparing answer style, checking returned fields, and validating reasoning-process signatures can provide only probabilistic judgments, not evidence that can be independently verified. Model vendors also lack strong ways to prove their own claims. When users report that a model has become worse, a vendor may not have changed the weights, yet it still struggles to produce a record that a third party can accept.

    Zero-knowledge proof schemes attempt to solve this problem directly. They do not require a third party to trust a platform’s statement. Instead, each inference carries a mathematical proof that can be checked independently.

    2. Core Principle: Proving the Computation

    The scheme uses zkSNARKs (succinct non-interactive zero-knowledge arguments). While generating text, the inference engine also generates a proof. The proof states that there exists a set of private witness data such that, given commitments to the model weights, input, and output, the inference computation satisfies the circuit constraints.

    The public inputs typically include the following:

    • A commitment to the model weights, such as a weight hash or circuit fingerprint.
    • A hash commitment to the input.
    • A hash commitment to the output text.
    • Commitments to sampling parameters and the random seed.

    The witness data includes the model weights in plaintext, intermediate activations, and the sampling trajectory for each step. The verifier does not need to hold the weights and cannot see the intermediate activations. The design goal of the proof is to complete verification without revealing this content.

    The scope of the proof must be stated clearly. When verification passes, one can confirm that the output, the input, and the weights bound by the commitments satisfy the constraints of the inference circuit. The proof alone cannot confirm the following:

    • That the output is correct or truthful.
    • That the model’s training data is compliant.
    • That the model weights contain no backdoor.

    Whether the weights have been replaced must be constrained by a commitment registry and by a trusted execution environment (TEE) or trusted setup. The proof itself cannot replace these trust roots.

    Autoregressive generation introduces an additional problem. Each token depends on prior context and on the sampling process. If only the forward computation is proven but the random seed and sampling trajectory are not committed, the verifier cannot confirm that the final token was actually selected by that model under the sampling rules. Implementations therefore need to commit the random seed and sampling steps and include them in the proof.

    3. Components and Call Flow

    A verifiable inference system usually contains four components:

    • Prover: Associated with the inference process, it generates a proof after the forward computation completes. It may use specialized acceleration hardware or batching, and it may consume GPU resources, affecting inference throughput. Service-level objectives and degradation strategies should be defined before launch.
    • Verifier: Receives the response and proof and performs verification. Verification overhead depends mainly on the size of the public inputs and the proof system used. It should be measured for the specific implementation rather than assumed from a universal conclusion.
    • Registry: Stores the circuit fingerprint and weight hash for each model version, preventing proofs from being replayed across versions.
    • Governance: Issues and revokes proof policies. It can configure, by model version or API key, whether a proof is mandatory.

    A typical flow is as follows:

    1. User request → Gateway authentication → Inference on specified model → Text generation
    2. ↓
    3. Proof generation (linked to inference) → Response with proof
    4. ↓
    5. User side / gateway → Check commitments in registry → Verify proof → Pass → Accept result
    6. → Fail → Reject and alert

    When validating on the user side, it is not enough to verify the proof itself. The user must also confirm that the model commitment referenced by the proof actually corresponds to the model version claimed by the platform. This step depends on the trustworthiness of the registry.

    4. Test Design: What Should Be Verified

    Public test data often includes figures such as constraint counts and per-call latency. Without hardware, proof system, batch size, and statistical methodology, these figures cannot be reproduced and should not be used directly for decisions. This article does not cite such figures.

    The test design itself is more valuable. A minimal validation set can include the following:

    • Tamper test: Modify one character in the response and observe whether the proof fails.
    • Cross-model binding test: Combine another model’s output with the current proof and observe whether verification rejects it.
    • Substitution forwarding test: Obtain a valid proof, replace the output, and forward it downstream. Observe whether the output hash mismatches.
    • Replay test: Use the same proof for another request or another model version. Check whether the registry and domain separation mechanisms reject it.
    • Commitment binding check: Confirm that the sampling seed and input commitment are included in the public inputs, not merely stored in logs.

    In these tests, a preimage attack on the output hash is infeasible within a 256-bit space. The real risks are at the implementation level, such as reused commitments, missing domain separation, defects in verifier code, and delayed registry updates.

    Test conclusions should describe results only under actual conditions—for example, “under these experimental conditions, responses with tampered output failed verification.” Without a complete record of the environment, such results should not be generalized into universal claims.

    5. Applicable Scenarios and Prerequisites

    Relay and aggregation platforms are the most direct use case. A platform can require upstream providers to supply proofs and enforce verification at the gateway. This can reveal internal behavior that routes requests to cheaper models. However, the mechanism can only prove that “the computation was performed by the registered model commitment.” The prerequisite is that users can confirm which model version that commitment corresponds to.

    In enterprise procurement audit scenarios, a privately deployed gateway can embed a verifier and retain the proof and response for each call. These records can support internal audits, but they still need to be combined with access control and log protection.

    In multi-model routing scenarios, an attached proof can show which model version actually handled a given request. This can help reduce user concerns about random downgrades.

    Identifying traces of model distillation is a scenario that requires caution. A platform can use statistical analysis of unusually high-frequency call patterns to help detect suspicious behavior, but these patterns alone cannot prove distillation. Such analysis also involves user call data and must undergo privacy and compliance review.

    6. Limitations and Risks

    • Real-time performance: Proof generation is expensive. For full inference of a 7B-class model, general proof schemes usually take much longer than inference itself, making high-concurrency and low-latency scenarios difficult to support directly. Edge devices and mobile clients are also unsuitable.
    • Version updates: After a model iteration, the circuit must be recompiled and the registry updated. Before the update is complete, mismatches may occur, such as a new model paired with an old proof or an old model paired with a new proof.
    • Trust root: If weights are replaced and the inference environment is controlled, the proof cannot detect tampering. TEEs, trusted setup, and independent audits are needed to fill this gap.
    • Verifier implementation: Defects in verification code may allow invalid proofs to pass. The verifier itself needs auditing and testing.
    • Denial of service: Attackers may flood requests and exhaust prover resources, so rate limiting and quota controls are required.
    • Correct computation is not the same as trustworthy output: A malicious model can faithfully perform the computation while producing harmful or misleading content.

    7. Questions to Confirm Before Deployment

    When evaluating this scheme, consider the following questions first:

    • Can zkSNARKs verify large language model inference? The answer depends on model size, proof system, and circuit optimization. For full-scale large models, the approach is still mainly in research and small-scale trials.
    • What prerequisites are required? At minimum, a trusted registry of weight commitments, commitments to the sampling process, a correctly implemented verifier, and a management process for model version updates.
    • How should LLM inference proof cost be estimated? It should be measured on the target model and hardware with the actual proof system, tracking proof-generation throughput, latency, and GPU usage.
    • What are the prerequisites for model provenance? Users need access to a trusted list of model commitments and must be able to independently verify proofs.

    Conclusion

    Zero-knowledge proofs provide an independently verifiable technical path for AI response provenance. With a trusted registry of weight commitments, committed sampling processes, and a correctly implemented verifier, they can reduce some risks of impersonation and substitution. They cannot solve output truthfulness, training compliance, or backdoor problems, nor can they replace full auditing and governance. Before adoption, teams should measure performance on the target model and hardware and clearly define the risk scope the system is intended to cover.