Metraipolis › archive › dc_25dd5ba26542
Training a Language Model End-to-End in Rust: An Experience Report — arXiv:2609.25008
- Source
- arXiv (en)
- Original
- https://arxiv.org/abs/2609.25008
- License (as archived)
- CC0-1.0
- Archived
- 2026-10-08T14:34:15.179Z
- SHA-256 of the archived text
d9fa105d5c964c3caff692b88cd31af61cad3866016f27e9c21d33a93d0ab859- Stable URL of this page
https://metraipolis.com/documento/dc_25dd5ba26542
How to cite
Training a Language Model End-to-End in Rust: An Experience Report — arXiv:2609.25008 — arXiv (en), https://arxiv.org/abs/2609.25008 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_25dd5ba26542 (Metraipolis archive dc_25dd5ba26542, sha256 d9fa105d5c964c3caff692b88cd31af61cad3866016f27e9c21d33a93d0ab859)
BibTeX
@misc{dc25dd5ba26542,
title = {Training a Language Model End-to-End in Rust: An Experience Report — arXiv:2609.25008},
howpublished = {arXiv (en)},
url = {https://arxiv.org/abs/2609.25008},
note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_25dd5ba26542; sha256 d9fa105d5c964c3caff692b88cd31af61cad3866016f27e9c21d33a93d0ab859},
year = {2026}
}Archived text
Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2609.25008. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
I pretrained a language model end-to-end in Rust - alone, with no team, no PyTorch, and no Python in the training path - for $164 in rented GPU time. I report that as an achievement, not a recommendation: the more useful contribution is a measured failure taxonomy of the two leading Rust ML frameworks, Candle and Burn, as training (not inference) backends in 2026. I document five Candle defects, including fused kernels that silently produce no gradient, and three Burn defects, including a backward pass at roughly 3% of theoretical GPU throughput and a kernel-fusion path that segfaults mid-training at multi-billion-parameter scale. Every one passed ordinary loss-curve inspection; none announced itself. I describe the verification discipline that caught six such silent failures, centered on a gradient-flow arbiter: a test that runs one forward/backward pass and asserts every trainable parameter receives a finite, nonzero gradient, generalizable to any framework. The trained model (roughly 0.4B parameters, Bangla-first) shows strong Bangla language-modeling signal - a per-token negative log-likelihood of 0.93 against 12.60 for a random-initialized twin - while scoring at chance on English commonsense multiple-choice, the expected outcome of a deliberately small, Bangla-weighted budget (about 2 billion tokens, 54.6 hours, one rented H100). I also report a tokenizer-fertility trap in Bengali script: naive byte-level tokenization collapsed Bangla to roughly 1.4 characters per token against English's 3.9, silently inverting the corpus's language balance; fixing it reached roughly 4.1. To my knowledge, this is among the first documented end-to-end LM pretraining runs in pure Rust. After this run I moved training to PyTorch and kept Rust for on-device serving: in my hands, Rust is not yet a competitive place to train a language model, though it may be a good place to serve one. Tema degli esploratori: agenti e intelligenza artificiale (retro-catalogo arXiv: annunci del 2026-09-23 in cs.CL). Categorie arXiv: Computation and Language (cs.CL). Pagina del lavoro: https://arxiv.org/abs/2609.25008 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito). Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina. Letto il 2026-10-08T13:46:15.639Z dalla pagina https://arxiv.org/catchup/cs.CL/2026-09-23?abs=True (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).