Skip to content

Explore proof of inference and model-serving attestation #1233

Description

@i386

Context

Steven Mih raised an important discussion about proof of inference: how can a client tell whether a node generated a response with the model it advertises, rather than substituting a cheaper quantization or different weights?

Sources:

Why this matters

A human-readable model name is not a strong identity claim. A node could advertise a full-precision or higher-quality model while serving a cheaper quantization, modified weights, a different tokenizer, or a different runtime configuration.

“Proof of inference” is best understood as three separate claims:

Claim Example question Candidate evidence
Model identity What exact model/package does the node claim to serve? Content-addressed package and artifact digests
Execution identity Did this request actually run with those bytes and this runtime? Signed request/response receipt, ideally TEE-backed
Behavioral identity Does the output behave like the claimed model? Statistical fingerprints or reproducible verification

No single mechanism solves all three.

Proposed model identity

A model name such as Qwen3-8B is too broad. The advertised identity should include an immutable package or manifest digest covering:

  • canonical package manifest;
  • source model identity and revision;
  • quantization/distribution;
  • tokenizer identity;
  • all selected artifact digests;
  • generation/runtime defaults;
  • Skippy/llama ABI version;
  • accepted equivalence classes, if quantized variants are intentionally allowed.

A useful conceptual identity is:

model_package_digest =
  sha256(canonical_manifest + artifact_digests + runtime_abi)

Mesh-llm already has useful building blocks here. Layer-package manifests record source identity, per-artifact SHA-256 values, layer coverage, and ABI compatibility. Production references should use immutable package commits/tags rather than moving branches. See the model package specification.

A quantized model is not inherently fraudulent. The fraud is advertising an identity outside the declared package or accepted equivalence class. The policy should make that distinction explicit.

Per-request evidence

A node could produce a receipt covering the request and response:

receipt = sign_node_key(
  client_nonce,
  request_digest,
  model_package_digest,
  runtime_digest,
  generation_parameters,
  output_digest,
  timestamp
)

Important details:

  • The client contributes the nonce and request digest so the node cannot fabricate or replay a request.
  • The request digest should be canonicalized and may protect prompt privacy without disclosing the raw prompt.
  • The output digest commits the node to a particular response; the client can retain the response and verify the digest.
  • A node signature authenticates the statement but does not make a dishonest statement true. The signing key must be bound to a trusted node identity, owner policy, or hardware attestation.
  • Split inference needs evidence from participating stages, or a coordinator receipt that commits to each stage package/runtime digest and execution order.

Statistical fingerprints

Fingerprinting is a practical, lower-cost verification layer:

  • TOPLOC proposes compact locality-sensitive hashes over intermediate activations and reports perfect detection in its evaluated experiments.
  • DiFR reports detecting 4-bit quantization with AUC above 0.999 within 300 output tokens.

These should be treated as probabilistic spot checks, not universal cryptographic proofs. They may depend on the model family, prompt/challenge design, sampling configuration, hardware, and detector training distribution. A known public challenge could also be gamed by a sufficiently adaptive provider.

Potential mitigations include verifier-selected nonces, unpredictable challenge prompts, periodic audits, and a mesh policy that records confidence and false-positive/false-negative behavior rather than exposing a binary “proven” label.

TEE-backed attestation

A trusted execution environment could provide stronger evidence that a measured inference binary loaded a specific model/package digest and generated the response. However:

  • remote attestation proves a measured program/environment, not automatically that the program is correct;
  • the measurement must cover model loading, runtime libraries, configuration, and relevant GPU execution;
  • hardware/vendor support, availability, performance, side channels, and key management need consideration;
  • TEE evidence should be represented separately from statistical fingerprints.

The existing mesh-llm release attestation is a useful precedent, but it is build provenance only. It does not prove that a remote process is running unmodified code or that the claimed model was used at request time. See mesh requirements and release attestation.

Capsule history

The “capsule history” idea could make evidence portable and useful for later review. A capsule could be a signed, append-only record containing:

  1. node identity and advertised capabilities;
  2. model/package manifest and artifact evidence;
  3. runtime/build/TEE evidence, where available;
  4. client request commitment and nonce;
  5. per-request receipt and output commitment;
  6. fingerprint/challenge result;
  7. later verification, dispute, or reputation outcomes.

This would let a client or mesh operator distinguish:

  • what a node advertised;
  • what evidence it presented;
  • what was actually checked;
  • how strong that evidence was;
  • whether later evidence contradicted the claim.

Proposed progression

  1. Define the threat model and assurance levels.
  2. Make model/package identity precise and advertise immutable digests.
  3. Add nonce-bound signed inference receipts.
  4. Add optional statistical challenge/fingerprint verification.
  5. Add TEE evidence for high-assurance nodes.
  6. Store the resulting evidence in a signed capsule history.
  7. Define trust, privacy, replay-prevention, split-inference, and dispute-resolution rules.

Proposed next steps

  • Schedule a call/discussion with Steven Mih to understand the proposed TOPLOC/DiFR and attestation approaches in more detail.
  • Agree on the threat model and assurance levels.
  • Inventory the existing package, identity, release-attestation, and receipt primitives.
  • Draft a minimal design for digest advertisement plus nonce-bound inference receipts.
  • Decide whether to prototype statistical verification, TEE verification, or both.

This issue is for design exploration and coordination; it does not yet commit mesh-llm to a particular cryptographic or hardware-attestation approach.

Client nonce delivery strategy

Nonce-bound evidence needs a stable request identity before receipts can make useful replay or provenance claims. The OpenAI frontend should implement the following contract:

  1. Resolve exactly one canonical RFC 4122 UUIDv4 nonce at the outer logical-request ingress. Preserve a valid client value; otherwise mint a fresh value.
  2. Derive origin and provenance at a trusted boundary. Never trust a public caller-provided origin marker.
  3. Carry the same typed nonce context through target selection, retries, request reconstruction, pipeline or MoA dispatch, and authenticated remote mesh hops.
  4. Echo the resolved contract on every response path, including JSON, streaming, remapped upstream errors, locally synthesized errors, and model discovery.
  5. Keep the evidence claim narrow. A client-supplied nonce proves client contribution to freshness; a frontend-minted nonce provides request correlation but must be labeled as such.

Delivery is split into two child issues:

This split allows the bounded security and propagation fixes in #1397 to land while retaining complete response coverage and trustworthy provenance as explicit follow-up work.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions