QHyer: Q-conditioned Hybrid Attention-mamba Transformer for Offline Goal-conditioned RL

Xing Lei, Jincheng Wang, Xuetao Zhang, Donglin Wang

Introduction

Offline goal-conditioned reinforcement learning (GCRL) offers a powerful paradigm for learning goal-reaching policies entirely from static, pre-collected datasets. However, real-world environments present significant hurdles. Collected trajectories are often only partially consistent with the Markov assumption, leaving other segments highly history-dependent. While history-aware sequence models like the Decision Transformer (DT) naturally model long-term dependencies, pure attention mechanisms are computationally inefficient and struggle to balance local Markovian structures with long-range context.

To address these limitations, researchers introduce QHyer (Q-conditioned Hybrid Attention-Mamba Transformer), a novel sequence modeling framework. By replacing trajectory-dependent "Return-to-Go" (RTG) with state-action-dependent Q-values estimated via Normalizing Flows (NFs), and utilizing a Hybrid Attention-Mamba backbone, QHyer enables effective trajectory stitching and content-adaptive history modeling.

The Challenges of Offline GCRL

Learning from static datasets in GCRL is primarily bottlenecked by two issues:

  1. Non-Markovian Data: Real-world datasets often exhibit history-dependent properties (e.g., human "play" data where current actions depend heavily on past context). While pure attention models handle this better than traditional RL, they are computationally expensive and often fail to balance local dynamics with global reasoning. Recent hybrid architectures introduce local extractors, but their fixed-window extraction cannot adapt to varying dependency lengths, often truncating long-range context instead of compressing it.
  2. The "Stitching" Problem under Sparse Rewards: Most offline GCRL datasets use sparse rewards (yielding a '1' only upon reaching the goal). Standard DTs condition on RTG, which is strictly trajectory-dependent. If a trajectory ultimately fails, the RTG is zero for every state within it—even if specific segments were successfully moving toward the goal. This non-discriminative signal makes it nearly impossible for the model to "stitch" together optimal sub-trajectories from diverse, suboptimal demonstrations.

The QHyer Framework

QHyer overcomes these hurdles through three key architectural and methodological innovations:

1. NF-Based Q-Conditioning

The fundamental "aha moment" of QHyer is recognizing that RTG's trajectory dependence prevents effective stitching. Instead of RTG, QHyer conditions the policy on Q-values estimated by Normalizing Flows (NFs). Unlike CVAEs or contrastive methods, NFs provide an exact, properly normalized log-density of reaching a goal. This state-action-dependent Q-value acts as a universal metric to compare segments across different trajectories, allowing the model to identify and stitch high-value segments even from failed demonstrations.

2. Hybrid Attention-Mamba Backbone

To efficiently process sequences, QHyer employs a dual-branch architecture:

  • Self-Attention Branch: Captures global, goal-directed dependencies.
  • Mamba Branch (Selective State-Space Model): Handles temporal dynamics. Unlike fixed-window convolutions used in previous hybrids, Mamba’s input-dependent discretization acts as a "smart" buffer. It enables content-adaptive history compression—automatically expanding its memory for complex history-dependent data (e.g., maintaining ~12 steps on "play" data) and contracting it for simple Markovian data (collapsing to ~3 steps on "noisy" data).

3. Expectile Regression and Concatenated Tokenization

To extract near-optimal behavior from suboptimal data, QHyer is trained using expectile regression with a high threshold ($\tau$). This forces the model to predict the maximum achievable Q-value in the dataset, further facilitating the stitching of the best available behaviors. Additionally, state-goal pairs are represented as a single concatenated token $[s; g]$, ensuring the model remains goal-aware at every decision point without quadratically increasing the sequence length.

Experimental Results

QHyer was rigorously evaluated on two major benchmarks: OGBench (a robotic manipulation suite featuring non-Markovian "play" and Markovian "noisy" datasets) and D4RL (maze navigation tasks specifically testing long-horizon trajectory stitching).

  • State-of-the-Art Manipulation: QHyer significantly outperformed baselines like HIQL, LSDT, and DMamba on OGBench tasks. On the "Cube" play dataset, it achieved a total success score of 152, far surpassing the next best method (GCIQL at 111).
  • Superior Trajectory Stitching: In D4RL AntMaze tasks, where stitching is paramount, QHyer dominated. On the challenging antmaze-large-diverse dataset, QHyer scored 57.5, whereas vanilla DT and many of its variants scored near 0.
  • Inference Efficiency: Despite its sophisticated hybrid architecture, QHyer maintains highly competitive inference times for action selection (~0.017 ms per batch), making it highly viable for real-time robotic control.

Limitations and Future Directions

While QHyer sets a new state-of-the-art, it has limitations. The model currently struggles on "visual-noisy" datasets, where the difficulty of estimating exact densities directly from pixels using NFs introduces errors that neutralize the architectural advantages. Furthermore, the theoretical convergence guarantees of the current framework assume deterministic environment transitions. Extending QHyer to handle highly stochastic environments and complex visual inputs remains a promising frontier for future research.

Summary updated

BibTeX
@inproceedings{lei2026qhyer,
  author = {Xing Lei and Jincheng Wang and Xuetao Zhang and Donglin Wang},
  title = {{QHyer: Q-conditioned Hybrid Attention-mamba Transformer for Offline Goal-conditioned RL}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=MGrOId7zTe},
}
Figure