Demystifying the Recency Heuristic in Temporal-Difference Learning

Brett Daley, Marlos C. Machado, Martha White

Introduction

In reinforcement learning (RL), the temporal credit-assignment problem asks: which past actions are responsible for a current reward? Since the inception of the field, researchers have leaned on the recency heuristic—the intuition that actions closer in time to a reward are more likely to have caused it. This principle is central to algorithms like TD($\lambda$), where "eligibility traces" cause credit to fade exponentially over time.

While biologically intuitive, the mathematical necessity of this heuristic has remained largely unproven. Could we improve learning by assigning credit to a specific "pulse" in the past, such as a fixed 10-step delay? This paper provides the first rigorous justification for the recency heuristic, demonstrating that it is a fundamental requirement for stable convergence in Temporal-Difference (TD) learning.

Defining the Recency Heuristic

The authors formalize the recency heuristic into two distinct categories based on how eligibility weights evolve over time:

  1. Weak Recency Heuristic: Eligibility weights are non-increasing over time.
  2. Strong Recency Heuristic: Eligibility weights are strictly decreasing over time.
Different forms of credit assignment: (a) standard exponential decay (strong recency), (b) truncated/rectangular, (c) non-monotonic violation, and (d) delayed violation.

By introducing a generalized return estimator, the researchers analyzed whether the resulting value-function operators remain "contractions." A contraction mapping is a mathematical property that guarantees an algorithm will converge to a unique fixed point (the correct value function) rather than diverging.

Theoretical Insights: Convexity and Stability

A primary contribution of this work is the "Convex Connection." The authors prove that any return estimator satisfying the weak recency heuristic is logically equivalent to a convex combination of $n$-step returns. This result unifies various return estimators under a single theoretical umbrella.

Crucially, violating the recency heuristic—for instance, by giving more credit to an action five steps ago than one two steps ago—often introduces "negative weights" into the underlying $n$-step returns. These negative weights increase the contraction modulus, making the learning process unstable. The paper shows that "smoothness" in the decay (like the exponential curve in TD($\lambda$)) is less important than the presence of an infinite tail. This tail allows for long-horizon credit assignment without the variance explosions associated with truncated estimators.

Empirical Evidence and Divergence

To validate these theories, the authors utilized a simple 2-state Markov Reward Process (MRP). They demonstrated that even a "benign" violation, such as a simple time delay, can cause the value function to diverge.

Vector field showing the dynamics of a non-recent TD update on a 2-state MRP. The red star indicates the true value function, but the arrows show the learning process diverging away from it.

In larger-scale tests like the 19-state Random Walk, "long-tailed" estimators consistently outperformed truncated versions. This suggests that the empirical success of TD($\lambda$) stems not just from the recency of credit, but from its ability to integrate information over an infinite horizon safely.

Conclusion

This research transforms the recency heuristic from a biological intuition into a mathematical necessity for RL stability. While specific environments with fixed delays might theoretically benefit from non-recent credit assignment, current TD frameworks are not designed to handle them safely. Future work must rethink the formulation of reinforcement signals to allow for targeted credit assignment without sacrificing the convergence guarantees provided by the recency heuristic.

Summary updated

Abstract

The recency heuristic in reinforcement learning is the assumption that stimuli that occurred closer in time to an acquired reward should be more heavily reinforced. The recency heuristic is one of the key assumptions made by TD($\lambda$), which reinforces recent experiences according to an exponentially decaying weighting. In fact, all other widely used return estimators for TD learning, such as $n$-step returns, satisfy a weaker (i.e., non-monotonic) recency heuristic. Why is the recency heuristic effective for temporal credit assignment? What happens when credit is assigned in a way that violates this heuristic? In this paper, we analyze the specific mathematical implications of adopting the recency heuristic in TD learning. We prove that any return estimator satisfying this heuristic: 1) is guaranteed to converge to the correct value function, 2) has a relatively fast contraction rate, and 3) has a long window of effective credit assignment, yet bounded worst-case variance. We also give a counterexample where on-policy, tabular TD methods violating the recency heuristic diverge. Our results offer some of the first theoretical evidence that credit assignment based on the recency heuristic facilitates learning.
BibTeX
@inproceedings{daley2024demystifying,
  author = {Brett Daley and Marlos C. Machado and Martha White},
  title = {{Demystifying the Recency Heuristic in Temporal-Difference Learning}},
  booktitle = {RLC},
  year = {2024},
  url = {https://openreview.net/forum?id=AssY22GOLj},
}
Figure