The Tensor Commitment Protocol is the security base of Theseus, providing public verifiability and tamper-proof computations with proven efficiency of <1% overhead.
Tensor-commit protocols enable verifiable ML which focuses on proving that a machine learning model was executed correctly. Traditional verification methods like recomputing the entire model are prohibitively expensive, especially for large language models.
Theseus' Tensor Commits provide batch verification and reduce the opening costs while keeping the computation overheads small. This is achieved through a novel application of KZG commitment schemes extended to multi-dimensional tensor structures.
Minimal impact on inference performance. Generating proofs adds less than 1% to the total computation time, making it practical for production workloads.
Fast cryptographic verification. Verifiers can check proofs in milliseconds, enabling thousands of validators to audit simultaneously without bottlenecks.
A Terkle tree (tensor Merkle tree) is a Merkle tree whose leaves are sub-tensors, and whose internal nodes carry tensor commitments instead of hash values. Tensor-commit takes advantage of Terkle trees to compress and reduce the proof size, while adding proof of memberships for large models (with millions of parameters).
Theseus uses Terkle trees by partitioning the full tensor into blocks. For a weight tensor with dimensions d₁ × d₂ × ... × dₖ:
When a model is registered, the prover uploads the model weights along with their Tensor Commit. This commitment is stored on-chain as the canonical fingerprint of the model.
During inference, the prover (a specialized node with high-end hardware) runs the full forward pass and emits a Tensor Commit proof. The proof includes:
Every verifier in the active set verifies every single inference. The process:
| Operation | Latency | Proof Size | Gas Cost |
|---|---|---|---|
| TMATMUL 512x512 | 4.1 ms | 230 KB | 18K |
| TSTREAM 4x512 | 8.6 ms | 400 KB | 27K |
| TCOMMIT 70B | 22 ms | 470 KB | 120K |
* Gas costs based on base-load multiplier m = 1.0. Actual costs scale with network congestion.
Input embeddings for tokens are committed polynomially with positional encoding leveraging homomorphic properties, allowing efficient verification without revealing input content.
Using polynomial commitments, we verify mean and variance computations. Inverse square root approximation is efficiently handled via polynomial approximation.
Attention computations (query Q, key K, and value V matrices) are committed individually. Attention scores and softmax weights are polynomially approximated for efficient verification.
Residual paths are easily handled via commitment homomorphism: Comᵣ = Comₓ₍ℓ₎ · ComA. Each subsequent layer leverages prior commitments, enabling efficient recursive proof verification.
Sparse expert activations are committed and verified efficiently using sparse tensor commitments. Only activated experts contribute proofs, significantly reducing verification complexity.
Theseus' tensor commitments uniquely support scalable, transparent, and cryptographically sound verification for LLM inference. This novel commitment mechanism positions Theseus as the ideal blockchain solution for deploying trustworthy, decentralized, and verifiable large language models.