Real-Time Problem-Solving with Contract Algorithms

Shlomo Zilberstein, François Charpillet, Philippe ChassaingIJCAI 1999

Abstract

In real-time artificial intelligence, systems must often provide solutions under unpredictable time constraints. While "anytime algorithms" are designed to return a result at any moment, they are frequently implemented as "contract algorithms"—processes that require a pre-specified execution time to produce a result. This paper establishes a theoretical framework for converting contract algorithms into interruptible ones. By analyzing the "acceleration ratio," the authors prove that a doubling strategy for contract lengths is optimal when the deadline is unknown, yielding a performance guarantee within a factor of 4 of an ideal system. Additionally, the paper extends these results to multi-tasking environments and stochastic settings using Markov Decision Processes (MDPs).

Introduction

In dynamic environments, AI agents rarely have the luxury of infinite computation time. This has led to the widespread adoption of anytime algorithms, which improve the quality of their output as a function of execution time. However, a critical distinction exists within this category: interruptible algorithms, which can be stopped at any time to provide a result, and contract algorithms, which require a fixed time allocation (a "contract") before execution. If a contract algorithm is interrupted before its specified time, it typically fails to return any usable result.

Because contract algorithms are often easier to design—such as depth-limited search or fixed-iteration optimization—the challenge lies in using them to build robust, interruptible systems. This paper addresses the meta-level control problem: how should a system sequence multiple contracts of varying lengths to ensure the best possible performance regardless of when an interruption occurs?

Theoretical Framework: The Acceleration Ratio

To evaluate the efficiency of an interruptible system built from contract algorithms, the authors introduce the concept of the acceleration ratio ($r$). This ratio measures the factor by which a processor would need to be sped up for an interruptible system to match the performance of a contract system that knew the deadline in advance.

Formally, if an interruptible algorithm requires time $A(q)$ to reach quality $q$, and a contract algorithm requires time $C(q)$, the acceleration ratio is the supremum of $A(q)/C(q)$ over all possible quality levels. The goal of the meta-level controller is to find a sequence of contract lengths $(x_1, x_2, x_3, \dots)$ that minimizes this ratio.

Optimal Deterministic Strategies

The "Magic Number 4"

For a single task with an unknown deadline, the authors prove a fundamental limit: the optimal acceleration ratio is exactly 4. This means that an interruptible system constructed from a contract algorithm is, at its worst, only four times slower than a system with perfect foresight of the deadline.

The Doubling Strategy

The strategy that achieves this optimal ratio is a geometric progression where the length of each subsequent contract is doubled ($x_{i+1} = 2x_i$). By repeatedly running the algorithm with exponentially increasing time limits, the system ensures that when a deadline eventually hits, the most recently completed contract was long enough to provide a high-quality result relative to the total time elapsed.

Generalization to Multiple Tasks

The paper extends this analysis to scenarios where a system must solve $m$ independent tasks simultaneously (e.g., exploring multiple branches of a search tree in parallel). The authors establish that the optimal acceleration ratio for $m$ tasks is given by:

$$r = \frac{(m+1)^{m+1}}{m^m}$$

For instance, if a system is managing two tasks ($m=2$), the optimal ratio increases to 6.75. This formula provides a theoretical bound for resource allocation in parallel real-time processing.

Stochastic Modeling via MDPs

When the deadline is not entirely unknown—for example, if the system has a probability distribution of expected interruption times—the deterministic doubling strategy is no longer optimal. In these cases, the authors frame the problem as a Markov Decision Process (MDP).

Using dynamic programming, the authors derive an optimal policy that maximizes expected utility. This model considers the probability of the algorithm finishing a contract before the deadline and the diminishing marginal utility of result quality over time. The resulting value function allows a system to compute the optimal next contract duration $T$ based on the current quality $q$ and the total time $t$ already spent.

Conclusion and Limitations

This research provides a rigorous foundation for real-time meta-level control. By proving the optimality of the doubling strategy and providing a framework for stochastic deadlines, the authors bridge the gap between easy-to-design contract algorithms and the requirements of unpredictable, real-time environments.

However, several limitations remain for future exploration:

  1. Monotonicity: The proofs assume that algorithm performance increases continuously and monotonically. Real-world algorithms with "plateaus" or sudden jumps in quality may require more nuanced strategies.
  2. Observability: The MDP model assumes the system can perfectly observe the quality of a result immediately upon contract completion. In environments with partial observability, integration with POMDP frameworks would be necessary.
  3. Time Granularity: The stochastic solutions rely on discrete time units. While sufficient for most applications, high-precision systems might require continuous-time extensions of these models.

Summary updated

BibTeX
@inproceedings{zilberstein1999real,
  author = {Shlomo Zilberstein and François Charpillet and Philippe Chassaing},
  title = {{Real-Time Problem-Solving with Contract Algorithms}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {1999},
}
Figure