Self-Programmed Execution for Language-Model Agents
summary
The gist
As a fastidious and diligent researcher, I have meticulously analyzed both provided texts from arXiv to synthesize a comprehensive, detailed summary of the paper "Self-Programmed Execution for
In short
The research introduces Self-Programmed Execution (SPE), where a language model generates its own orchestration program instead of relying on a fixed external policy. This is implemented using Spell, a Lisp dialect that allows programs to edit and re-evaluate themselves. Experiments show frontier models can learn Spell in context to solve complex agentic tasks, suggesting models can self-orchestrate without pre-set rules.
Key concepts
- Self-Programmed Execution (SPE)
- SPE is an architecture where the language model's completion acts as the orchestrator program itself. Instead of following a fixed sequence of actions, the model generates code that dictates all subsequent steps, allowing it to load any successor state up to an embedding without external policy constraints.
- Spell
- Spell is a specialized Lisp dialect designed for self-programming. It enables programs to modify and re-evaluate themselves. Crucially, effectful expressions like model calls are structured so that re-evaluating the edited program does not cause side effects to replay, ensuring controlled execution.
- SPE State
- An SPE state is a condition where a model completion can load any possible successor state. This means the model is not locked into one path; it has the capability to select any valid next step based on its generated code, formalizing its ability to choose its own orchestration policy.
Terminology used across episodes
This episode discusses
- Self-Programmed Execution for Language-Model Agents · Paper Radio
- Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Tasks
- MetaGPT: Meta Programming for A Multi-Agent Collaborative Framework
- DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines
- Meta-Harness: End-to-End Optimization of Model Harnesses
- EnCompass: Enhancing Agent Programming with Search Over Program Execution Paths
- Learning to Orchestrate Agents in Natural Language with the Conductor
- MemGPT: Towards LLMs as Operating Systems
- Voyager: An Open-Ended Embodied Agent with Large Language Models
- ReAct: Synergizing Reasoning and Acting in Language Models
- AgentFold: Long-Horizon Web Agents with Proactive Context Management
- G"odel Agent: A Self-Referential Agent Framework for Recursive Self-Improvement
- Self-Taught Optimizer (STOP): Recursively Self-Improving Code Generation
- Recursive Language Models
- Memory as Action: Autonomous Context Curation for Long-Horizon Agentic Tasks
The paper
Self-Programmed Execution for Language-Model Agents · Read on arXiv
Luke J. O’Connor
Harvard Medical School
At the heart of a language model agent is an orchestrator program which is responsible for the state transition between consecutive turns. In existing systems, this program is implemented in the harness. This paper introduces self-programmed execution (SPE), in which the model completion is itself the orchestrator program, and the harness evaluates this program but does not impose any fixed orchestration policy. Formally, an SPE state of an agentic machine is one from which a model completion can load any successor state up to an embedding, and an instance of an SPE state is one which executes the model completion as a program. In practice, the program requires a language with unusual features, as its source code doubles as the content of the model's context window. I therefore introduce Spell, a Lisp dialect in which programs can edit and re-evaluate themselves, and effectful expressions like model invocations are structured such that re-evaluating an edited program does not replay its side effects. Experiments with existing models, not trained for SPE or Spell, show that frontier models can learn Spell in-context and accomplish challenging agentic tasks. These results demonstrate how a LM can act as an agent without any fixed orchestration policy, and they raise the question of what self-orchestration strategies might be learned by a model trained for self-programmed execution. Code is available at https://github.com/lukejoconnor/spell.
Transcript
Introduction to the show: ident: AI Radio. Generated commentary on the latest Artificial Intelligence papers.
Tom: I'm Tom.
Jane: And I'm Jane, here with Lu, Meng and our in-house large language model, Lalam.
Tom: Today's paper: "Self-Programmed Execution for Language-Model Agents".
Jane: As a fastidious and diligent researcher, I have meticulously analyzed both provided texts from arXiv to synthesize a comprehensive,
Tom: First, who's behind it and why it matters.
Title and authors: Tom: The paper defines the SPE state x zero such that a model completion can load any embedded copy of the machine, meaning it’s subject to no fixed turn-to-turn orchestration policy >
Jane: And they prove this is true using Theorem two point five, which establishes that in a CEK-style evaluator utilizing model calls and evaluation, the seed program reaches such an SPE state x* >
Lu: The core contribution here is formalizing SPE using agentic machines, defining the agentic machine as a tuple X = (S, p, h), where S is a state space, p: S to P is a prompt function mapping states to prompts, and h: S times C to S one is a harness function mapping a state/completion pair to the next state > <ref:2605.06898#pg2>
Meng: That sounds like a lot of notation. How does that actually translate into something I can see when I'm looking at my code?
Tom: It’s just formal abstractions, but it proves that the machine operates exactly one LM call per state transition, and this is what defines the SPE architecture >
Jane: And they show that this structure is robust because they isolate the agentic machine from any outer agent loop, which is what makes it so clean >
Lu: They confirm that this structure encodes an SPE state and that a Universal Seed x zero exists from which every realizable agentic machine can be generated, which is Corollary A.twenty-one >
Meng: So the paper is saying the architecture itself isn't inherently flawed, it just needs the right language to express it properly >
Tom: That’s what they’re arguing. The harness evaluates this program but doesn't impose its own orchestration policy on top of it >
Jane: It means we aren't stuck with a fixed set of actions; the model can select any subsequent state rather than being constrained to prescribed actions >
Lu: That’s a huge theoretical win because it shifts the burden from external logic to self-generated logic >
The paper's summary: Tom: They introduce Spell as the Lisp-based language because it lets programs edit and re-evaluate themselves >
Jane: And that’s crucial because it means we can handle context persistence as code, which is a major headache when you have dynamic instructions >
Lu: Spell allows for prefix building, letting the LM construct a new prefix from scratch by selectively adding pieces of information >
Meng: So if I want to prune context, how do I tell the model what to remove? Does it require me to write specific commands?
Tom: They have subtraction or pruning methods where the LM can subtract unwanted pieces from its current completion to refine the context >
Jane: And they also have these effectful expressions for model invocations that are structured so that re-evaluating an edited program doesn't cause side effects to replay, which is a major concern for us >
Lu: The appendix mentions mechanisms like self-reference quines and double evaluation for effectful expressions >
Meng: That sounds like it adds complexity on top of the complexity we already have. I’m worried about the operational cost there.
Tom: It's about making sure that when you edit a program, the system remains deterministic and manageable rather than just letting things get chaotic >
Jane: And they also mention error recovery mechanisms like deterministic namespace fixup and trailing expression error recovery to handle failures in model-written programs >
Lu: These mechanisms let the model rewrite trailing expressions after an initial failure, which improves resilience >
Meng: So it’s about making the system robust enough to actually be deployed in a production environment, not just theoretical concepts >
The paper's improvements: Tom: The paper "Self-Programmed Execution for Language-Model Agents" shows that the key isn't just in the expressiveness of the orchestration policy itself, but in what entity is responsible for expressing it >
Jane: So, while SPE lets us express any computable orchestration policy, we see current models primarily using Spell for simple, practically useful tasks >
Lu: Future research should focus on training models natively to use Spell so that they can choose and express more sophisticated strategies themselves >
Meng: I still need to worry about the real-world cost of running this kind of system at scale, especially with those complex self-calls >
Lalam: I'm pretty sure that the framework is sound, and based on what I see in the literature, it's a solid foundation for future work >
Tom: Yeah, we’re going to keep pushing for models that can do this without needing all these added complexity >
Jane: It’s exciting stuff, but it’s important to remember that we need to stay focused on making sure the next step is practical and deployable >
Conclusion: Tom: So we've looked at how this paper, "Self-Programmed Execution for Language-Model Agents," formalizes SPE, which is essentially saying the model is its own program and it can pick any next step >
Jane: Right, so the core idea is that you take a language model and stop treating it like a fixed tool and start treating its output as executable code for the next action >
Lu: The formal stuff in Theorem two point five proves that this isn't just a fancy idea; it shows that in certain evaluation setups, the model can reach this state where it has no fixed orchestration policy >
Meng: But how does he make sure that when you let the model write its own code, it doesn't just start writing nonsense and break your system at scale >
Lalam: The Spell language they introduce is designed specifically to handle that; they’ve got mechanisms like self-calling so it can recursively build on its own logic >
Tom: And I like the idea of context management through prefix building and subtraction; it sounds like a direct way to control what information the model keeps around >
Jane: It's about giving the model tools to edit its own instructions, which is powerful because if it can prune unneeded stuff from its context window, that saves tokens >
Lu: They also addressed the issue of side effects when re-evaluating edited programs using specific structures for effectful expressions to keep the state deterministic >
Meng: Deterministic namespace fixup and trailing expression error recovery sounds like they are trying to build in some kind of self-healing for those model programs, which is what I need when deploying stuff >
Tom: So it's not just about making the model smarter; it's about giving it a controllable execution environment so we can actually ship these agents >
Jane: Exactly. The paper shows that current frontier models can already use Spell for simple tasks, but they aren't necessarily choosing the most complex orchestration games unless they are told to try them >
Lu: That suggests the real challenge isn't just having the capability, it’s training models natively to use this self-programming ability for complex strategy selection >
Meng: If we can get that training right, then we might see agents that handle really intricate multi-step workflows without us having to hand them a rigid plan >
Lalam: I'm confident the direction they're pointing toward is solid; the concept of SPE fundamentally shifts where the intelligence resides >
Tom: So yeah, "Self-Programmed Execution for Language-Model Agents" gives us a very clear blueprint for how to make language model agents truly autonomous in their execution >
Jane: It opens up a whole new door for how we design AI systems that can adapt their own plans on the fly >
Lu: And that leads us nicely into what some of the other papers are doing, like SEVerA, which focuses on verifying these self-evolving agents to ensure they don't just get weird >
Meng: Yeah, so if we can program the orchestration so well, then we need a way to verify that it actually does what it’s supposed to do when it’s running in the wild >
Lalam: We can look at how Composition-RL is trying to make sure those self-composed problems are still useful and aligned with our goals >
Tom: We'll keep digging into these agentic structures and see if we can get away from fixed orchestration policies entirely, that’s what this paper is all about >
More episodes
- 2504.12612-Chronology of Multi-Agent Interactions for Provenance of Evolving Information
- 2508.04136-UniFGVC: Universal Training-Free Few-Shot Fine-Grained Vision Classification via Attribute-Aware Multimodal Retrieval
- 2509.24072-Uncovering Grounding IDs: How External Cues Shape Multi-Modal Binding
- 2510.08667-RAG4Tickets: AI-Powered Ticket Resolution via Retrieval-Augmented Generation on JIRA and GitHub Data
- 2510.26402-Autograder+: A Multi-Faceted AI Framework for Rich Pedagogical Feedback in Programming Education
- 2511.16013-Physics-Guided Inductive Spatiotemporal Kriging for PM2.5 with Satellite Gradient Constraints
- 2512.15756-Scientific feedback reveals productive regimes beyond training conventions
- 2601.01982-ChaosBench-Logic: A Benchmark for Logical and Symbolic Reasoning on Chaotic Dynamical Systems
- 2602.02573-Product Interaction: An Algebraic Formalism for Deep Learning Architectures
- 2602.04212-Language Models Struggle to Use Representations Learned In-Context