Generative Compilation: On-the-Fly Compiler Feedback as AI Generates Code
Summary
This paper introduces generative compilation, a method to obtain compiler feedback on partial programs during AI code generation, using a 'sealor' transformation that enables standard compilers to diagnose incomplete code. Evaluated on Rust coding tasks, it reduces non-compiling outputs and improves functional correctness by catching errors early.
View Cached Full Text
Cached at: 07/16/26, 09:45 PM
Paper page - Generative Compilation: On-the-Fly Compiler Feedback as AI Generates Code
Source: https://huggingface.co/papers/2607.13921 Published on Jul 15
·
Submitted byhttps://huggingface.co/nmuendler
Nielson Jul 16
Abstract
Languageswithrichstaticsemantics,suchasRust,providestrongerguaranteesforAI-generatedcode,buttheirstrictnessmakesgenerationmoredifficult.Off-the-shelfcompilerscanprovideusefulfeedbackpost-generation,butdoesnotguideintermediategenerationsteps,suchasthoseduringautoregressiveLLMdecoding.Constraineddecodingintervenesearlierbyrejectinginvalidtokensduringsampling,butrequireswhite-boxmodelaccessandcostlyreimplementationforsemanticconstraints.Weintroducegenerativecompilation,thefirstapproachtoobtainingcompilerfeedbackonpartialprogramsduringgeneration.Thecoretechnicaldeviceisasealor:alightweight,mostlysyntax-guidedtransformationthatconvertspartialprogramsintocompleteonesthatstandardcompilerscandiagnose.Itisdesignedsuchthatpossible-to-completepartialprogramsareneverrejected,whilepreservingenoughcodecontexttocatchgenuinedeadendsearly.WeconstructsuchasealoronacoreRust-likecalculusandprovethatitsatisfiestheseproperties,allmechanizedinLean.Weextendittothefirstpartial-programcheckerforrealRust.Weevaluateourmethodonchallengingrepository-levelRustcodingtasks,acrossbothfrontierblack-boxandopen-weightmodels.Weshowthatgenerativecompilationreducesnon-compilingoutputsandimprovesfunctionalcorrectness,relativetostandardpost-generationfeedback.Itdoessobydetectingabroadrangeoferrorsclosetotheirsourceandearlyduringgeneration,therebyreducingerrorscascadesandenablingfocuseddiagnostics.Morebroadly,generativecompilationisasteptowardmakingcompilersafirst-classcitizenofAI-assistedprogrammingactiveduringgeneration,ratherthanaseparatepost-generationcheck.
View arXiv pageView PDFGitHubAdd to collection
Models citing this paper0
No model linking this paper
Cite arxiv.org/abs/2607.13921 in a model README.md to link it from this page.
Datasets citing this paper2
#### eth-sri/CRUST-bench Viewer• Updated28 minutes ago • 117 #### eth-sri/API-Upgrade Viewer• Updated28 minutes ago • 34
Spaces citing this paper0
No Space linking this paper
Cite arxiv.org/abs/2607.13921 in a Space README.md to link it from this page.
Collections including this paper1
Similar Articles
AI Generated Code Quality
The article discusses concerns that as AI tools generate increasing amounts of code, future models trained on this synthetic code may suffer from reduced quality and originality, and asks how major AI labs like OpenAI, Anthropic, and GitHub plan to address this issue.
AI code generation in Go gets dramatically more useful when the tool actually knows your codebase
The post argues that AI code generation for Go is more effective when the tool understands the organization's internal codebase and conventions, leading to higher acceptance rates and fewer edits needed.
Are feedback systems more important than models for making AI agents useful?
A discussion about how feedback systems (static analysis, coverage tools, profiling) are more critical than the choice of LLM for making AI agents useful, illustrated by Oracle's work generating tests for GraalVM Native Image reflection metadata.
Agentic coding in a large production codebase: wins, failure modes, and guardrails
Engineers across database, iOS, frontend, data engineering, and backend domains discuss how AI code generation shifts the hard part to verification and integration, requiring human judgment for subtle risks and architectural fit.
Using AI to write better code more slowly
Nolan Lawson argues that AI coding assistants can be used to write high-quality code slowly by employing multiple models for thorough code review and bug detection, improving codebase health rather than maximizing output speed.