LLM Response Authenticity: How Zero-Knowledge Proofs Can Curb Model Substitution in Relay Chains
This article examines the trust gap in LLM API supply chains, where relay platforms, proxies, and gateways may silently substitute models, alter inference settings, or replay old responses. It outlines a threat model, explains why identity questions and response inspection are insufficient, and describes a three-stage commitment–proof–verification workflow using zero-knowledge proofs. It also covers gateway integration, independent verification, audit and key governance, performance and privacy considerations, limitations, and an enterprise checklist for reducing model substitution and silent degradation risks.
1. Background: Trust Gaps in the Model Service Supply Chain
As LLM capabilities reach business systems through APIs, the model invocation chain becomes increasingly long: user-facing applications, enterprise gateways, proxy services, relay platforms, and upstream model services. Any layer can change the model actually executed, the parameters used, or the context policy applied. A user may believe they are purchasing access to a higher-priced model, while the answer may actually come from a cheaper model. Alternatively, the model name may remain unchanged, but sampling parameters, context length, or system prompts may be silently adjusted, making the model appear “less intelligent.”
The core issue is not simply “service quality fluctuation.” It is the unverifiability of identity and configuration in the model service supply chain. Traditional methods often ask the model to state who it is, but system prompts can override identity descriptions. Checking returned fields, response structures, or stylistic features can at most show that a request reached some upstream interface; it cannot prove which model version or inference configuration actually ran behind that interface. Even if a model vendor claims there has been no degradation, users lack independently verifiable evidence.
The industry has therefore begun exploring an approach that turns “trusting a service provider” into “verifying a cryptographic proof.” Zero-knowledge proofs (zkSNARKs) are considered a candidate technology for response authenticity because they are verifiable and do not reveal internal details. It is important to stress that this is not a universal solution. It adds a verifiable provenance statement to model responses.
2. Threat Model: What Exactly Needs to Be Prevented
Before designing a response authenticity scheme, it is necessary to clarify attacker capabilities and proof goals. Typical threats include:
- Model substitution at the relay layer: A user requests a high-priced model, but the proxy layer forwards the request to a cheaper model and returns the answer unchanged.
- Silent configuration downgrade: The model name stays the same, but sampling temperature, maximum output, or context truncation policies are modified.
- Identity text forgery: A system prompt makes any model claim to be the target model.
- Caching and replay: Historical answers from a genuine high-priced model are reused for new requests, creating the illusion that the high-priced model is still in use.
- Field and signature forgery: Response fields, reasoning traces, or service identifiers are forged to impersonate an upstream service.
A reasonable authenticity protocol should prove the following statement: for a given one-time nonce, input digest, output digest, model version commitment, and inference configuration commitment, the output was generated by the model and configuration declared in the commitments. It does not prove answer quality, training data compliance, or the absence of backdoors. It only proves consistency between provenance and the declared configuration. The protocol should also assume that attackers cannot forge vendor keys, but can tamper with requests, replace routing, and replay old responses.
3. Why Traditional Detection Often Fails
Asking for identity is the most direct but least reliable method. System prompts can force a model to output a specified identity, and style imitation is not difficult. Field validation and response structure checks can at most prove that a request passed through some compatible interface; they cannot distinguish different model versions from the same vendor. Schemes based on reasoning-process signatures or upstream signatures can prove that a response came from a certain upstream, but they still cannot prove the specific model identity. Statistical fingerprints are affected by prompts, temperature, and context, lack stability, and are easy to evade.
The core problem is that traditional detection relies on observing external features, while model identity and inference configuration are internal service states. Without cryptographic binding, users can only guess. Response authenticity requires publishing internal states as commitments, binding outputs to those commitments, and allowing third parties to verify independently.
4. The Three-Stage Zero-Knowledge Proof Workflow
A zero-knowledge proof scheme can generally be abstracted into three steps: commitment, proof, and verification.
Step 1: Commitment. The model vendor generates commitments for the model version, weight digest, inference configuration, service identity, and other items, then signs and publishes them with the vendor’s private key. The commitment fixes “which model and configuration I claim to use” in advance and prevents later denial. The request side also injects a one-time nonce to prevent old proofs from being replayed.
Step 2: Proof. Without revealing weights or internal details, the inference service generates a zero-knowledge proof showing that a model and inference process satisfying the commitments produced the current output. In engineering terms, the inference computation or key validation logic can be circuitized. Because proving full inference is expensive, practical systems often use sampled verification, asynchronous proofs, batch proofs, or full proofs only for critical requests.
Step 3: Verification. Users or independent verification services use the vendor public key, public commitments, nonce, and input/output digests to verify the proof. If verification passes, the response is bound to the declared model version and configuration. If verification fails, the response should be rejected, downgraded, or flagged. Verification logic should be independent of the relay layer to avoid the situation where the same party acts as both player and referee.
The following schematic code only expresses the protocol relationship and does not represent a specific product interface:
commitment = Commit(model_manifest, weight_digest, config_digest, vendor_pubkey)req = {nonce,input_digest,output_digest,commitment_id}proof = Prove(commitment, model_witness, req)ok = Verify(vendor_pubkey, commitment, proof, req)
The witness contains internal evidence about the model and inference process, but it is not disclosed externally. A relay station can forward proofs, but it cannot forge a proof for a new output. If it substitutes the model, the proof will not match the commitment. If it tampers with the output, the output digest will not match. If it replays an old response, the nonce will be inconsistent.
5. Engineering Implementation: Integrating Verification into Gateways and Operations
For implementation, it is advisable to split the system into four layers:
- Request gateway layer: Inject a nonce for each request and record the input digest, output digest, model declaration, and proof metadata. Require the relay layer to pass through proof fields rather than stripping them.
- Independent verification layer: Cache vendor public keys and model manifests, perform signature verification and proof verification, and output labels such as verified, unverified, or failed. The verification service should be isolated from the routing service.
- Audit and alerting layer: Retain proof coverage, verification failure rate, model version distribution, and anomalous routing ratio. Set circuit breakers or manual review for critical business flows.
- Key and manifest governance layer: Manage vendor public key rotation, revocation, model version retirement, and configuration change records. When deployed on cloud, generic capabilities such as key management, logging, and monitoring and alerting from Baidu AI Cloud can be reused to integrate the verification chain into existing operations. The key remains protocol design and trust anchor management.
In terms of performance, proof generation is usually heavier than ordinary inference and should not be assumed to be zero-cost. For latency-sensitive business, a mode of “return the answer first, attach the proof asynchronously later” can be used. Apply full verification to high-risk requests and sampled verification to ordinary requests. On cache hits, a new nonce must be rebound, or the cache proof policy must be explicitly declared. In terms of privacy, the goal of zero-knowledge proofs is to hide weights and internal details, but engineering implementations still need to guard against side channels and key leakage.
6. Can It Govern Relay Dilution?
When upstream vendors cooperate and publish commitments, response authenticity can significantly raise the cost of relay dilution. Model substitution, output tampering, silent configuration downgrade, and replay of old responses may all be identified by the verification chain. A counterfeit model cannot generate a valid proof. Users can reject responses with no proof or failed proof. For enterprise procurement, proof coverage, model version declarations, key rotation, and audit rights can be written into contracts and SLAs.
But there are boundaries. First, the scheme is ineffective if the vendor does not cooperate. Second, the proof only covers the declared scope. If the vendor itself routes to a cheaper model and declares that honestly, it is a commercial strategy issue rather than “counterfeiting.” Third, the proof cannot prove answer quality. Fourth, a relay station may provide proofs only for some requests, so coverage must be examined rather than a single successful verification. Fifth, public key distribution and the verification client must be trusted; otherwise, an attacker may forge the verification interface. Governing relay dilution requires cryptographic proofs, gateway controls, contractual constraints, and continuous auditing working together.
7. Enterprise Practice Checklist
- During selection, require suppliers to disclose the model list, version commitments, proof coverage, independent verification methods, and key rotation mechanisms.
- Inject nonces uniformly at the gateway, store proofs and verification results, and ensure cache policies are bound to nonces.
- Apply full verification to critical business and sampled verification to ordinary business. Trigger alerts, degradation, or circuit breaking when verification fails.
- Prohibit internal platforms from silently replacing models. Cost optimization must not change the externally declared model and configuration.
- Monitor proof failure rate, verification latency, model version distribution, and anomalous routing ratio.
- Do not judge model authenticity only by asking for identity or by style. Include verifiable declarations in procurement and audit processes.
8. Conclusion
The core of response authenticity is changing “I believe this response came from a certain model” into “I can verify that this response is bound to a certain model commitment.” Zero-knowledge proofs provide a technical path for verifiable provenance, but they are a supply chain governance tool, not a universal solution. Developers should focus on nonces, proof coverage, verification independence, and replay protection. Enterprises should combine verifiable declarations, key management, log auditing, and vendor accountability to truly reduce the risks caused by relay dilution and silent degradation.
