Don't Do That!: Guiding Embodied Systems through Large Language Model-based Constraint Generation

Amin Seffo, Aladin Djuhera, Masataro Asai, Holger Boche

TL;DR

This paper introduces STPR, a novel framework that uses Large Language Models (LLMs) to translate natural language "don't do that" instructions into executable Python functions. These functions then guide traditional pathfinding algorithms to generate safe and compliant robot trajectories, overcoming the limitations of direct LLM-based planning.

What Problem Does This Paper Address?

Robots operating in real-world environments need to navigate not only to a goal but also adhere to a complex set of constraints. These constraints, often provided by humans, can be vague, implicit, or even involve intricate spatial and mathematical reasoning (e.g., "avoid the fireplace's heat dissipation zone"). Traditional pathfinding algorithms struggle with these, as they require formal, structured inputs. While LLMs show promise in understanding natural language, directly using them for path planning can lead to hallucinations, unreliability, and a lack of interpretability. This paper addresses the challenge of reliably incorporating complex, natural language-based constraints into robot navigation, bridging the gap between human intent and formal robotic planning.

Methods

The core of STPR (Safe Trajectory Planning with Restrictions) is a neuro-symbolic approach. Instead of having LLMs directly generate a robot's path, STPR uses LLMs to translate natural language constraints into Python boolean functions. These functions act as "constraint generators."

Here's how it works:

  1. LLM-based Constraint Generation: A carefully crafted prompt template guides the LLM to output a Python function. This template includes system instructions, a description of the environment, the specific constraint (e.g., "avoid the fireplace"), and a fixed Python function signature. This structured approach leverages the LLM's coding capabilities to produce precise, executable, and interpretable code, minimizing hallucinations.
  2. Point Cloud Representation: The generated Python constraint functions are used to create a "forbidden" region in the robot's environment. This is achieved through a rejection sampling method, where points are sampled and then filtered based on the constraint function. These forbidden points are merged with the environment's static point cloud (representing walls, furniture, etc.).
  3. Constrained Path Planning: A traditional pathfinding algorithm (like A* or RRT*) then operates on this augmented point cloud. By treating the forbidden points as obstacles, the algorithm is guaranteed to find a path that respects the natural language constraints.

This separation of concerns – LLMs for constraint translation and classical algorithms for decision-making – ensures reliability and interpretability.

Datasets

The paper does not explicitly mention training datasets. The evaluation is performed in a simulated Gazebo environment, which is a standard robotics simulator. The scenarios are designed to test various types of constraints, including:

  • (S1) Evading a Security Camera's Field of View (FOV)
  • (S2) Avoiding a Hole
  • (S3) Conditional Constraint: "Animal in the Kitchen" (avoid kitchen if animal is present)
  • (S4) Fireplace Heat Avoidance (physics-based constraint)

Key Insights and Ideas

  • LLMs as Code Generators for Constraints: The most significant insight is leveraging LLMs' strong coding abilities not for direct planning, but for generating precise, executable constraint functions. This circumvents the inherent unreliability of LLMs in complex reasoning tasks.
  • Neuro-Symbolic Hybridization: STPR effectively combines the strengths of modern LLMs (natural language understanding, code generation) with the proven guarantees of classical search algorithms (optimality, completeness, soundness).
  • Point Clouds as a Unified Representation: Using point clouds to represent both static obstacles and dynamically generated constraint regions provides a unified framework that can be easily integrated into existing robotics pipelines (e.g., ROS).
  • Smaller LLMs Suffice: The research demonstrates that even smaller, more cost-effective code-focused LLMs can generate reliable constraint functions, making the approach more accessible.
  • Beyond Visual Objects: STPR's ability to handle abstract and implicit constraints (like camera FOV or heat zones) highlights its advantage over methods that rely solely on visual object detection and segmentation.

Key Results

  • Full Compliance: STPR achieved 100% success rate across all four challenging scenarios, ensuring that generated paths either adhered to all constraints or correctly reported that no valid path existed.
  • Robustness: STPR outperformed naive VLM-based planning approaches (like GPT-40), which suffered from hallucinations and partial compliance, achieving success rates as low as 0-10%.
  • Efficiency: While vanilla A*/RRT* were faster, their paths were invalid. STPR maintained reasonable end-to-end latencies (12-18 seconds), with prompting being the most time-consuming step for complex physics-based constraints.
  • Model Scalability: The framework works effectively with various LLMs, including smaller, specialized code models, suggesting broad applicability.
  • Qualitative Success: STPR successfully handled abstract constraints (camera FOV), physics-based constraints (fireplace heat), and conditional constraints (animal in kitchen), demonstrating its versatility.

Limitations and Future Work

  • Point Cloud Density: The paper notes that point cloud density (controlled by the number of sampled points, K) is a hyperparameter. While they show it's predictable and easy to tune, a smaller K can lead to missed collisions, and a larger K increases runtime. Future work could explore more sophisticated sampling methods.
  • Integration with TAMP: The authors suggest that STPR could be integrated as a subroutine within Task and Motion Planning (TAMP) systems for more complex, multi-goal scenarios.
  • Stochastic and Dynamic Environments: While the current model assumes static environments, extensions to dynamic and stochastic settings are mentioned as future directions.
  • Real-World Deployment: While simulated in Gazebo, the paper acknowledges the need for real-world validation and integration with SLAM pipelines.
  • Adaptive Rejection Sampling: The paper mentions adaptive rejection sampling as a potential improvement for point cloud generation efficiency.

Summary updated

BibTeX
@inproceedings{seffo2026don,
  author = {Amin Seffo and Aladin Djuhera and Masataro Asai and Holger Boche},
  title = {{Don't Do That!: Guiding Embodied Systems through Large Language Model-based Constraint Generation}},
  booktitle = {Reliable Autonomy @ ICLR},
  year = {2026},
  url = {https://openreview.net/forum?id=RBoTbEuZwg},
}
Figure