LLM-as-Code: Agentic Programming for Agent Harness
- URL: http://arxiv.org/abs/2606.15874v2
- Date: Mon, 22 Jun 2026 08:52:52 GMT
- Title: LLM-as-Code: Agentic Programming for Agent Harness
- Abstract summary: We argue that token explosion, control-flow hallucination, and unreliable completion are not implementation bugs.<n>A better prompt or a stronger model cannot guarantee the reliability of the LLM agent.<n>We propose Agentic Programming, in which the program governs all control flow, and the LLM is itself part of it.
- Score: 20.350593038902904
- License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/
- Abstract: Every major LLM agent framework gives the LLM the role of orchestrator; the model decides what to do next, when to call tools, and when to stop. We argue that token explosion, control-flow hallucination, and unreliable completion are not implementation bugs but architectural consequences of assigning the deterministic work of looping, branching, and sequencing to a probabilistic system. A better prompt or a stronger model cannot guarantee the reliability of the LLM agent. We therefore propose Agentic Programming, in which the program governs all control flow, and the LLM is itself part of it, an adaptive component we call LLM-as-Code and invoke only where a task calls for reasoning or generation. Within each call the model keeps full flexibility, but it cannot alter the program's execution path. With control in the program, the LLM's context is built from the execution history's call tree and forms a directed acyclic graph (DAG). Each call's context length is then determined by its call depth rather than by accumulation over steps. A case study of computer-use agents shows that the design is practical, not just a theoretical stance, substantially improving the stability of long visual operation sequences.
Related papers
- Confining Nondeterminism: AI-Driven Research Systems as DBMSs for Reliable, Non-Wasteful, Transparent, and Collaborative Research [Vision] [6.1118660156378075]
We argue that today's agent loop is an executor whose internal state nobody, including the agent, can check.<n>Rather than trying to see inside the LLM, we take a lesson from databases, which earn trust without being watched.<n>The project lives in a deterministic, versioned dataflow engine, and the LLM, together with the user, is a compiler that may only edit that plan.
arXiv Detail & Related papers (2026-07-11T23:46:01Z) - From Agent Loops to Structured Graphs:A Scheduler-Theoretic Framework for LLM Agent Execution [1.8222732878503212]
The dominant paradigm for building LLM based agents is the Agent Loop, an iterative cycle where a single language model decides what to do next by reading an ever growing context window.<n>This perspective places Agent Loops and graph based execution engines on a single semantic continuum.<n>We propose SGH, which lifts control flow from implicit context into an explicit static DAG.
arXiv Detail & Related papers (2026-04-13T12:16:45Z) - KAIJU: An Executive Kernel for Intent-Gated Execution of LLM Agents [5.931389072124715]
Tool-calling autonomous agents based on large language models using ReAct exhibit three limitations.<n>Recent work moves towards separating planning from execution but in each case model remains coupled to the execution mechanics.<n>We introduce a system-level abstraction for LLM agents which decouples the execution agent from the reasoning layer.
arXiv Detail & Related papers (2026-03-31T21:38:28Z) - SafePilot: A Framework for Assuring LLM-enabled Cyber-Physical Systems [2.2566909388480743]
Large Language Models (LLMs) have recently begun to be integrated into various cyber-physical systems.<n>LLMs produce "hallucinations" - outputs that are coherent yet factually incorrect or contextually unsuitable.<n>We propose SafePilot, a novel hierarchical neuro-symbolic framework that provides end-to-end assurance for CPS according to attribute-based and temporal specifications.
arXiv Detail & Related papers (2026-03-23T03:31:51Z) - RAVEL: Reasoning Agents for Validating and Evaluating LLM Text Synthesis [78.32151470154422]
We introduce RAVEL, an agentic framework that enables the testers to autonomously plan and execute typical synthesis operations.<n>We present C3EBench, a benchmark comprising 1,258 samples derived from professional human writings.<n>By augmenting RAVEL with SOTA LLMs as operators, we find that such agentic text synthesis is dominated by the LLM's reasoning capability.
arXiv Detail & Related papers (2026-02-28T14:47:34Z) - Gecko: A Simulation Environment with Stateful Feedback for Refining Agent Tool Calls [56.407063247662336]
We introduce Gecko, a comprehensive environment that simulates tool responses using a combination of rules and LLMs.<n>GATS consistently improves the tool calling performance of various LLMs including GPT-4o, GPT-5, and Gemini-3.0-pro.
arXiv Detail & Related papers (2026-02-22T15:02:00Z) - LLM-Guided Compositional Program Synthesis [16.867355177975387]
Large language models (LLMs) have the ability to solve PBE tasks by generating code in different target languages, but they can fail unpredictably.<n>We introduce a novel technique that recovers from failure by constructing simpler subtasks for the LLM to solve.
arXiv Detail & Related papers (2025-03-12T00:36:43Z) - Towards Efficient LLM Grounding for Embodied Multi-Agent Collaboration [68.29746557968107]
We propose a novel framework for multi-agent collaboration that introduces Reinforced Advantage feedback (ReAd) for efficient self-refinement of plans.<n> Experiments on Over-AI and a difficult variant of RoCoBench show that ReAd surpasses baselines in success rate, and also significantly decreases the interaction steps of agents.
arXiv Detail & Related papers (2024-05-23T08:33:19Z) - Efficient Tool Use with Chain-of-Abstraction Reasoning [63.08202389132155]
Large language models (LLMs) need to ground their reasoning to real-world knowledge.<n>There remains challenges for fine-tuning LLM agents to invoke tools in multi-step reasoning problems.<n>We propose a new method for LLMs to better leverage tools in multi-step reasoning.
arXiv Detail & Related papers (2024-01-30T21:53:30Z) - If LLM Is the Wizard, Then Code Is the Wand: A Survey on How Code
Empowers Large Language Models to Serve as Intelligent Agents [81.60906807941188]
Large language models (LLMs) are trained on a combination of natural language and formal language (code)
Code translates high-level goals into executable steps, featuring standard syntax, logical consistency, abstraction, and modularity.
arXiv Detail & Related papers (2024-01-01T16:51:20Z) - An LLM Compiler for Parallel Function Calling [68.04566807806071]
We introduce LLMCompiler, which executes functions in parallel to efficiently orchestrate multiple function calls.
We observe consistent latency speedup of up to 3.7x, cost savings of up to 6.7x, and accuracy improvement of up to 9% compared to ReAct.
arXiv Detail & Related papers (2023-12-07T18:32:04Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.