← TinyGPT · docs · devlog · roadmap · speedup
source: docs/prds/C4-tool-extractor-bpe.md · view on GitHub ↗

PRD — Extend tinygpt train-extractor to BPE tokenizers

Goal

tinygpt train-extractor (the mini-router-trainer that ships the “intent + tool” classifier on top of the residual stream) currently assumes a byte-level tokenizer. Bases the user actually wants to specialize (Qwen3-4B, Gemma-3, anything HF) use BPE. The extractor silently misaligns when fed BPE bases; ship the BPE-aware path.

This is the smallest piece blocking B2 (mini-router on real BFCL data) — the router can’t be evaluated against a 4B-base specialist unless the extractor speaks its tokenizer.

Why now

Scope — in

Scope — out

Files to touch

FileChange
Sources/TinyGPT/TrainExtractor.swifttokenizer-flavor branch in alignment + data pipeline
Sources/TinyGPTModel/HFTokenizer.swiftexpose encodeWithOffsets if not already public
evals/extractor-bpe-smoke.shnew — see above
docs/decision_log.mdone-line entry on the two-branch decision

Acceptance criteria

Reference patterns

Open questions