CPS-LLM: Large Language Model based Safe Usage Plan Generator for Human-in-the-Loop Human-in-the-Plant Cyber-Physical System
Ayan Banerjee, Aranyak Maity, Payal Kamboj, Sandeep K. S. Gupta
TL;DR
This work tackles the challenge of generating safe, personalized usage plans for safety-critical CPS with human-in-the-loop and human-in-the-plant components, using LLMs. The authors propose CPS-LLM, a two-phase framework that combines a LTC NN-based dynamics coefficient extractor with an embodied, instruction-tuned LLM (fine-tuned LLAMA-2 via ALPACA-style prompts and BARD contextualization) to translate a memory trace of system dynamics into a plan that a real CPS controller can execute safely, verified by forward simulation against a signal-temporal-logic safety criterion. The key contributions are (i) a LTC NN-based method to recover unmeasured dynamical coefficients $\omega$, (ii) an embodied prompting and contextualized RL pipeline to tailor LLM responses to CPS dynamics, and (iii) a rigorous safety evaluation using automated insulin delivery as a proof-of-concept, showing CPS-LLM can generate feasible and safer plans than untuned or manual approaches. The results demonstrate that with careful embedding of physical traces and domain-specific tuning, LLMs can meaningfully assist in safety-critical CPS planning, with potential applicability to autonomous medical devices and other HIP/HIL domains.
Abstract
We explore the usage of large language models (LLM) in human-in-the-loop human-in-the-plant cyber-physical systems (CPS) to translate a high-level prompt into a personalized plan of actions, and subsequently convert that plan into a grounded inference of sequential decision-making automated by a real-world CPS controller to achieve a control goal. We show that it is relatively straightforward to contextualize an LLM so it can generate domain-specific plans. However, these plans may be infeasible for the physical system to execute or the plan may be unsafe for human users. To address this, we propose CPS-LLM, an LLM retrained using an instruction tuning framework, which ensures that generated plans not only align with the physical system dynamics of the CPS but are also safe for human users. The CPS-LLM consists of two innovative components: a) a liquid time constant neural network-based physical dynamics coefficient estimator that can derive coefficients of dynamical models with some unmeasured state variables; b) the model coefficients are then used to train an LLM with prompts embodied with traces from the dynamical system and the corresponding model coefficients. We show that when the CPS-LLM is integrated with a contextualized chatbot such as BARD it can generate feasible and safe plans to manage external events such as meals for automated insulin delivery systems used by Type 1 Diabetes subjects.
