LLM-as-Code Agentic Programming for Agent Harness

· Source: Artificial Intelligence · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Software Development & Engineering, Robotics & Autonomous Systems · Depth: Expert, quick

Summary

A new approach, Agentic Programming, addresses fundamental reliability issues in current LLM agent frameworks where LLMs act as orchestrators. The authors argue that problems like token explosion, control-flow hallucination, and unreliable completion stem from assigning deterministic control-flow tasks (looping, branching, and sequencing) to probabilistic LLMs. Agentic Programming proposes that the program should govern all control flow, integrating the LLM as an "LLM-as-Code" adaptive component. This component is invoked only for specific reasoning or generation tasks, allowing the LLM full flexibility within its call without altering the program's execution path. This architectural shift enables the LLM's context to be built from an execution history's call tree, forming a directed acyclic graph (DAG), where context length is determined by call depth rather than cumulative steps. A case study involving computer-use agents demonstrated that this design substantially improves the stability of long visual operation sequences.

Key takeaway

For AI Engineers designing or debugging LLM agents, especially for complex, multi-step tasks, you should reconsider assigning control flow to the LLM. Instead, implement Agentic Programming where your program dictates execution paths, invoking the LLM only for specific reasoning or generation. This approach mitigates token explosion and hallucination, substantially improving agent stability and context management for long operational sequences.

Key insights

Agentic Programming reassigns control flow from LLMs to the program, treating LLMs as "LLM-as-Code" for reliable, context-efficient reasoning.

Principles

Method

Agentic Programming involves the program governing all control flow, invoking LLM-as-Code only for reasoning or generation. Context is built from the execution history's call tree, forming a DAG.

In practice

Topics

Best for: Research Scientist, AI Architect, AI Scientist, Machine Learning Engineer, AI Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Artificial Intelligence.