File size: 1,488 Bytes
da8272e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ---
license: mit
tags: [from-scratch, opcode, ternary, trit, execution-verified, tiny]
---
# Binary-Trit Coder (Clay's opcode model)
A **from-scratch, 3.17M-param causal transformer** trained from *random init* on Issac's own opcode
substrate — a bijective ternary ("trit") op grammar: `join (+)`, `take (−)`, `weave (×)` over digit leaves,
prefix-notation, depth-2. No pretraining, no outside corpus.
## Honest benchmark — its OWN domain, not Python
The metric is **execution-verify rate**: sample a program, *run it for real*, check the model's answer.
| Test | Score |
|---|---|
| in-distribution (depth-2, fresh) | **98.6%** |
| OOD generalization (depth-3, never trained) | 47.0% |
**This is NOT a Python code-gen model.** It has an 18-token opcode vocab; it will score ~0 on
LiveCodeBench/SciCode (wrong domain). Its "learn from doing" signal is the verify-rate above.
## The chrysalis (capability layers, all execution-verified)
- variables/let-bindings (69.5% end-to-end; 100% with a calculator + show-work)
- ping-pong φ-lattice solver — recovers a hidden intermediate 100%
- calc-offload, dark-space inference, combustion candidate-spark
## Files
`scratch_coder.pt` (weights + vocab), `config.json`. Architecture + inference in
[github.com/issdandavis/loom](https://github.com/issdandavis/loom) `scratch_coder.py`.
*Thesis: coding is finite + bijective + execution-verifiable, so a small model from random init can MASTER
the mapping — proven here at 98.6%.*
|