Manuscript Offprint

arXiv:2610.34208

CORMA: Constraint-Routed Decision Mamba for Generalizable Multi-Constraint Offline Safe Reinforcement Learning

Changxu Ni, Feiran You, Yongan Guo, Hongyang Du, Kang Wei, Le Liang, Yiyang Ni, Jun Li

Abstract

Offline safe reinforcement learning (RL) learns safety-aware policies from static datasets while satisfying safety constraints during deployment. Motivated by the strong trajectory-modeling capabilities of Transformers, recent Decision Transformer (DT)-based methods formulate offline safe RL as conditional sequence modeling by conditioning action generation on return-to-go (RTG) and cost-to-go (CTG) tokens, thereby enabling adaptation to varying safety budgets. However, existing DT-based methods are developed for single-constraint tasks. For tasks with multiple constraints, generalizing learned policies to unseen combinations of safety budgets remains challenging due to the conflicting requirements imposed by heterogeneous constraints. Moreover, the quadratic complexity of Transformer architectures significantly increases the computational overhead in multi-constraint tasks, as representing additional constraints requires more CTG tokens. Recently, Mamba has emerged as an efficient sequence-modeling backbone, offering linear computational complexity and strong generalization capabilities. In this paper, we propose CORMA, a constraint-routed decision Mamba framework for generalizable multi-constraint offline safe RL. CORMA decomposes policy inference into constraint-aware RTG estimation and adaptive action generation, where constraint-specific experts model feasible RTG distributions and a router-guided product-of-experts mechanism fuses these distributions to provide safety-aware guidance for a Mamba-based action decoder. A three-stage optimization strategy is designed to improve training stability. Extensive experiments on OSRL benchmarks demonstrate that CORMA achieves superior reward-safety trade-offs, reduces inference latency by 37% compared with DT-based methods, and exhibits stronger zero-shot generalization to unseen safety-budget combinations than offline safe RL baselines.

Introduction

Reinforcement learning (RL) has achieved remarkable success in complex decision-making tasks (Hansen et al., 2024; Wang et al., 2024). However, in safety-critical domains such as autonomous driving and industrial robot control, agents must maximize task rewards while satisfying safety constraints (Wei et al., 2024; Wachi et al., 2024). Safe RL (Gao et al., 2024; Hazra et al., 2025) addresses this problem.

Copyright © 2027, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved.

Figure

Figure 1: Illustration of the challenges. After pre-training on seen safety-budget regions, Transformer-based sequence models struggle under unseen safety-budget combinations, whereas CORMA generalizes more robustly.

through constrained Markov decision processes (CMDPs), where policies are optimized subject to predefined safety budgets (Liu et al., 2023a; Zhao et al., 2023). Most existing methods, however, require online interactions that may expose the agent or environment to unacceptable risks. Offline safe RL avoids such unsafe exploration by learning entirely from static datasets without additional environmental interactions (Alles et al., 2024; Gong et al., 2025).

Existing offline safe RL methods mainly include model-based (Kidambi et al., 2020; Yu et al., 2020), model-free (Kumar et al., 2020; Kostrikov et al., 2021), and conditional sequence modeling approaches (Chen et al., 2021; Xue et al., 2026). Model-based and model-free methods often rely on Bellman backups, making them susceptible to overestimation and bootstrapping errors in offline settings. Moreover, they are typically trained for fixed safety budgets and thus generalize poorly to unseen safety budgets during training (Achiam et al., 2017). In contrast, methods such as the Constrained Decision Transformer (CDT) condition action generation on return-to-go (RTG) and cost-to-go (CTG), enabling zero-shot adaptation to different safety budgets through conditional sequence modeling (Liu et al., 2023b).

Despite their effectiveness, existing Transformer-based methods are primarily designed for single-constraint tasks and face two major limitations in multi-constraint settings. First, self-attention has quadratic complexity with respect to sequence length, while representing additional constraints requires more CTG tokens, substantially increasing training and inference overhead (Dao et al., 2022; Tay et al., 2022). Second, standard self-attention lacks an explicit mechanism for coordinating multiple CTG conditions and their influence on RTG-guided action generation (Vaswani et al., 2017).

Mamba, a selective state space model (SSM), provides a promising alternative. Its parallel scan mechanism captures long-range causal dependencies with linear computational complexity, while its selective state mechanism dynamically filters task-relevant information (Gu and Dao, 2024). Mamba has shown strong performance in conditional sequence modeling for unconstrained offline RL (Lv et al., 2024; Huang et al., 2024), yet its potential for safe RL with multiple constraints remains unexplored. This motivates the following question: How can Mamba-based conditional sequence modeling efficiently coordinate multiple safety constraints and generalize zero-shot to unseen safety-budget combinations?

To address this, we propose COnstraint-Routed‾\underline{\text{COnstraint-Routed}} decision MAmba‾\underline{\text{MAmba}} (CORMA), a novel Mamba-based conditional sequence modeling framework for generalizable multi-constraint offline safe RL. To be specific, CORMA introduces a constraint-aware expert-routing mechanism, where independent RTG expert networks evaluate diverse safety budgets and model feasible RTG distributions. A gating router assigns adaptive weight scores to these experts, and fuses their predicted distributions through a product-of-experts (PoE) mechanism. The final RTG is then sampled from the fused distribution and fed into a Mamba-based action decoder. To improve training stability, we design a three-stage optimization strategy that separately trains the action decoder, RTG experts, and the router. Experimental results demonstrate that CORMA achieves strong reward-safety trade-offs in multi-constraint safe RL tasks and robust zero-shot generalization to unseen safety-budget combinations. The main contributions of this paper are summarized as follows:

• We identify fundamental limitations of conditional sequence modeling in multi-constraint offline safe RL : additional CTG conditions substantially increase the sequence modeling overhead; while directly concatenating multiple CTG tokens is insufficient to achieve robust generalization under unseen safety-budget combinations.

• We propose CORMA, a novel conditional sequence modeling framework for generalizable multi-constraint offline safe RL. CORMA uses constraint-aware RTG experts to model feasible RTG distributions under different CTG conditions, and fuses them through a router-guided PoE mechanism to generate constraint-aware RTG guidance for a Mamba-based action decoder.

• We conduct extensive experiments on OSRL benchmarks. Results verify that CORMA achieves superior task performance while reduces inference overhead by 37% compared with Transformer-based baselines, and exhibits stronger zero-shot adaptation to unseen safety-budget combinations than existing offline safe RL baselines.

References (41)