Constrained Decoding for Robotics Foundation Models

Parv Kapoor, Akila Ganlath, Michael Clifford, Changliu Liu, Sebastian A. Scherer, Eunsuk KangarXiv 2025 · DOI

Introduction

Robotics Foundation Models (RFMs) have demonstrated remarkable "zero-shot" capabilities, enabling robots to perform complex navigation and manipulation tasks from natural language instructions. However, these data-driven models often lack explicit safety constraints, relying instead on patterns learned from large datasets. In real-world applications, "probabilistic safety" is insufficient; formal guarantees are required to prevent hazardous collisions or unauthorized zone entries.

Traditionally, enforcing such rules necessitated expensive model retraining or post-hoc filtering that could lead to erratic behavior. This research introduces SafeDec, a framework that enforces complex, time-dependent safety constraints on "black-box" transformer models during the action-generation process without requiring retraining.

Methods: The SafeDec Framework

SafeDec intervenes at the decoding stage—the moment the transformer model determines the next action. The framework utilizes Signal Temporal Logic (STL) to formally define safety rules, such as maintaining a minimum distance from obstacles or remaining within geofenced boundaries.

SafeDec System Architecture: The Constrained Action Decoder sits atop a transformer-based policy, using STL safety specs to adjust action tokens.

The system employs two primary decoding strategies:

  1. Hard Constrained Decoding (HCD): A "safety-first" approach where actions predicted to violate STL rules are masked (probability set to zero).
  2. Robustness Constrained Decoding (RCD): A "soft" approach that reweights action probabilities based on their STL robustness score, guiding the model toward safer choices without overriding its original intent.

To evaluate safety in real-time, SafeDec uses a "unicycle" dynamics model to predict future states. The underlying computational engine, STLCG++, ensures minimal overhead, adding only ~0.01 milliseconds per decision step.

Experimental Results

The framework was evaluated using the CHORES benchmark in AI2-THOR across three state-of-the-art RFMs: SPOC, PoliFormer, and Flare. The results demonstrate a significant improvement in safety satisfaction across different tasks, including obstacle avoidance and geofencing.

Quantitative results comparing Unconstrained, Filtering, HCD, and RCD decoding strategies across three foundation models.

Key findings include:

  • Guaranteed Safety: HCD achieved 100% STL satisfaction across all tested models, effectively eliminating safety violations.
  • Performance Balance: While HCD can sometimes lead to "timid" behavior and lower success rates (SR), RCD provides a superior balance. It improved safety satisfaction to 80–95% (up from 68–78% in unconstrained models) while maintaining task success rates within 1–5% of the baseline.
  • Model Agnosticism: SafeDec functions as a plug-and-play solution, treating the underlying RFM as a black box, which facilitates its application to future, larger models.

Discussion and Future Work

The core contribution of SafeDec is the concept of "decoding as steering." By modifying logits at inference time, generalist models can be specialized for safety-critical environments. However, the current implementation relies on human-designed STL specifications and approximate dynamics models.

Future research directions include using Large Language Models (LLMs) to automatically generate STL formulas from natural language and integrating learned world models to handle more complex, non-linear environments. Despite these limitations, SafeDec represents a significant step toward deploying foundation models in real-world robotics with formal safety assurances.

Summary updated

BibTeX
@misc{kapoor2025constrained,
  author = {Parv Kapoor and Akila Ganlath and Michael Clifford and Changliu Liu and Sebastian A. Scherer and Eunsuk Kang},
  title = {{Constrained Decoding for Robotics Foundation Models}},
  year = {2025},
  eprint = {2509.01728},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.01728},
}
Figure