From-scratch SLM
Legal SLM 125M
A small language model for legal and finance text, built end to end. Public data, a fresh tokenizer, a 125M Llama-style model trained from scratch, live serving, and a demo that shows where the model stops.
Key takeaways
- Trained a 125M Llama-style base model from scratch on legal and finance text. Fresh weights. A fresh 16K byte-level BPE tokenizer.
- Built the whole chain and timed each step: stream, clean, drop near-copies, strip test data, tokenize, pack, train, serve, and write it up.
- Chose a legal-first data mix from measured yield. Roughly 40% case law, 40% SEC filings, and 20% web text.
- Ran 3 epochs on 8xH100. Reached 10.35 perplexity on held-out text. The whole run cost about $27.
- Built the demo around honest limits. The base model finishes legal-style text. It does not pretend to cite facts or answer grounded questions.