New method enables AI for safety-critical situations
MIT researchers have developed a technique called HardFlow that helps generative AI models find solutions to high-stakes problems where a plausible answer is not enough and the output must also satisfy nonnegotiable safety, physical, or task-specific requirements, known as hard constraints.
The key to the method is giving the model more freedom during the generation process and enforcing hard constraints on the final output rather than at every intermediate step. Existing approaches such as projection-based sampling repeatedly force intermediate samples to satisfy strict requirements, which the researchers say can prevent the model from reaching a better final solution and typically focus only on constraint satisfaction, missing opportunities to improve other qualities like reducing a robot's trajectory length.
HardFlow reformulates hard-constrained sampling as a trajectory-optimization problem using tools from optimal control, steering the model's sampling trajectory toward a goal while making subtle corrections along the way. To handle models with hundreds of interconnected layers, the researchers leveraged the structure of flow-matching models to decompose the problem into smaller, single-step subproblems and applied systematic transformations and approximations to derive an efficient, scalable algorithm.
The technique works at deployment time and can be applied to pretrained generative models without retraining them. In experiments spanning robotic manipulation, maze navigation, control of physical processes, and text-guided image editing, HardFlow achieved constraint satisfaction and consistently outperformed baseline methods on solution quality, the researchers report. For example, it enabled a robotic manipulator to avoid obstacles while finding the quickest path to a target object. Its computation time was comparable to or lower than most competing methods.
The research appears this week in the IEEE Transactions on Pattern Analysis and Machine Intelligence. Navid Azizan, the Alfred H. and Jean M. Hayes Career Development Associate Professor in the Department of Mechanical Engineering and IDSS, a principal investigator of LIDS, is the senior author. Lead author Zeyang Li, a graduate student in mechanical engineering and LIDS, and Kaveh Alim, a graduate student in IDSS and LIDS, joined the paper. The researchers say they could in the future extend the framework to settings where the AI model itself can also be updated.
Based on reporting from the original publisher. Visit the source for full context and later updates.
Publisher excerpt
The “HardFlow” algorithm could help generative AI models produce high-quality outputs that obey strict requirements when “pretty close” doesn’t cut it.