The Pipeline

Every inference begins with tokens. But tokens alone are insufficient for deterministic execution. They must pass through a verification pipeline that ensures stability and reproducibility.

Token Serialization

Raw prompt text is tokenized, but tokenization alone does not guarantee determinism. The serialized representation must be canonical:

Without canonical serialization, small variations in formatting produce different hashes, breaking reproducibility.

Cryptographic Binding

The canonical input is hashed using BLAKE3:

input_digest = BLAKE3(canonical_json(tokens))

This digest becomes the cryptographic fingerprint of the input. Any change to the input—even a single character—produces a completely different hash.

Seed Derivation

Deterministic execution requires deterministic randomness. HKDF-SHA256 derives an execution seed from the input digest:

exec_seed = HKDF-SHA256(
  input_digest,
  model_version,
  execution_context
)

The seed is deterministic: same inputs → same seed. This enables reproducible model behavior without storing random state.

Execution Flow

The pipeline follows this sequence:

  1. Tokenization: Prompt text → token IDs
  2. Canonicalization: Tokens → canonical JSON
  3. Hashing: Canonical input → BLAKE3 digest
  4. Seed Derivation: Digest → HKDF execution seed
  5. Inference: Seed + Model → output tokens
  6. Receipt Generation: Input digest + Output digest → cryptographic proof

Each step is deterministic. Replay is bit-perfect.

Audit Trails

Token-level trails extend the pipeline to capture routing decisions:

These decisions are logged and bound into the execution receipt, enabling hostile verification by third parties.

The Physics Analogy

Tokens flow through the system like particles through a physics simulation:

The laws of motion are the runtime constraints. Determinism is the conservation principle.

AdapterOS Implementation

AdapterOS enforces this pipeline at the runtime level:

Patent application filed. Under review. Not an issued patent.

References


This is a canonical research note. For an interactive visualization, see ai.jkca.me/prompt-physics.