Skip to content
Sagan

Paper

Self-Programmed Execution for Language-Model Agents

Unreadunread

AI summary

The author proposes "self-programmed execution" (SPE), an agent architecture where the model's own output is the orchestration program—instead of a fixed harness deciding "now call the model, now execute a tool, now call the model again," the model completion itself decides what happens next by writing executable code that can recursively invoke itself. To make this work, the author introduces Spell, a Lisp-based language where programs can edit and re-evaluate themselves without replaying side effects (like model calls). Experiments show that existing frontier models, not trained for this paradigm, can already operate in this regime and accomplish challenging tasks.

Main takeaways:

  • Traditional agents use a fixed orchestrator program that decides the state transition between turns; SPE removes this fixed policy—the model completion itself is the orchestrator
  • Formalized using "agentic machines" where the model can load any state of an embedded copy of the machine, giving it full control over orchestration
  • Spell language lets programs edit and re-evaluate themselves without replaying side effects (e.g., re-evaluating doesn't re-run previous model invocations)
  • Existing frontier models, not trained for SPE or Spell, can already operate in this regime and solve challenging agentic tasks
  • Raises the question of what self-orchestration strategies might emerge if models were specifically trained for self-programmed execution