What if the World Were Different? Gradient-Based Exploration for New Optimal Policies

Rui Silva, Francisco S. Melo, Manuela Veloso

Introduction

In standard artificial intelligence planning, the environment is treated as a static backdrop. Whether navigating a maze or managing a warehouse, agents are typically designed to find the best path within fixed constraints. However, in many real-world scenarios—particularly those involving human-robot interaction—the environment is not immutable. A robot blocked by a door can ask a human to open it; a factory layout can be rearranged to streamline logistics.

This paper introduces a novel framework for "What If" reasoning, where agents don't just plan within a world, but actively suggest changes to the world itself to unlock more efficient optimal policies.

Formalizing the "What If" Problem

The authors extend the standard Markov Decision Process (MDP) by parameterizing the world configuration as a vector $\theta$. These parameters influence the transition probability matrix $P_\theta$. For instance, $\theta$ might represent the probability that a door is unlocked or the physical coordinates of a target object.

The Objective Function

The goal is to find a configuration $\theta$ that maximizes the following objective: $$F(\theta) = J(\theta) - C(\theta)$$ Where:

  • $J(\theta)$ is the expected reward of the optimal policy in world $\theta$.
  • $C(\theta)$ is the "cost of change"—a penalty for deviating from the original world state.
The non-linear objective function $F(\theta)$ representing the trade-off between reward and cost.

As shown in the figure above, $F(\theta)$ is often non-linear and non-convex. There may be regions where small changes to the world provide no benefit until a certain threshold ($\theta'$) is reached, at which point the optimal policy shifts and rewards increase.

The p-iteration Algorithm

To navigate this complex optimization landscape, the authors propose p-iteration. This gradient-based algorithm treats the world configuration as a differentiable parameter.

The primary challenge lies in calculating the gradient of the value function, $\nabla_\theta J(\theta)$. The authors leverage the fact that for small perturbations in $\theta$, the optimal policy $\pi^*$ remains stable. This allows them to approximate the gradient using the matrix inverse of the transition probabilities. By combining this with the Adam optimizer and projected gradient descent, the agent can iteratively "nudge" the world toward a more favorable configuration. To combat the issue of local maxima, the algorithm employs random restarts.

Experimental Evaluation

The framework was tested across several diverse domains, ranging from synthetic grid worlds to real-world-inspired robotic tasks:

  1. Grid Worlds: In maze and corridor scenarios, the agent learned to identify which "walls" were worth converting into "doors" based on the cost-to-reward ratio.
  2. Taxi Domain: In this classic RL benchmark, the agent suggested structural changes to the map that significantly increased expected rewards (from ~80.1 to ~89.9).
  3. Robotic Water Pouring: Using real-world robot data, the algorithm determined the optimal placement for a cup to maximize pouring success while minimizing the effort required to move the cup.
A grid-world environment where an agent navigates around obstacles.

Key Insights and Limitations

The shift from "passive observer" to "active participant" in environmental design represents a significant step forward for autonomous systems. By making transitions differentiable, the authors turn discrete logical hurdles into continuous optimization problems.

However, several challenges remain. The non-convexity of the objective function means global optimality is not guaranteed. Furthermore, the model assumes the agent has access to a well-defined cost function $C(\theta)$. In practice, determining the "cost" of a human opening a door or moving furniture involves complex social and physical modeling that remains an open area for future research.

Summary updated

BibTeX
@inproceedings{silva2018what,
  author = {Rui Silva and Francisco S. Melo and Manuela Veloso},
  title = {{What if the World Were Different? Gradient-Based Exploration for New Optimal Policies}},
  booktitle = {GCAI},
  year = {2018},
  doi = {10.29007/6jsv},
}
Figure