Skip to content
AI News HubLIVE
Original source2 min read

Training a Language Model End-to-End in Rust: An Experience Report

Summary

A solo researcher pretrained a ~0.4B-parameter, Bangla-first language model entirely in Rust for $164 in rented GPU time, without PyTorch or Python in the training path. The paper's main contribution is a failure taxonomy of the Rust training frameworks Candle and Burn—five and three defects respectively, including silently gradient-free fused kernels and a mid-training segfault at multi-billion-parameter scale—plus a gradient-flow verification test that caught six silent failures. The author concludes Rust is not yet competitive for training, but may be good for serving.

SourcearXiv Computational LinguisticsAuthor: Arif Adito
Training a Language Model End-to-End in Rust: An Experience Report
Report an error

The correction channel is not available yet. You can copy the article reference below for later.

Correction instructions
Read article

[Submitted on 27 Jul 2026]

Title:Training a Language Model End-to-End in Rust: An Experience Report

View a PDF of the paper titled Training a Language Model End-to-End in Rust: An Experience Report, by Arif Adito

View PDF HTML (experimental)

Abstract: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.

Subjects:

Computation and Language (cs.CL)

Cite as: arXiv:2609.25008 [cs.CL]

(or arXiv:2609.25008v1 [cs.CL] for this version)

https://doi.org/10.48550/arXiv.2609.25008

arXiv-issued DOI via DataCite

Submission history

From: Arif Ahmed Aditto [view email] [v1] Mon, 27 Jul 2026 08:37:56 UTC (17 KB)

Full-text links:

Access Paper:

View a PDF of the paper titled Training a Language Model End-to-End in Rust: An Experience Report, by Arif Adito

View PDF

HTML (experimental)

TeX Source

view license

Current browse context:

cs.CL

new | recent | 2026-09

Change to browse by:

cs

References & Citations

NASA ADS

Google Scholar

Semantic Scholar

Loading...

Data provided by:

Bibliographic Tools

Bibliographic and Citation Tools

Bibliographic Explorer Toggle

Bibliographic Explorer (What is the Explorer?)

Connected Papers Toggle

Connected Papers (What is Connected Papers?)

Litmaps Toggle

Litmaps (What is Litmaps?)

scite.ai Toggle

scite Smart Citations (What are Smart Citations?)

Code, Data, Media

Code, Data and Media Associated with this Article

alphaXiv Toggle

alphaXiv (What is alphaXiv?)

Links to Code Toggle

CatalyzeX Code Finder for Papers (What is CatalyzeX?)

DagsHub Toggle

DagsHub (What is DagsHub?)

GotitPub Toggle

Gotit.pub (What is GotitPub?)

Huggingface Toggle

Hugging Face (What is Huggingface?)

ScienceCast Toggle

ScienceCast (What is ScienceCast?)

Demos

Demos

Replicate Toggle

Replicate (What is Replicate?)

Spaces Toggle

Hugging Face Spaces (What is Spaces?)

Spaces Toggle

TXYZ.AI (What is TXYZ.AI?)

Related Papers

Recommenders and Search Tools

Link to Influence Flower

Influence Flower (What are Influence Flowers?)

Core recommender toggle

CORE Recommender (What is CORE?)

Author

Venue

Institution

Topic

About arXivLabs

arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

Which authors of this paper are endorsers? | Disable MathJax (What is MathJax?)

Key points and analysis

Article intelligence

EngineersAdvanced

Key points

  • Pretrained an end-to-end language model in pure Rust for $164 in rented GPU time, alone, with no PyTorch or Python in the training path.
  • Documents five Candle defects and three Burn defects as training backends, including fused kernels that silently produce no gradient and a segfault at multi-billion-parameter scale.
  • Introduces a gradient-flow arbiter: one forward/backward pass asserting every trainable parameter receives a finite, nonzero gradient, generalizable to any framework.
  • Trained ~0.4B-parameter Bangla-first model scores 0.93 per-token NLL vs 12.60 for a random twin, at chance on English commonsense; tokenizer-fertility trap collapsed Bangla to ~1.4 chars/token (fixed to ~4.1).

Highlights and analysis are generated automatically and may contain errors. Check the original source.