Agentic Programming moves control flow out of the LLM and into the program
A paper by Junjia Qi, Zichuan Fu, and Jingtong Gao proposes "Agentic Programming," an architecture where the host program owns all control flow and the LLM acts as a stateless "LLM-as-Code" component invoked only for reasoning or generation tasks.
Score breakdown
The paper reframes persistent LLM agent reliability problems as architectural rather than model-quality issues, proposing a concrete structural alternative that bounds context growth and removes control-flow hallucination by design.
- 01Authors Junjia Qi, Zichuan Fu, and Jingtong Gao published the paper on ArXiv on 2026-06-14.
- 02The paper argues token explosion, control-flow hallucination, and unreliable completion are architectural consequences, not implementation bugs.
- 03Better prompts or stronger models cannot guarantee reliability when a probabilistic system handles deterministic control flow.
Junjia Qi, Zichuan Fu, and Jingtong Gao identify a fundamental architectural flaw in current LLM agent frameworks: every major framework assigns the LLM the role of orchestrator, making it responsible for deciding what to do next, when to call tools, and when to stop. The paper argues that the resulting failure modes — token explosion, control-flow hallucination, and unreliable completion — are not fixable through better prompts or stronger models, because they are inherent consequences of delegating deterministic control-flow work (looping, branching, sequencing) to a probabilistic system.
Within each invocation the model retains full flexibility, but it cannot alter the program's execution path.
Their proposed solution, Agentic Programming, inverts this relationship. The program governs all control flow, and the LLM is treated as an "LLM-as-Code" component: an adaptive element invoked only when a task genuinely requires reasoning or generation. Within each invocation the model retains full flexibility, but it cannot alter the program's execution path. This structural separation has a direct effect on context management: because the LLM's context is built from the execution history's call tree, it forms a directed acyclic graph (DAG), and each call's context length is determined by its call depth rather than by unbounded accumulation over steps.
The authors validate the design with a computer-use agent case study, reporting that Agentic Programming substantially improves the stability of long visual operation sequences — demonstrating that the approach is practical rather than purely theoretical.
Key facts
- 01Authors Junjia Qi, Zichuan Fu, and Jingtong Gao published the paper on ArXiv on 2026-06-14.
- 02The paper argues token explosion, control-flow hallucination, and unreliable completion are architectural consequences, not implementation bugs.
- 03Better prompts or stronger models cannot guarantee reliability when a probabilistic system handles deterministic control flow.
- 04Agentic Programming keeps all looping, branching, and sequencing in the program, not the LLM.
- 05The LLM is treated as an 'LLM-as-Code' component, invoked only for reasoning or generation tasks.
- 06The LLM's context forms a directed acyclic graph (DAG) from the call tree, bounding context length by call depth rather than step accumulation.
- 07A computer-use agent case study shows the design substantially improves stability in long visual operation sequences.
Topics
Summary and scoring are generated automatically from the original article. We always link back to the publisher and never republish images or paywalled content. Last processed Jun 16, 2026 · 23:11 UTC. How this works →