Verifying LLM Responses: Digital Signatures, Model Commitments, and Inference Proofs

    This article examines how developers can verify that a large language model response actually comes from the agreed model version and inference configuration. It separates the problem into identity substitution, response tampering, replay, configuration mismatch, and service quality risks, then explains the roles and limits of digital signatures, model commitments, zero-knowledge inference proofs, anti-replay binding, and streaming-output verification. It also outlines a staged enterprise approach and clarifies why verification of provenance and computation is not the same as factual correctness or data-governance assurance.

    1. The Trust Problem in Model Calls Is Not Just Whether the Answer Looks Right

    When developers call a large model through a proxy service or aggregation API, they can usually see the request endpoint, model field, output text, and usage statistics. They cannot directly observe which weights the server actually loaded or which inference configuration it used.

    This creates a core question: the user is paying for a particular model service, but does the response actually come from the model version both parties agreed on?

    For example, the caller selects a high-capability model, but the proxy layer routes the request to a lower-cost model. Or the server keeps the original model name but changes context truncation policy, inference budget, or quantization configuration. These situations can affect results, yet they are difficult to identify from an ordinary text response.

    Output quality fluctuation does not automatically prove substitution. Prompt changes, context differences, random sampling, retrieval quality, and tool-call results can all make the same model behave differently. The technical goal should therefore not be to “determine whether a model is real from one test question.” It should be to establish a verification mechanism that is inspectable, traceable, and explicit about the scope of its guarantees.

    2. First Define the Risks to Be Mitigated

    Different risks require different proof mechanisms. Mixing them together can easily overstate what a particular “anti-counterfeiting” technique actually does.

    2.1 Model Identity Substitution

    The caller specifies model version A, but model version B actually executes. A proxy layer can modify returned fields, and a prompt can make a model claim another identity. Model self-description therefore cannot serve as reliable evidence.

    2.2 Response Content Modification

    The upstream service did return a legitimate result, but an intermediate link deleted, inserted, or replaced part of the content. Here the requirement is to verify response integrity, not necessarily to prove the entire inference process.

    2.3 Replay of Historical Results

    An attacker obtains a real response and its valid credential, then uses them for another request. If the verification material is not bound to the current request, even a valid proof cannot show that the response belongs to the current call.

    2.4 Inference Configuration Does Not Match the Agreement

    Even with identical model weights, differences in tokenization, context handling, quantization precision, sampling strategy, and tool usage can produce different results. “Same model name” is therefore not a sufficiently precise technical definition.

    2.5 Service Quality Degradation

    Higher latency, shorter answers, or lower task success rates are service-quality issues. Identity verification can provide some attribution evidence, but it cannot replace long-term evaluation and runtime monitoring.

    Model verification therefore includes at least four layers: source authenticity, content integrity, request binding, and computation consistency. No single label can cover all of them.

    3. Digital Signatures: First Prove Who Issued the Response

    One relatively easy-to-understand approach is for the model service provider to digitally sign the response record.

    The provider holds a private key and signs information such as the request digest, response digest, model version, and issuance time. The caller verifies the signature using a public key obtained through a trusted channel.

    The record structure can be represented conceptually as:

    1. record_to_sign = {
    2. request_digest,
    3. response_digest,
    4. model_version_id,
    5. config_digest,
    6. request_nonce,
    7. issued_at,
    8. expires_at
    9. }

    This is only an illustration of design elements, not the interface of any existing service.

    If signature verification passes, the caller can confirm that the holder of the corresponding private key signed this record and that the signed data was not modified without detection.

    But digital signatures have a clear boundary: they prove that the signer made a statement, not that the computation described in the statement actually occurred.

    If the server signs “generated by model A,” the signature itself does not check whether the server really ran model A. This approach is therefore suitable for preventing link tampering and credentials forged by unauthorized parties, but it still depends on trust in the signer.

    Public-key distribution, key rotation, and key-compromise handling are also important. If the verification program directly accepts any public key temporarily supplied by the proxy layer, an attacker can create its own key and sign forged results, rendering the entire verification mechanism meaningless.

    4. Model Commitments: First Lock Down the Computation Object to Be Verified

    To further prove that “the specified model was actually executed,” we must first define exactly what is being specified.

    A commercial model name may correspond to multiple deployment versions, and recording only the name cannot create a strict constraint. A more practical approach is to establish cryptographic commitments for model-related data.

    In simple terms, a commitment is like sealing a fingerprint of some content in advance. Later, when providing a proof, the prover must show that the data used is consistent with the previously committed data, rather than substituting other content during verification.

    Model commitments, however, cannot consider only the weight files. Actual inference may also depend on:

    • network architecture and operator definitions;
    • weights and their encoding format;
    • tokenization rules and special tokens;
    • numerical precision and quantization method;
    • context assembly and truncation logic;
    • output selection and sampling rules.

    If only some of these are constrained, the claim should be accurately stated as “some computation elements were verified,” not broadly as complete model verification.

    A commitment can lock down an object, but it cannot by itself establish that object’s business identity. Which public service version a given weight commitment corresponds to still requires binding through trusted release channels, signed statements, or other governance mechanisms.

    5. How Zero-Knowledge Proofs Can Be Used for Inference Verification

    Zero-knowledge proofs allow a prover to prove that a well-defined computational relation holds without revealing certain secret data. For model inference, weights or intermediate computation data can be treated as private inputs, while request digests, outputs, and model commitments are treated as public verification information.

    Some succinct non-interactive proof systems can, under the relevant conditions, let a verifier check a computation proof with relatively low verification overhead. This does not mean that models of arbitrary scale can generate proofs at low cost.

    An abstract process can be divided into three stages.

    5.1 Stage 1: Define the Verification Relation

    First, what counts as “correct computation” must be specified.

    For example: the input is encoded according to specified rules, inference uses model parameters consistent with the commitment, and the output is obtained through specified numerical computations and output rules.

    Natural-language inference is not merely a check of a few file digests. Proving the complete computation requires bringing the relevant operators, data transformations, and constraints into the verification relation.

    5.2 Stage 2: Execute Computation and Generate a Proof

    The prover completes inference and generates a proof using the corresponding computation trace.

    The cost depends on model scale, computation representation, output length, proof system, and whether methods such as chunking are used. The verifier may be lightweight, but that does not imply that the prover is equally lightweight.

    5.3 Stage 3: Independent Verification

    The caller checks whether the proof matches the current request, response, model commitment, and configuration, and then uses the corresponding verification algorithm to confirm that the computational relation holds.

    Even if verification passes, the conclusion can cover only what has been defined and included in the proof. System prompts, external retrieval, tool calls, or post-processing logic that are not constrained do not automatically receive the same guarantee.

    6. Why Autoregressive Generation Makes Proofs Harder

    Large models usually generate text unit by unit: the previous output becomes the input to the next step. Proving a complete answer therefore requires handling the relationships among multiple states, not just proving one isolated computation.

    6.1 Numerical Computation Must Have Clear Semantics

    Real inference often involves floating-point numbers, low-precision formats, and quantized operations, while proof systems have their own mathematical representations. How to accurately express rounding, truncation, and nonlinear computations affects constraint size and implementation complexity.

    If a proof verifies only an approximate computation, the approximation rules and error bounds should be stated. It cannot be directly equated with another computation process that has not been verified.

    6.2 Random Sampling Also Needs Constraints

    The same input may generate different answers; this is a normal result of the sampling mechanism.

    To prove that output follows specified sampling rules, random inputs and their sources must be handled. Proving only that some output has a reasonable probability under the model is not the same as proving that the server actually performed sampling as agreed.

    6.3 Internal Caches and Cross-Step State Must Be Consistent

    To improve efficiency, inference services often reuse intermediate state. A verification scheme must ensure that this state comes from the correct source and is not replaced during chunked computation.

    Otherwise, even if local computations each appear legitimate, they may not form a complete and continuous inference chain.

    7. Anti-Replay: A Valid Proof Must Belong to the Current Request

    A genuine proof that can be reused indefinitely is insufficient for verifying an online service.

    The caller should include an unpredictable nonce in the request and require the response credential to be bound to that nonce. It should also consider binding the input digest, session context digest, configuration digest, and validity period.

    A reasonable verification order is:

    1. Confirm that the verification key or verification material comes from a trusted channel.
    2. Recompute the digests of the local request and response.
    3. Check the nonce, version, configuration, and time range.
    4. Verify the signature or computation proof.
    5. Store the verification result and necessary audit information.

    Digest computation must use consistent serialization rules. If field order, character encoding, whitespace handling, and structured-message boundaries are not uniform, legitimate records may fail verification, or the relationship between semantics and digests may become unclear.

    8. Streaming Output Cannot Verify Only the Final Sentence

    Conversational services often return output while generating. If a complete proof is provided only after output ends, users have already seen the content before verification completes, and may even have triggered subsequent actions.

    From an engineering perspective, three designs can be considered.

    Whole-response verification. Verification is performed uniformly after output completes. This is relatively clear to implement, but the verification result arrives later than display.

    Chunked verification. The response is split into ordered segments, integrity credentials are provided for the segments, and sequence numbers and previous-segment digests are bound to identify insertion, deletion, reordering, or truncation. It is important to stress that chunk signatures solve only the corresponding integrity problem; they do not mean that the model computation for each chunk has been proven.

    Tiered confirmation. Source and integrity checks are performed first, while heavier computation proofs are completed later. The interface and business logic must distinguish “source confirmed” from “computation verified” to avoid misleading users.

    For high-risk actions such as automatically executing instructions or writing production data, a safer strategy is to wait until the required verification level is met rather than treating unconfirmed streaming text directly as trusted instructions.

    9. How Enterprises Can Build Verification Capabilities in Stages

    Full inference proofs are not the first step for every business. A more practical approach is to build a tiered mechanism based on risk and cost.

    9.1 Basic Layer: Make Calls Traceable

    Record request identifiers, model version declarations, configuration digests, routing results, response digests, and error information. For sensitive content, use redaction, digesting, or controlled retention so that the audit system does not expand data exposure.

    9.2 Integrity Layer: Establish a Trusted Signature Chain

    Where the service supports it, verify upstream signatures, manage trusted public keys, and handle validity periods and key rotation. Specify which fields are covered by the signature and which are not.

    9.3 Quality Layer: Use Evaluation to Identify Anomalies

    Build a fixed evaluation set that reflects real business tasks, and continuously track metrics such as task success rate, format compliance rate, and latency distribution. Quality evaluation cannot prove model identity by itself, but it can help identify changes worth further investigation.

    9.4 Computation Verification Layer: Introduce It Gradually for High-Value Steps

    Prioritize computational steps with clear boundaries and controllable scale, then decide whether to expand coverage based on proof-generation cost, verification latency, and system complexity.

    When sampled verification is used, the sampling rules and residual risk should also be stated. A small number of successful request verifications does not mean that every unsampled request has received per-request computation assurance.

    10. Passing Verification Does Not Mean the Answer Is Correct

    Model verification addresses whether the output satisfies the agreed source and computation relationship, not whether the output content is factually correct.

    A rigorously verified model can still provide incorrect knowledge, unreasonable inferences, or unsafe advice. Proving that a model runs according to rules and proving that it solves a business problem are two different things.

    Likewise, inference proofs cannot by themselves prove that a service meets requirements such as not retaining data or not using data for training. These goals require mechanisms such as data governance, access control, contractual constraints, and compliance auditing.

    A complete trust system for large models should therefore manage at least four types of assurance separately:

    • source assurance: who issued the response;
    • computation assurance: which computational relations were verified;
    • quality assurance: how the model performs on target tasks;
    • governance assurance: how data and permissions are managed.

    The value of model verification is that it turns some hard-to-check verbal commitments into inspectable technical evidence. It is not an all-purpose “intelligence detector.” Only by defining the threat model, proof scope, and trust assumptions, and then combining signatures, commitments, computation proofs, evaluation, and auditing, can model calls move from reliance on trust alone toward evidence-supported trusted collaboration.