In current major LLM agent frameworks, the LLM typically acts as the orchestrator, deciding what to do next, when to call tools, and when to stop. However, we argue that token explosion, control-flow hallucination, and unreliable completions are not implementation bugs but architectural consequences of assigning deterministic tasks like looping, branching, and sequencing to a probabilistic system. A better prompt or a stronger model cannot guarantee the reliability of the LLM agent.
We thus propose Agentic Programming, where the program governs all control flow, and the LLM is an integral part of it, referred to as LLM-as-Code, invoked only when a task requires reasoning or generation. Within each invocation, the model retains full flexibility but cannot alter the program's execution path. With program control, the LLM's context is constructed from the execution history's call tree, forming a directed acyclic graph (DAG). Each call's context length is determined by its call depth rather than by accumulation over steps.
A case study of computer-use agents demonstrates that this design is practical, not merely theoretical, substantially improving the stability of long visual operation sequences.
Blogger's Review: The introduction of Agentic Programming offers a fresh perspective on the limitations of current LLM agents. By shifting control from the LLM to the program itself, it enhances system stability and reliability, warranting further exploration and validation in practical applications.