GrASP: Gradient-Based Affordance Selection for Planning

Vivek Veeriah, Zeyu Zheng, Richard Lewis, Satinder Singh

TL;DR

Tree-search planning in reinforcement learning (RL) struggles with continuous action spaces because expanding an infinite branching factor is intractable. GrASP (Gradient-based Affordance Selection for Planning) solves this by learning a small, discrete set of state-conditioned action proposals ("affordances") by directly differentiating through the planning tree computations. This allows agents to construct compact lookahead trees that outperform strong model-free baselines and match state-of-the-art model-based methods across continuous control and hierarchical tasks.

What Problem Does This Paper Address?

Model-based RL algorithms relying on tree searches—such as AlphaGo and MuZero—have achieved superhuman success in discrete action domains like Go, Chess, and Atari. However, extending these methods to continuous action spaces poses a fundamental challenge: even at the root node, branching out requires searching over infinite possible actions.

Prior continuous extensions typically rely on progressive widening, random sampling, or shooting methods, which can suffer from sample inefficiency or require hundreds of rollouts. This paper tackles how an agent can dynamically identify a small subset of high-utility actions or options (temporally extended actions)—termed affordances—to build tractable, compact lookahead search trees.

Methods

GrASP introduces an end-to-end framework where the affordance generator and the world model are learned concurrently:

  • Learned Value-Equivalent Model: Following MuZero, GrASP learns an observation encoder ($f^{\text{encode}}$), latent dynamics ($f^{\text{dynamic}}$), reward predictor ($f^{\text{rew}}$), and value network ($f^V$), trained via self-play experience in a replay buffer. Crucially, GrASP extends this architecture beyond single-step transitions to model multi-step continuous options.
  • Affordance Module: Parameterized by $\theta^{\text{afford}}$, this module maps an abstract state $s$ (and optional goal $g$) to a discrete set of $K$ continuous action/option vectors $\{a^1, \dots, a^K\}$.
  • End-to-End Gradient Optimization: Instead of treating action pruning as a heuristic, GrASP optimizes $\theta^{\text{afford}}$ by differentiating directly through the planning tree’s value backup: $$\frac{\partial V(s_0)}{\partial \theta^{\text{afford}}} = \sum_{b \in \{a^1, \dots, a^K\}} \left[ \frac{\partial \pi(b|s_0)}{\partial \theta^{\text{afford}}} Q(s_0, b) + \pi(b|s_0) \frac{\partial Q(s_0, b)}{\partial \theta^{\text{afford}}} \right]$$ Gradients flow recursively from the leaf nodes back to the root using automatic differentiation.

  • Planning Algorithms: GrASP tests two tree-expansion mechanisms:

  • Complete K-ary trees of shallow depth (typically $D = 2$), bootstrapping from learned value functions at the leaves.
  • UCT-based Monte Carlo Tree Search (MCTS) for deeper, non-exhaustive search.

Datasets

Evaluations were performed on simulated benchmark environments rather than static datasets:

  1. DeepMind Control Suite (9 continuous primitive-action tasks): Reacher-Easy, Cartpole-Swingup, Point-Mass-Easy, Ball-In-Cup-Catch, Fish-Swim, Fish-Upright, Cheetah-Run, Finger-Spin, and Walker-Walk. State-based features were used (with pixel-based experiments also conducted for Dreamer comparisons).
  2. Three Hierarchical Multi-Task Benchmarks (with continuous options):
  3. Collect: A 2D navigation environment requiring sequential collection of three randomized objects ($A, B, C$).
  4. Ant-Gather: Adapted from Florensa et al. (2017), requiring an Ant agent to collect 3 apples while avoiding 5 bombs.
  5. Point-Mass (Hierarchical): Reaching 3 target checkpoints in a specified sequence with continuous 4D velocity/position options.

Key Insights and Ideas

  • Planning Through Affordances Beats Single-Policy Imagination: Setting $K=1$ reduces the method to learning a single trajectory policy via latent model gradients (similar to Dreamer or SVG). Setting $K > 1$ with planning consistently outperformed $K=1$, proving that searching over branching affordances provides concrete optimization benefits over single-path imagination.
  • Emergence of Semantic Affordances: Without explicit object-centric supervision, GrASP discovered human-interpretable choices. In Collect, separate affordance heads learned to target distinct objects; in Ant-Gather, heads generated paths navigating directly to food items while avoiding bombs.
  • Rapid Policy Switching: Analysis showed that the executed policy rapidly switches between the outputs of different affordance heads during an episode, confirming that multiple affordances work synergistically rather than collapsing to a single mean action.

Key Results

  • Continuous Control (DM Control Suite): Goal-conditioned GrASP ($K=4$, $D=2$) outperformed the strong off-policy model-free baseline TD3 in 8 out of 9 tasks in sample efficiency and asymptotic return (only underperforming in Cartpole-Swingup).
  • Hierarchical Option Selection: On all three hierarchical benchmarks (Collect, Ant-Gather, Point-Mass), GrASP achieved near-optimal rewards within 500,000 steps, whereas TD3 showed near-zero learning progress within the same timeframe (and lagged significantly even when trained up to 1M steps).
  • Comparison with Dreamer (Pixels): When trained directly from pixels with action repeat 2, GrASP ($K=4$) was competitive with or superior to Dreamer in 3 out of 4 tested tasks (Ball-in-Cup-Catch, Finger-Spin, Walker-Walk).

Limitations and Future Work

  • Integration with Full-Scale MCTS: The current implementation uses relatively shallow complete trees ($D=2$) or standard UCT. Integrating GrASP into modern, large-scale search architectures like Sampled MuZero remains unexplored.
  • Affordance Output Collapse: In certain environments like Walker-Walk and Ball-in-Cup-Catch, the difference in returns between heads was tightly centered around zero, indicating that affordances sometimes collapsed toward similar behaviors.
  • Computational Cost: Differentiating through large planning trees adds computational and memory overhead during training, requiring careful tuning of search depth and batch sequence lengths.

Summary updated

BibTeX
@inproceedings{veeriah2022grasp,
  author = {Vivek Veeriah and Zeyu Zheng and Richard Lewis and Satinder Singh},
  title = {{GrASP: Gradient-Based Affordance Selection for Planning}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=zrdUVVAvcP2},
}
Figure