Model Inference Verification: Zero-Knowledge Proofs and Anti-Tampering in Relay Chains

    This article examines how to verify that a model response was produced by an agreed model version under agreed inference rules on a specific input. It distinguishes source authentication, model identity claims, and computation correctness proofs; explains a conceptual zero-knowledge proof flow for inference; discusses the added complexity of token-by-token generation and sampling; outlines what relay-related problems can and cannot be detected; and proposes an enterprise architecture covering version registration, proof execution, evidence preservation, client validation, and privacy governance.

    Why Model Services Need Verification

    In a model invocation chain, users are often buying more than a single text generation. They are buying a model version, a specific inference configuration, and the capability expectations associated with that combination. However, users typically see only requests and responses. They cannot directly observe which weights the server loaded or which operations it executed.

    When requests pass through a proxy or relay service, this information asymmetry grows. The model name shown on a page, identity fields in a response, or even the model’s own answer to “What model are you?” may be configured or rewritten by the server. None of these independently proves what actually ran.

    For example, a user selects a high-capability model, but the relay sends the request to a lower-cost model and then changes the returned fields to the expected name. As long as the client has no additional verification mechanism, the invocation chain can still appear to work normally.

    Poorer answers do not necessarily mean the model was replaced. Context truncation, missing retrieval material, changed sampling settings, tool-call failures, and ambiguity in the user request can all affect results. A reliable verification scheme therefore cannot rely only on whether an answer “looks right.” It should verify a more precise fact:

    Was this response produced by the agreed model version, under the agreed computation rules, for this input?

    This is where cryptographic proofs can play a central role.

    Three Distinct Layers of Evidence

    Before discussing zero-knowledge proofs, it is necessary to separate source authentication, model identity claims, and computation correctness proofs. They solve different problems and cannot replace one another.

    1. Source Authentication: Confirming Who Issued the Response

    A service provider can digitally sign a request digest, response digest, timestamp, and model identifier.

    If the client holds a trusted public key, it can check whether the response record was modified and whether the signature really came from the corresponding issuer. If a relay modifies fields protected by the signature, verification fails.

    However, a digital signature does not automatically prove which model the server executed. It first proves that “the issuer made this claim.” If the issuer’s execution system or signing process has problems, the signature itself cannot reveal whether the internal computation was correct.

    Signatures are therefore useful for preventing tampering in the chain and supporting accountability, but they still leave trust in the issuer’s internal execution process.

    2. Model Identity Claims: Confirming What a Version Label Means

    A model name is only a label. Meaningful identity information should correspond to specific weights, architecture, vocabulary, and configuration that affect inference semantics.

    The same commercial name may correspond to multiple updated versions. The same set of weights under different quantization methods or context-handling strategies may also behave differently. If version registration is unclear, users will struggle to know what they are actually verifying, even if the response contains a model identifier.

    A verification system therefore needs a trusted version registration mechanism first, rather than merely adding a name field to the response.

    3. Computation Correctness Proofs: Confirming That Execution Satisfies the Agreement

    A computation correctness proof goes further: the server cannot merely make a claim. It must submit evidence that can be independently verified, showing that the input, model, and output satisfy a predefined computation relation.

    Zero-knowledge proofs are a cryptographic technique that can be used to build such mechanisms. They allow a prover to prove that an agreed relation holds without disclosing certain secret data.

    It is important to stress that zero-knowledge is not a technology that automatically identifies a model. It verifies the relation explicitly encoded into the proof system. If the relation definition omits critical steps, a successful proof cannot fill those gaps.

    A Basic Flow for Zero-Knowledge Inference Proofs

    A conceptual model inference verification scheme can be divided into three stages: version commitment, execution and proof, and client verification.

    1. Version Commitment: Fixing the Model to Be Verified

    The model provider first generates a cryptographic commitment to the model weights and associates it with a version description.

    A commitment can be understood as a binding that cannot be freely replaced: the provider first fixes a piece of data, and later proofs must correspond to that data. Specific schemes may organize large-scale weights through hash digests, chunked structures, or other commitment mechanisms.

    Trusted version registration should also specify:

    • The model architecture and its execution rules;
    • The input encoding and vocabulary version;
    • Weight precision and quantization method;
    • Context handling and truncation rules;
    • Output decoding and stopping conditions;
    • The scope of computation covered by the proof;
    • Public parameters required for verification.

    Not all of this information must expose raw content, but it must be appropriately bound into the verification relation. Otherwise, a relay might not replace the weights but could still change input processing or execution configuration and deliver a service different from what the user expects.

    At the same time, a commitment can only bind data. It cannot by itself prove that a set of weights has a certain capability. Which official version it corresponds to and which evaluations it has passed still require independent release and governance processes.

    2. Execution and Proof: Turning Inference into a Checkable Relation

    After receiving a request, the server executes inference and generates a proof.

    Conceptually, the verification relation can be written as:

    “There exists a set of model weights consistent with the registered commitment, along with an intermediate computation record satisfying the execution rules, such that this input produces this output.”

    This usually includes two types of information:

    • Public inputs: For example, the model commitment, input digest, output digest, execution configuration digest, and request identifier;
    • Private witness: For example, model weights, intermediate tensors, and other execution data required for the proof.

    The proof system checks the constraints among this information, not the quality of a natural-language answer.

    Model inference makes extensive use of floating-point operations, while many proof systems are based on different computational foundations from conventional floating-point execution. Engineering implementations may therefore require fixed-point conversion, quantization, or explicitly defined numerical operation rules.

    This raises a key question: is the proof covering the execution semantics of the original service, or a transformed, provable version? If there are differences, their impact must be explained. It is not valid to simply claim complete equivalence.

    3. Client Verification: Checking Whether the Proof Is Bound to This Request

    After receiving the answer and proof, the client performs checks based on the trusted version registration and verification parameters.

    In addition to the proof itself, the client must confirm:

    • Whether the model commitment belongs to an allowed version;
    • Whether the input digest corresponds to this request;
    • Whether the output digest corresponds to the content actually received;
    • Whether the configuration digest corresponds to the agreed execution method;
    • Whether the request identifier matches and whether there is a replay risk;
    • Whether the proof scope is sufficient for the current business requirement.

    A valid proof for a different request still cannot prove this invocation. Therefore, “the proof is valid” and “this invocation is trustworthy” are conditions that must be checked together.

    Proving Generative Models Is More Complex Than Proving a Single Function

    Text generation is usually a token-by-token process. The output of one step enters subsequent computation until a stopping condition is met.

    To prove a complete answer, the system must clearly cover which generation steps are included and how the final text is decoded from the token sequence. Proving only one layer of operations, a few tokens, or a local segment of computation does not naturally extend to verification of the entire request.

    Sampling is another important boundary. If the system only proves that a model computed a probability distribution but does not prove how the final token was selected, the output may still fail to satisfy the agreed generation process.

    Different scenarios can adopt different goals:

    • For deterministic decoding, prove that the output satisfies a fixed selection rule;
    • For random sampling, define how randomness participates in computation and constrain the sampling process;
    • For schemes that allow approximate computation, specify the approximation range and error rules.

    A fixed random seed does not by itself mean the source of randomness is trustworthy. If the business needs to prove that random numbers were not selected or manipulated, additional design is required.

    In addition, input digests must be generated according to agreed encoding and normalization rules. Differences in field order, whitespace characters, or message concatenation can all lead to digest mismatches. Clients and servers should use a consistent normalization process to avoid mistaking protocol differences for tampering.

    What Relay Problems Can Be Identified, and What Cannot Be Proven

    1. Cases That Can Be Detected or Rejected

    When model version registration is trusted, the proof system is reliable, and the coverage scope is sufficient, the following behaviors can be rejected or exposed:

    • Using an unauthorized model version in place of the agreed model;
    • Modifying response content that has been bound by the proof;
    • Reusing a proof from another request for the current request;
    • Changing inference configuration that is included in the proof constraints;
    • Submitting output that does not satisfy the specified computation relation.

    These capabilities depend on the upstream actually providing verifiable evidence and the client actually checking it. If the upstream does not provide proofs, response text alone cannot magically create the same level of verification.

    2. Cases That Are Not Directly Solved

    An inference proof is not the same as answer correctness. A specified model may still produce factual errors, omit conditions, or give unsafe advice.

    It also does not automatically prove that:

    • Knowledge material submitted to the model is true and reliable;
    • The retrieval process did not omit or replace material;
    • Tool execution results are accurate;
    • User input was not stored by other systems;
    • The entire business chain meets privacy and compliance requirements.

    For example, if a system passes incorrect retrieval results to the model as context, the answer may still be wrong even if model inference fully satisfies the proof relation.

    The value of a verification scheme is therefore to reduce trust dependencies in specific execution stages, not to stamp the entire system as “absolutely trustworthy.”

    An Enterprise Integration Architecture

    An engineering practice can divide the system into four parts: version registration, inference and proof, relay transmission, and client verification.

    1. Version Registration and Policy Management

    The registration service maintains model commitments, configuration definitions, and verification parameters. Clients obtain allowlists through trusted channels and record version updates, deprecations, and rollback information.

    Enterprises also need to define acceptance policies: which business processes require full inference proofs, which require only signed receipts, and which allow ordinary responses.

    Evidence of different strengths must not be uniformly labeled as “verified.” Interfaces and logs should clearly distinguish states such as “source authenticated,” “partial computation verified,” and “full agreed relation verified.”

    2. Inference and Proof Execution

    Proof tasks can be scheduled in association with inference tasks, but enough information must be retained to generate the witness required by the agreed relation.

    Proof generation is not a free additional field. It may increase computation, memory, storage, and data movement costs. The actual cost depends on model size, input length, output length, numerical representation, and proof system implementation. Uniform performance conclusions cannot be applied without verification.

    Before launch, measure first-token response time, full response time, proof generation time, verification time, and overall resource consumption separately.

    3. Relay Chain and Evidence Preservation

    A relay service must forward responses and proofs completely and avoid rewriting bound content. If format conversion is required, distinguish the original model output from the converted display content and establish a mapping between them.

    For streaming output, consider segmented verification or providing a final proof after the full response is complete. The former must handle state continuity between segments. The latter means that content shown to the user before final verification remains pending confirmation.

    4. Client Validation and Failure Handling

    The following pseudocode expresses validation logic only and does not correspond to any actual interface:

    1. Compute the normalized digest of this input
    2. Receive response content and proof material
    3. Check whether the request identifier matches
    4. Check whether the model commitment is in the allowlist
    5. Check input, output, and configuration digests
    6. Load the corresponding verification parameters
    7. Verify the agreed computation relation
    8. Accept, retry, or reject the response according to business policy

    Missing proof, failed verification, and temporary unavailability of a verification service should be treated as different events.

    High-risk business processes can reject unverified results. General auxiliary processes can allow an explicitly labeled degraded mode. Whichever policy is used, failures must not be silently converted into “success.” Otherwise, the verification mechanism will lose meaning in the actual chain.

    Privacy and Security: Do Not Treat Zero-Knowledge as Universal Protection

    The zero-knowledge property mainly concerns leakage of private witness in the proof protocol. It does not mean the entire inference service has no contact with user input.

    If the inference service receives plaintext requests, it may still read the input. If logs record prompts and answers, the proof mechanism does not automatically eliminate those copies. Transport protection, access control, data minimization, log redaction, and retention limits remain essential.

    In addition, public input digests do not necessarily hide the original text. Short and predictable content may be vulnerable to enumeration or guessing. Depending on the threat model, decide whether to use randomized commitments, limit evidence disclosure, or apply other privacy protections.

    Cryptographic systems also require security governance, including verification parameter management, implementation review, key protection, version revocation, and resource limits for malicious proof inputs.

    Conclusion: Anti-Tampering Depends on Proof Scope, Not Marketing Names

    The core of model verification is to break vague “trust in the provider” into checkable facts: which model version, which input, what execution rules, and which output.

    Digital signatures can strengthen source authentication, version commitments can fix model identity, and zero-knowledge proofs can further verify the agreed computation relation. The three can be combined, but they must not be conflated.

    For developers and enterprise users, the most practical path is to first establish version registration, request binding, and evidence verification mechanisms, then introduce inference proofs gradually according to risk and cost. When evaluating a scheme, ask: What does the proof cover? What does it not cover? Who provides trusted version information? And how does the system handle verification failure?

    Only when these questions have clear answers can “anti-tampering” become an auditable and executable technical safeguard, rather than just a label in a response.