Compiling Deliberative Reasoning into Reactive Skills

49 concepts36 papers1 proposal

Intelligent agents face a fundamental trade-off between flexibility and speed. When an agent encounters a novel task or environment, it must rely on general-purpose, declarative knowledge—such as explicit step-by-step instructions, causal domain models, or first-principles logic. While highly flexible, executing tasks in this declarative mode is computationally expensive. As Rychener et al. observed in Problems in Building an Instructable Production System, human-provided instructions are typically broken down into many small, explicit steps for clarity. When an automated system interprets these steps one by one, it introduces massive execution overhead.

To bridge this gap, cognitive architectures and autonomous agents employ a mechanism known as knowledge compilation or proceduralization. This process transforms slow, deliberative reasoning into fast, reactive execution structures. As Stuart Russell 0001 formalizes in Execution Architectures and Compilation, knowledge compilation allows an agent to maintain the open-ended adaptability of high-level reasoning while achieving the real-time performance required for practical operation.

The Mechanism of Proceduralization

How does a system transition from slow rule-following to fluid execution? The core intuition is that once a system successfully navigates a complex reasoning path or follows a set of instructions to achieve a goal, it can cache the entire sequence as a single, direct shortcut.

In cognitive science, John R. Anderson investigated this transition by studying how humans learn complex skills like programming. In Learning to Program, John R. Anderson explains that knowledge compilation collapses multiple logical steps into a single, efficient procedural operator through successful problem-solving, bypassing the need for step-by-step working memory tracking.

This concept was operationalized in symbolic AI architectures through mechanisms like "chunking" or macro-rule generation. As Rosenbloom et al. demonstrate in Knowledge Level Learning in Soar, a system can automatically convert the trace of a successful problem-solving episode into a reusable production rule. Instead of re-searching the problem space during subsequent encounters, the agent directly maps the initial environmental conditions to the final result. Golding et al. show how this allows an agent to turn external guidance into general search-control rules, transforming expensive search-based problem solving into efficient, rule-based execution.

[Declarative Mode]
Instruction/Goal -> Step 1 -> Step 2 -> Step 3 -> Action (High Search Overhead)
                       │
                       ▼ (Compiled via Experience)
[Procedural Mode]
Instruction/Goal ────────────────────────────────> Action (Direct Execution)

Similarly, in Explanation-Based Learning (EBL), Gerald DeJong argues in Acquiring Schemata Through Understanding and Generalizing Plans that acquiring new conceptual schemata does not expand a system's fundamental logical capacity, but rather increases processing efficiency. By compiling complex causal derivations into reusable shortcuts, the system avoids re-deriving the underlying causal chain from first principles. This perspective is shared by Pazzani et al. in The Role of Prior Causal Theories in Generalization, where learning is treated as a form of knowledge compilation that condenses multi-step inference paths into reusable schemas.

Eliminating Runtime Overhead

To understand why knowledge compilation works so effectively, we must look at what it eliminates: the computational tax of runtime pattern-matching and goal tracking.

When an agent operates interpretively, it must constantly evaluate its current state against a vast library of rules, constraints, or goals. Bruce G. Buchanan argues in Partial Compilation of Strategic Knowledge that compiling declarative strategic heuristics into procedural plans reduces computational overhead by bypassing the expensive matching process required for opportunistic action selection. By collapsing intermediate goal tracking, the system moves from a flexible but slow match-and-act cycle to a fast, prescriptive execution model.

In high-velocity engineering environments, this optimization is critical. For instance, Laffey et al. demonstrate that compiling symbolic rules into machine-executable code or intermediate postfix formats eliminates the need for expensive pattern-matching during runtime, dramatically increasing the throughput of inference engines. As Tom M. Mitchell summarizes in Becoming Increasingly Reactive, this process reorganizes existing knowledge for efficiency, allowing slow reasoning to be compiled directly into fast reflexes.

From Classical Planners to Modern Agents

The principle of compiling declarative structures into procedural routines spans the history of AI, from early robotics to modern large language model (LLM) agents.

The foundational work on the LAWALY planner by Siklóssy et al. in An Efficient Robot Planner which Generates Its Own Procedures demonstrated that compiling general axiomatic descriptions of actions into specialized executable LISP procedures could transform a search-heavy planning problem into high-performance program execution. Decades later, cognitive architectures like ICARUS continued this trajectory; Langley et al. show in A Unified Cognitive Architecture for Physical Agents how compiling successful reasoning sequences into permanent skill clauses enables a transition from deliberate reasoning to routine, reactive execution.

In interactive task learning, systems like Rosie leverage this transition to internalize human instructions. As Kirk et al. demonstrate in A Demonstration of Interactive Task Learning, a dynamic compilation mechanism transforms slow, declarative task descriptions into efficient procedural rules, allowing the agent to initially reason through new instructions and subsequently execute the learned task at speeds similar to hand-coded software. Mininger et al. extend this in A Demonstration of Compositional, Hierarchical Interactive Task Learning, showing that experience-based compilation allows agents to execute hundreds of subtasks autonomously without constant human clarification.

This enduring paradigm is highly relevant to modern autonomous agents. For example, Wang et al. introduce Agent Workflow Memory, demonstrating that LLM-based agents can induce, abstract, and store reusable workflows from their own experiences, creating a cumulative learning effect where foundational routines serve as modular building blocks. Furthermore, Choi et al. show in NeSyPr: Neurosymbolic Proceduralization For Efficient Embodied Reasoning that multi-step symbolic planning can be compressed into a single inference step by internalizing reasoning patterns as procedural knowledge, drastically reducing latency for embodied agents.

Why It Works: The Cognitive Synergy

Ultimately, knowledge compilation works because it does not force a choice between a slow, smart system and a fast, dumb one. Instead, it creates a symbiotic relationship between the two.

As Booch et al. frame it in Thinking Fast and Slow in AI, a deliberative reasoning system (System 2) handles novel tasks and gradually transfers the resulting solution procedures into a fast, reactive model (System 1). This process mimics the transition from conscious effort to automatic habit.

By allowing fluid conversion between procedural and declarative memory formats—a concept explored by Goertzel et al. in Cognitive Synergy between Procedural and Declarative Learning—intelligent systems can bypass learning bottlenecks. They utilize slow, explicit reasoning to acquire and validate new capabilities, then compile those capabilities into tight, optimized execution loops, achieving both open-ended adaptability and high-performance execution.

Key Foundational Work

Problems in Building an Instructable Production System (1977) — contributed 4 concept elements to this direction.
An Efficient Robot Planner which Generates Its Own Procedures (1973) — contributed 1 concept elements to this direction.
History & citationVersion 2 · 2026-10-04

Current · Permanent link

  1. Version 2 (latest) · 2026-10-04 · 35 papers
  2. Version 1 · 2026-10-04 · 23 papers
Cite this direction

Latest version (a living page):

@misc{lacuna_knowledge_compilation_procedural_compila_40928761,
  title = {knowledge compilation (procedural compilation)},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/knowledge-compilation-procedural-compilation/rdr_4092876189d142b79e78f0a58e73775d},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-19},
}

This exact version (version 2, frozen text):

@misc{lacuna_knowledge_compilation_procedural_compila_40928761_v2,
  title = {knowledge compilation (procedural compilation)},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/knowledge-compilation-procedural-compilation/rdr_4092876189d142b79e78f0a58e73775d/v/2},
  note = {Version 2, frozen 2026-10-04. Accessed 2026-11-19},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake