MIT Introduces HardFlow for Safe AI
- •MIT researchers developed HardFlow for generative AI in safety-critical tasks with hard constraints
- •HardFlow works at deployment time on pretrained models without requiring retraining
- •Experiments showed perfect constraint satisfaction across robotics, maze navigation, and text-guided image editing
MIT researchers reported on September 14, 2026, a technique called HardFlow that helps generative AI models produce outputs for safety-critical situations where “pretty close” answers can still be unacceptable. The method targets hard constraints, meaning nonnegotiable safety, physical, or task-specific requirements, in applications spanning robotics, control of physical systems, and computer vision. HardFlow works at deployment time with pretrained generative models, so users can apply it without retraining the model.
The research team said HardFlow improves final outputs by giving a generative model more freedom during generation and enforcing hard constraints only on the final answer, rather than forcing every intermediate sample to obey the rules. Existing projection-based sampling methods repeatedly push partial solutions to meet constraints during generation, but the MIT team said that approach can block better final solutions and often ignores quality goals such as shortening a robot’s trajectory.
Navid Azizan, an MIT associate professor in mechanical engineering and the Institute for Data, Systems, and Society, said the approach preserves generative AI’s ability to search a rich space of possibilities while enforcing strict requirements in high-stakes applications. Zeyang Li, a graduate student in mechanical engineering and the Laboratory for Information and Decision Systems, led the paper with Kaveh Alim, a graduate student in IDSS and LIDS. The research appears this week in IEEE Transactions on Pattern Analysis and Machine Intelligence.
HardFlow reformulates hard-constrained sampling as a trajectory-optimization problem (finding the best path through choices) using tools from optimal control. The researchers said this lets the framework make subtle corrections as a model samples an answer, while saving the strict constraint check for the final output. Because large neural networks may contain hundreds of interconnected layers, the team used the structure of flow-matching models (models that transform noise into data) to break the optimization problem into smaller, single-step subproblems.
The team tested HardFlow in robotic manipulation, maze navigation, and text-guided image editing. Across those experiments, HardFlow achieved perfect constraint satisfaction and consistently outperformed baseline methods on solution quality. In one example, it helped a robotic manipulator avoid obstacles while finding the quickest path to a target object; most other methods either caused collisions or produced paths that took significantly more time. HardFlow’s computation time was comparable to or lower than that of most competing methods.
The researchers said HardFlow can jointly handle strict feasibility and added quality goals, such as finding a collision-free robot path that is also the shortest route to a goal. In future work, they may extend the framework to settings where the AI model itself can also be updated, allowing constraint satisfaction and sample quality to improve in a more adaptive manner.