Researchers at Hugging Face have introduced a novel approach called compile by training, which transforms natural-language specifications into reusable neural functions. The method addresses the challenge of implementing recurring text functions that are easy to describe but difficult to code with rules, while avoiding the repeated cost and latency of calling large remote models for every input.
At compile time, teacher models generate task-specific examples that are used to train a small adapter for a compact interpreter. The resulting function runs locally without the teachers and can be stored, versioned, and composed like ordinary software. This builds on the earlier Program-as-Weights (PAW) compiler, which produces small neural programs that run on a shared 0.6B local interpreter in a single forward pass, taking only seconds.
On FuzzyBench-Hard, a subset where the fast PAW compiler produced no exact matches, compile by training achieves 83.6% semantic accuracy. This higher accuracy comes with a higher compile-time cost: roughly a minute rather than seconds for the fast compiler. The researchers have deployed the compiler in a public interactive service and demonstrated compiled functions in a multi-site website helper, a language-controlled 3D avatar, and a bidirectional English-Claudish translator.
The authors highlight the cost advantage: skipping per-spec fine-tuning means no GPU bill per task and no big-model latency at inference. However, they also note limitations: the compiled function only knows what the teacher generated, so edge cases not covered by the teacher may lead to silent errors. They suggest the need for degradation curves on out-of-distribution inputs before trusting the approach in production, and question whether recompiling from a changed spec converges to new behavior without unnoticed drift.