C-Learning: Horizon-Aware Cumulative Accessibility Estimation

Panteha Naderian, Gabriel Loaiza-Ganem, Harry J. Braviner, Anthony L. Caterini, Jesse C. Cresswell, Tong Li, Animesh Garg

In the world of multi-goal reinforcement learning (RL), we usually ask an agent to do one thing: reach the goal. But in the real world, "reaching the goal" isn't a binary outcome. Sometimes you need to get there as fast as possible, even if it’s risky. Other times, you have all day and would prefer the safest route possible.

Standard goal-conditioned RL algorithms struggle with this nuance. They typically learn a single policy that averages out these behaviors or converges to a sub-optimal middle ground. To address this, researchers introduced C-Learning, a framework that explicitly accounts for the time horizon to enable a dynamic trade-off between speed and reliability.

The Core Problem: Q-Learning's Limitations

Most multi-goal RL agents learn a $Q$-function to estimate the "value" of an action. However, $Q$-learning faces three major hurdles in complex environments:

  1. The Speed-Reliability Trade-off: Standard policies don't let you choose how to act at test time. If there’s a shortcut through a dangerous area, the agent can't be told to "be careful" or "hurry up" without retraining.
The Speed-Reliability Trade-off
  1. Sample Inefficiency: Learning an optimal $Q$-function to high precision is difficult. In sparse reward settings, the difference between an optimal action and a slightly sub-optimal one might be a tiny margin for a neural network to distinguish.
  2. Complex Motion Planning: In environments with non-holonomic constraints (like a car that can't move sideways), simple distance metrics fail, and standard RL often produces "jittery" or inefficient paths.

The Solution: Cumulative Accessibility Functions

C-Learning introduces Cumulative Accessibility Functions ($C$-functions), which estimate the probability of reaching a goal within a specific time horizon. By making the policy "horizon-aware," the agent can choose between risky shortcuts and safe-but-long paths at test time.

The core innovation is the Optimal Cumulative Accessibility Function, $C^*(s, a, g, h)$. This function represents the probability that an agent can reach goal $g$ from state $s$ in at most $h$ steps, given it takes action $a$ and acts optimally thereafter.

Key Technical Shifts

  • The Recurrence Relation: $C$-functions obey a Bellman-like recurrence: $C^*(s, a, g, h) = \mathbb{E}_{s' \sim p} [\max_{a'} C^*(s', a', g, h-1)]$.
  • Binary Cross-Entropy (BCE) Loss: Unlike $Q$-learning, which uses Mean Squared Error (MSE), C-Learning uses BCE. Because $C$ represents a probability, BCE provides unbiased estimates of the gradients even when using stochastic samples from the environment.
  • Horizon-Aware Policies: The policy $\pi(a|s, g, h)$ takes the remaining time $h$ as an input. At test time, you can "dial in" the desired behavior by providing a small $h$ (for speed) or a large $h$ (for safety).

Why C-Learning Works: A Clearer Signal

One of the most significant advantages of C-Learning is the clarity of the learning signal it provides to the neural network.

Clearer Signal in C-Learning

In a standard Q-learning setup, the difference between an optimal action and a sub-optimal one might be represented by a $Q$-value gap of $0.95$ vs $0.93$. This narrow margin is notoriously difficult for neural networks to learn efficiently. However, for a minimal horizon $h^*$, the $C$-value for the optimal action is exactly $1$, while the sub-optimal action is $0$. This stark $1.0$ vs $0.0$ gap provides a much stronger, clearer gradient for the network.

Additionally, $C^*$ is mathematically monotonic in $h$ (the probability of reaching a goal can only stay the same or increase if you are given more time), which naturally stabilizes the learning process.

Key Results and Performance

The authors evaluated C-Learning across four distinct domains, ranging from a discrete Frozen Lake grid-world to highly complex continuous control tasks like Dubins’ Car navigation and high-dimensional robotic manipulation (FetchPickAndPlace and HandManipulatePen).

C-Learning consistently outperformed benchmarks like Hindsight Experience Replay (HER) and Goal-Conditioned Supervised Learning (GCSL):

  • Success Rates: On the difficult HandManipulatePen task, C-Learning achieved a ~40% success rate, nearly doubling the performance of HER (~22%).
  • Path Optimality: In the Dubins' Car environment, C-Learning found paths that were significantly shorter and more direct than GCSL.
  • Sample Complexity: C-Learning reached high success rates in roughly half the environment interactions compared to naive horizon-aware $Q$-learning.

Limitations and Future Directions

While highly effective, C-Learning has a few open challenges. Although theory dictates that $C$ is monotonic in $h$, explicitly forcing the neural network to be monotonic via specialized architectures actually hurt performance in practice. Furthermore, while BCE is unbiased for the loss, the $\max$ operator in the Bellman update still introduces standard overestimation bias, requiring TD3-style mitigations.

Looking forward, $C$-functions show immense promise for Hierarchical RL, where a high-level "manager" could use the $C$-function to reliably pick sub-goals guaranteed to be reachable within a specific time frame.

Summary updated

BibTeX
@inproceedings{naderian2021c,
  author = {Panteha Naderian and Gabriel Loaiza-Ganem and Harry J. Braviner and Anthony L. Caterini and Jesse C. Cresswell and Tong Li and Animesh Garg},
  title = {{C-Learning: Horizon-Aware Cumulative Accessibility Estimation}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
}
Figure