- The paper introduces Long-Horizon Q-Learning (LQL) which uses trajectory-wise optimality inequalities as hinge penalties to constrain value overestimation in off-policy RL.
- Experimental results show LQL consistently outperforms 1-step and n-step TD methods, achieving up to 76% success on challenging long-horizon tasks.
- The approach offers computational efficiency with minimal overhead while providing stable Q-value estimation in sparse-reward and high-dimensional environments.
Long-Horizon Q-Learning: Accurate Value Learning via n-Step Inequalities
Introduction and Motivation
Off-policy value-based reinforcement learning (RL) methods, especially Q-learning and its deep variants, face significant challenges when scaling to long-horizon tasks. The fundamental problem arises from the reliance on bootstrapping, where estimation errors in later states are propagated backward and can amplify across temporal-difference (TD) updates. While conventional strategies, such as using n-step TD and λ-returns, seek to mitigate compounding error by leveraging multi-step targets, these approaches inherit an innate tension: in off-policy contexts, the target value necessarily follows the (possibly suboptimal) actions logged in the replay buffer, resulting in pessimistic estimates when suboptimal actions are present. Furthermore, increasing n introduces substantial off-policy bias and sample inefficiency.
This work introduces Long-Horizon Q-Learning (LQL), a method that integrates trajectory-based optimality inequalities as a practical and computationally efficient backstop for off-policy RL. LQL supplements the standard TD error with hinge penalties based on a trajectory-wise optimality tightening principle, providing a direct and low-overhead mechanism to constrain value overestimation and propagate reward signal robustly across extended time horizons.
LQL relies on the following insight: for any given state, acting optimally from the current moment must always yield performance at least as good as committing to any arbitrary future action sequence before switching to optimal behavior. This leads to a set of trajectory-wise optimality inequalities that can be instantiated as two-sided hinge penalties in the Q-function objective:
- Lower-Bound (LB) Penalty: For any time indices k,ℓ with ℓ>k, LQL penalizes cases where Q(sk​,ak​)<Gk:ℓ​+γℓ−kQ(sℓ​,aℓ∗​), pushing value estimates upward if the cumulative reward along the observed trajectory plus the bootstrapped value at step ℓ exceeds the estimate at step k.
- Upper-Bound (UB) Penalty: For any i≤k, LQL enforces Q(si​,ai∗​)≥Gi:k​+γk−iQ(sk​,ak​), penalizing over-optimistic Q-values that would suggest exceeding the performance of the greedy policy from any previous point.
A key strength of LQL is its implementation efficiency: unlike prior optimality tightening approaches, no auxiliary networks or additional forward passes are required. All penalties utilize the same critic and target network computations as standard TD learning.
(Figure 1)
Figure 1: LQL establishes a principled backstop; compounding TD error in conventional methods is bounded by cross-temporal constraints.
The combined objective for each replayed trajectory is: λ0
where λ1 is the 1-step TD loss, and λ2, λ3 are the mean squared hinge penalties over all suitable λ4 or λ5 index pairs. Empirically, default penalty coefficients (λ6) are used without per-task tuning.
Empirical Evaluation
LQL is comprehensively evaluated on the OGBench and RoboMimic benchmarks, with experiments spanning manipulation, navigation, and long-horizon sparse-reward domains, including difficult settings like humanoid locomotion through giant mazes (episode lengths λ7 steps) and offline-to-online RL under policy behavioral heterogeneity.
To ensure that LQL's benefit is not coupled to a particular actor or extraction mechanism, four diverse policy extraction approaches are employed:
For each, the underlying critic is trained with either 1-step TD, λ9-step TD, or LQL.
Results Overview
Across all policy architectures and environments, LQL consistently outperforms both 1-step TD and n0-step TD. Particularly on long-horizon sparse-reward tasks, LQL produces substantial gains, e.g., on the humanoidmaze-giant task, LQL achieves ~n1 average success where 1-step TD fails completely, and n2-step TD peaks at 38.4% for n3 before degrading due to off-policy bias at larger n4.
The runtime overhead of LQL is minimal: empirically measured at only 4-5% per update across policy classes, with further amortization as network size increases.
Value Stability and Error Attribution
Ablation studies disentangle the source of LQL's benefit, showing that the improvement is not explained by trajectory minibatching alone—removing the hinge losses annihilates the gains.
Figure 2: LQL's gains are not explained by trajectory sampling alone; hinge penalties yield statistically significant improvements in success rates across environments and batch sizes.
Additionally, LQL stabilizes the learned Q-function, preventing the classic value blowup often observed in function approximation settings under TD learning. Hinge penalties enforce analytic bounds on Q-values, suppressing overestimation.
Analysis and Theoretical Considerations
From a theoretical viewpoint, while the optimality inequalities used by LQL are strict in-expectation results, per-sample hinge penalties in stochastic domains introduce some bias in the presence of stochastic dynamics. The paper establishes horizon-independent upper bounds on this bias (Appendix, Section~\ref{app:false_penalties}) and demonstrates empirically that LQL retains its advantage in both deterministic and stochastic settings, with robustness to penalty magnitude hyperparameters.
Furthermore, the trajectory length n5 is revealed as a practical scaling axis. Unlike batch size (where larger batches may harm performance due to overfitting to inaccurate targets), increasing n6 in LQL admits strictly better final performance across tasks, provided sufficient computational budget.
Comparison to Prior Optimality Tightening
LQL extends the optimality tightening work of He et al. (He et al., 2016) by directly incorporating actor policy actions in the penalty computation, avoiding redundant critic evaluations and allowing for same-state upper bounds. Empirically, this design outperforms prior OT methods across continuous control tasks, pointing to more efficient and stable optimization.
Implications and Future Directions
LQL provides a viable, computationally attractive mechanism for leveraging long-horizon structure in off-policy RL. Its ability to propagate learning signal across thousands of timesteps without suffering from the batch scaling pathologies of TD enables new performance regimes in sparse-reward and offline–to-online settings, and its design is broadly compatible with modern actor architectures, including diffusion and chunked policies.
The main limitation remains on the theoretical side: per-sample hinge penalties induce an irreducible bias under strong environment stochasticity. Potential advances could include hybridizing LQL with n7-step TD learning to combine accelerated reward propagation with cross-temporal value regularization, and further dissecting the relative contributions of LB and UB penalties to value stability.
Conclusion
Long-Horizon Q-Learning offers a robust, scalable approach for addressing compounding error in off-policy, value-based RL. By operationalizing trajectory-wise Bellman inequalities as hinge penalties, LQL advances the stability and efficacy of RL in long-horizon and heterogeneous-data regimes. These results clarify the bottlenecks of conventional multi-step learning and chart promising directions for scaling off-policy RL to real-world domains with challenging temporal credit assignment structure.