Tokenizer
Build a character-level vocabulary and encode/decode strings to and from token ids.
Wrap cached GPT inference in Merkle commitments and spot checks, then simulate a decentralized committee with rewards and slashing.
Every source step is its own lesson with intuition, concepts, correctly rendered MathJax mathematics, implementation, tests, mistakes, and a checkpoint.
Build a character-level vocabulary and encode/decode strings to and from token ids.
Implement token and positional embeddings, the linear projection primitive, and a single-head causal self-attention module that reads and writes a KV cache.
Assemble the position-wise feed-forward network, layer normalization, residual add-and-norm sublayer, and the full transformer block that updates the KV cache.
Project hidden states to vocabulary logits, run prefill over a prompt, and generate tokens one decode step at a time while recording per-step state.
Hash tensors and decode-step states into leaves and build a Merkle tree with inclusion-proof generation and verification.
Run the prover to produce outputs and commitments, assemble the public transcript, and implement seeded spot-check verification that re-executes audited decode steps.
Tamper with transcripts, derive the detection probability under k audits and a corruption fraction, and quantify verifier cost as a fraction of full re-execution.
Sample verifier committees, aggregate votes by majority, implement rewards and slashing, and run honest and malicious rounds reporting end-to-end verification cost.