Improving Example-Guided Unfolding

Henrik Boström

Abstract

In logic programming, learning from past successes through Explanation-Based Generalization (EBG) often introduces the "Utility Problem," where the overhead of managing learned rules outweighs their execution benefits. This paper presents EGU II, an improved algorithm for Example-Guided Unfolding that utilizes formal program transformations—Definition, Unfolding, and Folding—to incorporate learned knowledge without the typical costs of redundancy and increased unification. Experimental results on the MIU system demonstrate that EGU II consistently outperforms both standard EBG and the original EGU algorithm by maintaining a lean search space and preserving program structure.

Introduction: The Utility Problem

A central challenge in machine learning for logic programming is the "Utility Problem." While Explanation-Based Generalization (EBG) allows a system to create "shortcuts" (new clauses) from successful proofs, these shortcuts often degrade performance. This degradation typically stems from three factors:

  1. Increased Unification Cost: Every new rule adds to the number of clauses the system must check against a goal.
  2. Inter-clause Repetition: Multiple rules may call the same sub-goals, leading to redundant computations.
  3. Redundancy: The system may arrive at the same conclusion through multiple paths, wasting resources on duplicate proofs.

While the original Example-Guided Unfolding (EGU) algorithm was designed to eliminate redundancy, it frequently exacerbated unification costs and repetition. EGU II is introduced as a refined approach to resolve these trade-offs.

Methodology: From EGU to EGU II

EGU II is grounded in a framework of formal program transformations. The primary innovation lies in how it handles the "remainder" of a proof path once a shortcut is identified.

The Original EGU Approach

The original EGU algorithm functioned by "unfolding" (expanding) goals within a rule. However, this often required copying the "prefix" of a rule multiple times. This structural duplication led to massive repetition across the program, significantly slowing down the unification phase.

The EGU II Innovation

EGU II avoids the pitfalls of its predecessor by introducing a Definition step. Instead of merely expanding goals, the algorithm creates a new helper predicate to represent the specific sequence of goals in a proof path. It then employs Folding to replace the original complex sequence with a single call to this new helper predicate.

By "wrapping" learned knowledge into these discrete new predicates, EGU II maintains the logical equivalence of the program while preventing the top-level logic from becoming cluttered. This structural preservation ensures that the search space is pruned without introducing the overhead of redundant prefixes.

Experimental Evaluation

The efficacy of EGU II was evaluated using the MIU System, a formal string-manipulation logic popularized by Douglas Hofstadter.

Dataset and Setup

  • Task: Transforming strings using a sequence of four specific rules.
  • Data: A corpus of 282 theorems, defined as strings provable within six rule applications.
  • Scaling: The training set size was varied from 10% to 100% of the total theorems to observe how the algorithm scales as it accumulates learned knowledge.

Key Results

The experiments revealed a clear performance hierarchy:

  • Original EGU: Often performed worse than a baseline program with no learning, particularly when the training set was small (under 80%). The overhead of the transformation outweighed the benefits of redundancy elimination.
  • Redundant EBG: Performed better than the original EGU but still suffered from the classic utility problem as the rule set grew.
  • EGU II: Consistently emerged as the fastest algorithm. It significantly reduced CPU time compared to both EBG and the original EGU.

Notably, EGU II proved beneficial even in scenarios where redundancy was not the primary bottleneck. The transformation process effectively "pre-calculates" certain failure branches, allowing the system to identify and abandon dead ends more rapidly.

Discussion and Insights

The success of EGU II highlights that redundancy elimination is not a "free lunch." If the method used to eliminate redundancy involves duplicating logic (as in the original EGU), it simply shifts the bottleneck to the unification phase. EGU II succeeds because it preserves the original program's structure more effectively.

However, the benefits of EGU II remain domain-dependent. The algorithm is most effective in domains with operational predicates and recursive learned clauses. In simpler domains, the redundancy problem may be negligible, reducing the relative advantage of the transformation.

Conclusion and Future Work

EGU II provides a robust solution to the Utility Problem by leveraging definition and folding to integrate learned shortcuts cleanly. Future research will focus on generalizing these transformations to handle recursive concepts (e.g., "N-fold" applications of a rule) and developing heuristics to perform cost-benefit analyses, ensuring the system only applies transformations when the predicted speedup justifies the computational cost of the transformation itself.

Summary updated

BibTeX
@inproceedings{bostrom1993improving,
  author = {Henrik Boström},
  title = {{Improving Example-Guided Unfolding}},
  booktitle = {ECML},
  year = {1993},
  doi = {10.1007/3-540-56602-3\_132},
}
Figure