Spoken-English math to Typst with a small (~8M parameter) encoder-decoder Transformer trained from scratch, following the build guide (Path A only). ## What's in it - `generate.py` / `render.py` / `ast.py`: random expression trees rendered to Typst (deterministic) and English (random phrasings); every Typst string is compile-checked, split by a hash of the Typst string - `tokenizer.py`: byte-level BPE shared by both sides - `model.py`: `nn.Transformer` seq2seq with `encode()` / `decode()` for inference - `train.py`: teacher forcing, AdamW, warmup + cosine, overfit-100 sanity check, checkpoints - `translate.py`: greedy decoding CLI (`uv run isotope "..."`) - `evaluate.py`: exact match + compile rate on the synthetic test split and `eval/hand_test.jsonl` - `run.sh`: whole pipeline; `./run.sh --quick` is a 2-minute smoke run - `AGENTS.md`: commit and workflow rules for agents ## Checked - `uv run pytest` (8 tests: Typst compiles, English is unambiguous, tokenizer round-trips, causal mask) and `ruff check` pass - `./run.sh --quick` and the full `./run.sh` run end to end on an M-series Mac Reviewed-on: #1 Co-authored-by: Paul Tal <[email protected]>
687 B
687 B
Agent instructions
Git
- Do not add AI attribution to commits: no
Co-Authored-By:trailers for AI tools, no "Generated with …" lines. The same goes for pull request descriptions. - Never commit on
main. Do all work on a branch and merge it through a pull request. - Commit as
Paul Tal <[email protected]>, which is set in the repo's local git config.
Project
./run.shruns the whole pipeline (data → tokenizer → overfit check → train → evaluate);./run.sh --quickis a two-minute smoke run.uv run pytestanduv run ruff check .must pass before committing.data/andartifacts/are generated outputs and are not tracked.