AIAny
Icon for item

Compile by Training: Turning Natural-Language Specifications into Local Neural Functions

Converts a natural-language function specification into a reusable local neural function by using teacher models to synthesize examples and finetuning a small adapter for a compact interpreter. Achieves higher semantic accuracy (83.6% on FuzzyBench-Hard) at the cost of roughly one minute compile time; produces versionable PAW artifacts for local deployment.

Introduction

Many recurring text-processing tasks are easy to describe but costly to solve by calling a large remote model for every input. The core insight of this work is to "compile" a natural-language specification into a small, reusable neural artifact: at compile time, high-capacity teacher models synthesize task-specific I/O examples, and those examples are used to finetune a compact LoRA-style adapter that specializes a frozen local interpreter. The result is a callable local function that runs without the teachers and can be stored, versioned, and composed like ordinary software.

Key Findings
  • High-accuracy localization: On a hard subset of FuzzyBench where the prior fast PAW compiler produced no exact matches, Compile by Training reaches 83.6% semantic accuracy, improving correctness for many fuzzy text functions.
  • Compile-time tradeoff: The approach raises accuracy by paying a higher compile-time cost—about a minute of finetuning per compile versus seconds for the fast compiler—while keeping per-call latency and dependency minimal because inference runs locally.
  • Modular separation of roles: The pipeline separates synthesis (teacher LLMs) from execution (small frozen interpreter + adapter), enabling small deployable artifacts (PAW programs) that can be versioned and composed in production workflows.
  • Practical demos: The authors demonstrate the approach in several deployed scenarios (multi-site website helper, language-directed 3D avatar, and a bidirectional English–Claudish translator), illustrating end-to-end usability beyond benchmarks.
Who it's for & tradeoffs

Great fit if you need repeatable, offline execution of fuzzy text functions with better-than-prompting accuracy and you can accept a non-negligible one-time compile cost. It is attractive for teams wanting to eliminate per-request remote LLM calls for latency, cost, or privacy reasons while keeping a compact local runtime.

Look elsewhere if you require strict formal guarantees or fully deterministic rule-based behavior, need zero compile latency, or cannot tolerate errors introduced by synthesized supervision: because the adapter is trained on teacher-generated examples, teacher mistakes can propagate unless validated. The method improves practical correctness but requires validation, testing, and governance when used in safety-sensitive pipelines.

Where it fits

This method sits between two extremes: lightweight prompt-based local inference (very low compile cost but limited accuracy) and always-calling large remote LLMs (high per-call cost and dependency). Compile by Training trades extra one-time compile cost to produce small, high-accuracy, versionable neural functions that run locally.

Information

  • Websitearxiv.org
  • OrganizationsUniversity of Waterloo, Harvard University
  • AuthorsYuntian Deng, Pengyu Nie, Stuart Shieber
  • Published date2026/09/03

More Items

Decides when past post-training updates should be reused for autonomous LLM adaptation by introducing Boundary-Calibrated Intervention Transfer (BCIT). BCIT binds effects to source context, checks applicability and hard conflicts, and runs bounded trials to obtain current-state evidence—reducing harmful updates and improving equal-budget final-model quality.

Studies on-policy distillation (OPD) at the data-minimal limit by training on a single query, measuring state coverage and alignment dynamics, and showing OPD is often data-overfed but algorithm-starved.

Compresses KV cache for long-chain reasoning by keeping prompt tokens and evicting remaining entries uniformly at random per attention head; across four models and six reasoning tasks it matches the strongest prior evictor while delivering 32–43% higher vLLM throughput. Relies on prompt protection and redundancy across heads/text to retain reasoning traces; suitable when static memory budgets and higher serving throughput are priorities.