Agentic AI
New approach locks LLM outputs as deterministic code to boost reliability in enterprise workflows
Researchers propose "compiled AI," which converts language model outputs into frozen code during compilation to eliminate runtime unpredictability in high-stakes applications like healthcare.
Researchers have introduced a new framework for deploying large language models in mission-critical settings by converting their outputs into deterministic, executable code during an upfront compilation phase—eliminating the need for model invocation at runtime.
The approach, called "compiled AI," trades the flexibility of real-time language model inference for predictability, transparency, and cost control. Rather than letting an LLM make decisions each time a workflow runs, the system generates code once using the model, then executes that frozen artifact repeatedly without further model calls.
How it works#
The methodology combines elements from prior work on declarative optimization and neural-symbolic planning. The system architecture includes:
- Constrained generation: LLMs produce code only for narrowly scoped business logic functions, embedded within validated templates rather than generating arbitrary code
- Four-stage pipeline: A validation workflow that transforms probabilistic model outputs into production-ready code artifacts
- Operational metrics: A framework measuring token amortization, execution reliability, security posture, and financial efficiency
Performance and cost benefits#
Testing on two distinct task categories revealed significant advantages:
Function-calling tasks (400 examples from BFCL benchmark): The compiled approach achieved 96% task completion while consuming zero execution tokens. It breaks even with traditional runtime inference after roughly 17 repeated transactions and delivers a 57x reduction in token consumption at 1,000 transactions.
Document intelligence (5,680 invoices from DocILE): A variant called Code Factory matched direct LLM performance on key field extraction accuracy (80.0%) while achieving the highest reported line item recognition accuracy at 80.4%.
Security and auditability#
These characteristics make compiled AI particularly attractive for regulated domains like healthcare, where determinism and auditability are non-negotiable. Security assessment across 135 test cases showed:
- 96.7% accuracy on detecting prompt injection attempts
- 87.5% accuracy on static code safety analysis with zero false positives

