Explanation-based Failure Recovery

Ajay GuptaAAAI 1987

Introduction

In classical AI planning, "expert systems" often rely on compiled rules to map situations to actions. While efficient, these systems frequently struggle with synthesis tasks where sub-goals interact in unforeseen ways. When a plan fails, traditional systems typically resort to backtracking, which often leads to "thrashing"—the repetitive execution of slightly varied but fundamentally flawed plans. For instance, a robot might repeatedly attempt to pick up a red-hot metal block with different tools, failing each time because it lacks the fundamental understanding that the tool's melting point is too low.

This paper introduces the TRAP system, which leverages Explanation-Based Learning (EBL) to move beyond simple backtracking. Instead of just trying a different action, the system analyzes the underlying cause of failure using "deep" domain principles to generate generalized constraints that prevent similar errors in the future.

The TRAP Architecture

The authors propose a closed-loop architecture designed to detect and learn from failures before they occur in the real world. The system consists of three primary components: a Planner, a Simulator, and a Recovery Module.

The TRAP architecture: a closed-loop system for planning, simulation, and failure-based constraint learning.

The process begins with the Planner generating a candidate plan. This plan is then passed to the Simulator, which tests it against a detailed domain model. If the simulation detects a violation of domain requirements (e.g., tool damage), it generates a "proof-trace" of the failure. The Recovery Module analyzes this trace to extract the general conditions that led to the failure, feeding these back to the Planner as new constraints (or "guards") to prune future search spaces.

Learning from Failure: Explanation and Generalization

The core innovation lies in treating a failure as a "training example" for learning. While EBL is traditionally used to generalize successful plans, TRAP uses it to learn the concept of "fail."

When a failure is detected, the system constructs an explanation—a proof tree—using fundamental axioms of the world (e.g., physics, heat transfer). This "deep" domain theory allows the system to understand the causal chain leading to the error.

A proof tree explaining why a gripper melts when picking up a heated block.

Once the proof tree is built, the system performs regression: it moves backward through the tree to find the most general set of initial conditions that would cause this specific failure. These conditions are then compiled into a new constraint. For example, instead of just learning that "Gripper A" cannot pick up "Block B," the system learns a general rule: "Do not use a tool to pick up an object if the tool's melting point is lower than the object's temperature."

Evaluation: The Metallurgy Workshop

The TRAP system was implemented in PROLOG and evaluated using a metallurgy workshop simulation. In this scenario, a robot apprentice is tasked with planning the production of a hot-rolled steel bar. The domain theory includes axioms regarding melting points, heat transfer, and physical collisions.

The system successfully demonstrated the ability to avoid thrashing. By specializing its operators with learned constraints, the planner became more efficient over time, automatically rejecting flawed tool choices that it had previously "understood" to be problematic through simulation.

Key Insights and Limitations

A significant insight of this work is the distinction between shallow and deep knowledge. The system uses shallow rules for rapid planning but reverts to deep first principles for troubleshooting. This "optimistic" approach avoids the computational overhead of anticipating every possible interaction, only performing heavy reasoning when a failure actually occurs.

However, the approach has limitations. Exhaustive simulation can be computationally expensive, and if the underlying domain theory is incomplete (e.g., missing facts about thermal expansion), the system cannot explain or learn from related failures. Furthermore, if a failure depends on a very long sequence of actions, the resulting constraints may become overly specific, limiting their utility in different contexts.

Summary updated

BibTeX
@inproceedings{gupta1987explanation,
  author = {Ajay Gupta},
  title = {{Explanation-based Failure Recovery}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {1987},
}
Figure