SafeDec: Constrained Decoding for Safe Autoregressive Generalist Robot Navigation Policies

Parv kapoor, Akila Ganlath, Michael Clifford, Changliu Liu, Sebastian Scherer, Eunsuk KangICML 2026

Introduction

Recent "foundation models" for robotics, such as SPOC and Flare, have demonstrated remarkable zero-shot generalization in navigating indoor environments based on natural language instructions (e.g., "find the mug in the kitchen"). However, these models are purely data-driven. While they might implicitly learn to avoid obstacles like walls, they lack an explicit notion of safety and offer no formal guarantees.

Ensuring safety is traditionally achieved by retraining models with safety costs or employing "shielding" techniques. Yet, retraining massive transformer models is computationally prohibitive and often fails to provide strict guarantees due to the stochastic nature of the models. Furthermore, many real-world safety rules are non-Markovian—meaning the "safe" action depends on the robot's history (e.g., "do not enter the bedroom until you have cleaned your wheels in the hallway"). To address this, researchers have introduced SafeDec, a training-free framework designed to enforce complex, time-dependent safety rules on large, transformer-based robot navigation policies at inference time.

The SafeDec Framework

SafeDec adapts "constrained decoding"—a technique widely used in Large Language Models (LLMs) to enforce grammar or JSON formatting—for the physical world. By treating the underlying policy as a "proposal engine" and using formal logic as a "runtime governor," SafeDec allows black-box generalist models to satisfy formal safety requirements without the need for costly retraining.

The core workflow of SafeDec involves three primary components:

  1. Signal Temporal Logic (STL) Specifications: Safety rules are mathematically formalized using STL. This allows the system to express complex constraints, such as "Always stay 1 meter away from the stove" or "Visit the kitchen only after visiting the pantry."
  2. Look-ahead Dynamics: Because robot safety is defined in physical state space rather than token space, SafeDec utilizes a simple, approximate dynamics model (such as a unicycle model) to predict the future physical state resulting from a candidate action.
  3. Logit Intervention: Before the transformer model selects an action, SafeDec intercepts the "logits" (the raw scores for each possible action) and adjusts them based on the STL constraints.

The framework introduces two distinct methods of intervention:

  • Hard Constrained Decoding (HCD): Any action predicted to violate the STL formula is assigned a probability of zero (a logit of $-\infty$). While this guarantees absolute safety, it can be overly conservative and occasionally causes the robot to get stuck.
  • Robustness Constrained Decoding (RCD): Instead of a hard cutoff, RCD uses the "robustness" score of the STL formula—a continuous measure of how much a constraint is satisfied or violated—to softly reweight the actions. This nudges the model toward safer paths while maintaining a higher rate of task success.

Experimental Evaluation

The researchers evaluated SafeDec using the AI2-THOR photorealistic 3D simulation environment and the CHORES benchmark, a standard suite for embodied AI agents. They tested the framework on three state-of-the-art transformer policies—SPOC, Flare, and PoliFormer—across hundreds of procedurally generated indoor scenes with varying layouts and object placements.

Key Results and Insights

The experiments revealed several critical insights into runtime safety interventions:

  • Conditioning vs. Filtering: Most traditional safety methods simply reject an unsafe action after it is sampled. SafeDec proves more effective because it conditions the generation process, steering the model toward safe actions that still align with the original goal.
  • The Advantage of Soft Constraints: The RCD approach provides a superior trade-off between safety and task completion. By allowing marginally unsafe actions if they are critical for the goal, the robot avoids the "frozen robot" problem common in hard-coded safety systems.
  • Significant Safety Gains: SafeDec drastically improved STL satisfaction across all tests. On "Avoidance" tasks, unconstrained models satisfied safety rules roughly 72-77% of the time. In contrast, HCD achieved 100% safety, and RCD achieved 83-93%.
  • Success Rate Preservation: While hard filtering often tanked task success rates (dropping them by 10-15%), RCD kept success rates within 0.5–6.5% of the unconstrained baselines. Furthermore, SafeDec performed comparably to SafeVLA (a model specifically trained for safety) despite requiring zero training or fine-tuning.
  • Dynamics Agnosticism: Surprisingly, SafeDec works well even with a very simple unicycle dynamics model, demonstrating graceful degradation when the model's predictions are not perfectly accurate.

Limitations and Future Directions

While SafeDec offers a robust, plug-and-play safety solution, it has limitations. It relies on an approximate dynamics model; while a unicycle model suffices for navigation, more complex tasks like manipulation will require sophisticated world models. Additionally, the system assumes the robot has accurate state estimation and localization to verify constraint satisfaction.

Currently, a roboticist must manually write the STL formulas. Future work could leverage LLMs to automatically translate natural language safety concerns into formal STL specifications. Finally, checking complex temporal formulas for every possible action introduces a small amount of inference latency, which must be optimized for highly dynamic real-time applications.

Summary updated

BibTeX
@inproceedings{kapoor2026safedec,
  author = {Parv kapoor and Akila Ganlath and Michael Clifford and Changliu Liu and Sebastian Scherer and Eunsuk Kang},
  title = {{SafeDec: Constrained Decoding for Safe Autoregressive Generalist Robot Navigation Policies}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=woiiKET6bn},
}
Figure