Code-as-Monitor: Constraint-aware Visual Programming for Reactive and Proactive Robotic Failure Detection
Enshen Zhou, Qi Su, Cheng Chi, Zhizheng Zhang, Zhongyuan Wang, Tiejun, Huang, Lu Sheng, He Wang

TL;DR
This paper introduces Code-as-Monitor (CaM), a vision-language model-based framework for real-time, constraint-aware failure detection in robotic systems, capable of both reactive and proactive monitoring in complex environments.
Contribution
It presents a unified approach using VLM-generated code for simultaneous reactive and proactive failure detection, with geometric constraint elements for improved accuracy and efficiency.
Findings
Achieves 28.7% higher success rate in failure detection.
Reduces execution time by 31.8% under severe disturbances.
Enables long-horizon tasks in cluttered, dynamic scenes.
Abstract
Automatic detection and prevention of open-set failures are crucial in closed-loop robotic systems. Recent studies often struggle to simultaneously identify unexpected failures reactively after they occur and prevent foreseeable ones proactively. To this end, we propose Code-as-Monitor (CaM), a novel paradigm leveraging the vision-language model (VLM) for both open-set reactive and proactive failure detection. The core of our method is to formulate both tasks as a unified set of spatio-temporal constraint satisfaction problems and use VLM-generated code to evaluate them for real-time monitoring. To enhance the accuracy and efficiency of monitoring, we further introduce constraint elements that abstract constraint-related entities or their parts into compact geometric elements. This approach offers greater generality, simplifies tracking, and facilitates constraint-aware visual…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsRobot Manipulation and Learning · Software Engineering Research · Manufacturing Process and Optimization
MethodsSparse Evolutionary Training · Class-activation map
