Semantic Anomaly Detection with Large Language Models

Abstract: 

As robots acquire increasingly sophisticated skills and see increasingly complex and varied environments, the threat of an edge case or anomalous failure is ever present. For example, Tesla cars have seen interesting failure modes ranging from autopilot disengagements due to inactive traffic lights carried by trucks to phantom braking caused by images of stop signs on roadside billboards. These system-level failures are not due to failures of any individual component of the autonomy stack but rather system-level deficiencies in semantic reasoning. Such edge cases, which we call semantic anomalies, are simple for a human to disentangle yet require insightful reasoning. To this end, we study the application of large language models (LLMs), endowed with broad contextual understanding and reasoning capabilities, to recognize such edge cases and introduce a monitoring framework for semantic anomaly detection in vision-based policies. Our experiments apply this framework to a finite state machine policy for autonomous driving and a learned policy for object manipulation. These experiments demonstrate that the LLM-based monitor can effectively identify semantic anomalies in a manner that shows agreement with human reasoning. Finally, we provide an extended discussion on the strengths and weaknesses of this approach and motivate a research outlook on how we can further use foundation models for semantic anomaly detection.

Semantic Anomaly: An AV is confused by a set traffic lights being transported by a truck.


Q: How can we detect Semantic Anomalies: system-level reasoning failures caused by unusual combinations of in-distribution elements?


Semantic Anomaly: An AV abruptly brakes on a highway after passing a billboard with an image of a stop sign.

A: Use a large language model (LLM) as a “semantic reasoning” module to monitor observations and identify potential problematic elements in  a scene 


Pipeline: 1) Generate a scene description using open-vocabulary object detector, 2) Parse description into prompt template, 

3) Query LLM to analyze the scene!  

Experimental Evaluation: We recreated similar semantic anomalies in the CARLA simulator:


Quantitative Evaluation: LLM-based runtime monitor correctly warns of most failure modes! 

@article{ElhafsiSinhaEtAl2023,

  author = {Elhafsi, A. and Sinha, R. and Agia, C. and Schmerling, E. and Nesnas, I. A. D and Pavone, M.},

  title = {Semantic Anomaly Detection with Large Language Models},

  journal = {{Autonomous Robots}},

  year = {2023},

  url = {https://arxiv.org/abs/2305.11307},

}