Core Concepts

AI Virtual Machine (AIVM)

The execution backbone of Theseus with tensor-native opcodes, deterministic execution, and cryptographic proof generation.

Architecture

LayerFunction
ExecutionStack-based dispatch, fixed-point arithmetic for deterministic tensor ops
MemorySandboxed storage for contexts, embeddings, temp tensors
Proof InterfaceGenerates Tensor Commit receipts for validators (~ms verification)
Syscall GatewayVerified, metered boundary crossing for external calls
State AnchoringMerkle root per block for light clients and cross-chain verification

Key Features

Tensor-Native Opcodes

Unlike traditional VMs, AIVM includes specialized operations for AI inference:

opcodes
TMATMUL    - Matrix multiplication for tensors
TEWOP      - Element-wise operations (ReLU, GELU, etc.)
TCUSTOM    - Call registered custom kernels
TLOAD/TSTORE - Tensor memory operations
TCOMMIT    - Generate Tensor-Commit proof
TSTREAM    - Streaming inference operations

Deterministic Execution

All randomness comes from a VRF (Verifiable Random Function), and all validations require full consensus. Any full node can reproduce receipts bit-for-bit. Tensor Commitments have deterministic validations.

Gas Model

Every tensor operation carries a linear gas price based on FLOPs:

Gas = γ × FLOPs(op)
MODEL_FEE = Σ Gas_op + Proof Overhead

A congestion multiplier keeps prices elastic depending on load.

Performance Metrics

ModelTokens/sec (A100)Est. Gas/Token
GPT-2180-20050K
LLaMA-7B90-100150K
LLaMA-13B50-60400K
GPT-3.515-25800K-1M
LLaMA-65B5-10≥900K

GPT-3 (175B) forward pass on 1024 tokens takes ~40-60ms on A100, generating ~1.2M FLOPs/token.

Agent Scheduling

Theseus juggles thousands of simultaneous model calls without favoring whales or spiking gas fees.

Priority score (stake + latency + fairness) → Epoch-bound queues prevent starvation → On-chain scheduler respects latency classes

RT
≤1 epoch
Interactive
≤3 epochs
Bulk
best-effort

Model Pipelining

AIVM allows tensor operations to feed outputs into the next in a single chaining operation:

pipeline
TLOAD(encoder) -> TMATMUL -> TCUSTOM -> TLOAD(decoder) -> TMATMUL -> TCOMMIT

Supports multi-model workflows (encoder-decoder, RAG, MoE) efficiently.

Comparison to EVM

The EVM isn't built for on-chain AI. It offers no tensor-aware opcodes and no native inference proofs, so hardware-specific rounding quirks can slip through unchecked.
FeatureEVMAIVM
Tensor operationsNo native supportBuilt-in opcodes
Inference proofsNot supportedTensor Commits
Agent autonomyRequires human keysNative sovereignty
Gas modelGeneric opcodesFLOPs-based for AI
Documentation