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
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
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
Spoken-English math to Typst with a small from-scratch encoder-decoder
Transformer, following the build guide: compile-checked synthetic data
generator, shared BPE tokenizer, nn.Transformer model, training loop with
an overfit sanity check, greedy decoding CLI, and evaluation on synthetic
and hand-written test sets. ./run.sh runs the whole pipeline.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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 stringtokenizer.py: byte-level BPE shared by both sidesmodel.py:nn.Transformerseq2seq withencode()/decode()for inferencetrain.py: teacher forcing, AdamW, warmup + cosine, overfit-100 sanity check, checkpointstranslate.py: greedy decoding CLI (uv run isotope "...")evaluate.py: exact match + compile rate on the synthetic test split andeval/hand_test.jsonlrun.sh: whole pipeline;./run.sh --quickis a 2-minute smoke runAGENTS.md: commit and workflow rules for agentsChecked
uv run pytest(8 tests: Typst compiles, English is unambiguous, tokenizer round-trips, causal mask) andruff checkpass./run.sh --quickand the full./run.shrun end to end on an M-series Mac