aiqbench analysis
This research introduces "generative compilation," a method that integrates compiler feedback directly into the autoregressive decoding process of LLMs to generate valid Rust code in real-time. By using a lightweight syntax-guided transformation called a sealor, the approach catches errors early during generation rather than relying solely on post-hoc checks or expensive white-box constraints. The study demonstrates significant improvements in functional correctness and reduced non-compiling outputs for both frontier black-box models and open-weight alternatives.
Generative Compilation: On-the-Fly Compiler Feedback as AI Generates Code
arXiv:2607.13921v2 Announce Type: replace-cross Abstract: Languages with rich static semantics, such as Rust, provide stronger guarantees for AI-generated code, but their strictness makes generation more difficult. Off-the-shelf compilers can provide useful feedback post-generation, but does not guide intermediate generation steps, such as those during autoregressive LLM decoding. Constrained decoding intervenes earlier by rejecting invalid tokens during sampling, but requires white-box model access and costly reimplementation for semantic constraints. We introduce generative compilation, the first approach to obtaining compiler feedback on partial programs during generation. The core technical device is a sealor: a lightweight, mostly syntax-guided transformation that converts partial programs into complete ones that standard compilers can diagnose. It is designed such that possible-to-complete partial programs are never rejected, while preserving enough code context to catch genuine dead ends early. We construct such a sealor on a core Rust-like calculus and prove that it satisfies these properties, all mechanized in Lean. We extend it to the first partial-program checker for real Rust. We evaluate our method on challenging repository-level Rust coding tasks, across both frontier black-box and open-weight models. We show that generative compilation reduces non-compiling outputs and improves functional correctness, relative to standard post-generation feedback. It does so by detecting a broad range of errors close to their source and early during generation, thereby reducing errors cascades and enabling focused diagnostics. More broadly, generative compilation is a step toward making compilers a first-class citizen of AI-assisted programming active during generation, rather than a separate post-generation check.
Abstract:Languages with rich static semantics, such as Rust, provide stronger guarantees for AI-generated code, but their strictness makes generation more difficult. Off-the-shelf compilers can provide useful feedback post-generation, but does not guide intermediate generation steps, such as those during autoregressive LLM decoding. Constrained decoding intervenes earlier by rejecting invalid tokens during sampling, but requires white-box model access and costly reimplementation for semantic constraints. We introduce generative compilation, the first approach to obtaining compiler feedback on partial programs during generation. The core technical device is a sealor: a lightweight, mostly syntax-guided transformation that converts partial programs into complete ones that standard compilers can diagnose. It is designed such that possible-to-complete partial programs are never rejected, while preserving enough code context to catch genuine dead ends early. We construct such a sealor on a core Rust-like calculus and prove that it satisfies these properties, all mechanized in Lean. We extend it to the first partial-program checker for real Rust. We evaluate our method on challenging repository-level Rust coding tasks, across both frontier black-box and open-weight models. We show that generative compilation reduces non-compiling outputs and improves functional correctness, relative to standard post-generation feedback. It does so by detecting a broad range of errors close to their source and early during generation, thereby reducing errors cascades and enabling focused diagnostics. More broadly, generative compilation is a step toward making compilers a first-class citizen of AI-assisted programming active during generation, rather than a separate post-generation check.
Programming Languages (cs.PL); Artificial Intelligence (cs.AI); Machine Learning (cs.LG)
arXiv:2607.13921 [cs.PL]
(or arXiv:2607.13921v2 [cs.PL] for this version)
https://doi.org/10.48550/arXiv.2607.13921 Focus to learn more arXiv-issued DOI via DataCite
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.
Full text under the publisher's open licence · 340 words
Related coverage

Researchers Generate LLM-Compiled Shuttling Code for Complex Trapped-Ion Architectures
Quantum Zeitgeist · Aug 19, 2026
How to Scale Diffusion Inference Across AMD RDNA 4 GPUs
AMD · Nov 2, 2026
SolBehave: Evaluating the Behavioural Correctness of LLM-Generated Smart Contracts
arXiv · Oct 15, 2026
Training, learning and inference: unified dynamics of neural systems
arXiv · Aug 24, 2026