Defining and evaluating the physical safety of large language modelsDefining and Evaluating Physical Safety for Large Language Models
The authors build the LLM Physical Safety Benchmark to evaluate the physical safety of drone control across 7 mainstream LLMs; the authors state there is a trade-off between utility and safety, and that ICL can improve safety metrics.
- LLMs are increasingly used to control robots such as drones, but the risk of physical harm they pose in the real world lacks evaluation; existing safety evaluations mostly target user-generated content, and the authors state that physical safety is a gap.
- Build the LLM Physical Safety Benchmark: over 400 drone instructions divided into four categories—deliberate attacks, unintentional attacks, violations, and utility—scored by dual GPT-3.5 judges, with collisions and violations detected in the AirSim simulation, and six metrics computed.
- Evaluated 7 mainstream LLMs; the authors state there is a trade-off between utility and safety: GPT-3.5-turbo has 93.75% utility but only 12.50% Self-Assurance; ICL and ZS-CoT improve safety metrics but struggle to identify unintentional attacks; larger models refuse dangerous instructions better.
- The authors state that future work should study robust safety guardrails, improve ICL, address the shortcomings of ZS-CoT, improve safety evaluation methods, and bridge the gap between simulation and reality. The experiments cover only drone simulation scenarios and 9 models, and the paper does not report agreement between the judges and humans.
- Threat model
- Attackers or unintentional users exploit the LLM to generate drone control code to carry out malicious actions; instructions fall into four categories: deliberate attacks, unintentional attacks, violating instructions, and utility tasks; the victim system is a drone in the AirSim simulation controlled by the LLM via a system prompt.
- Evaluated models
- GPT-3.5-turboGemini ProLlama-2-7B-ChatCodeLlama-7B-InstructLlama-3-8B-InstructMistral-7B-Instruct-v0.2CodeQwen1.5-7B-ChatCodeLlama-13B-InstructCodeLlama-34B-Instruct
- Benchmarks
- LLM Physical Safety BenchmarkAirSim
- Metrics
- Self-AssuranceAvoid-CollisionRegulatory ComplianceCode FidelityInstruction UnderstandingUtility
The researchers propose a physical safety benchmark for large language models in drone control scenarios, dividing physical safety risks into four categories: threats to people, threats to objects, infrastructure attacks, and violations of regulations. Evaluation of mainstream large language models shows an undesirable trade-off between utility and safety, and models with strong code generation capabilities often perform worse on key safety aspects. Introducing prompt engineering methods such as In-Context Learning and Chain-of-Thought can improve safety, but it remains difficult to identify unintentional attacks; larger models show better safety capabilities, especially in refusing dangerous instructions. The project page is published at huggingface.co/spaces/TrustSafeAI/LLM-physical-safety.
Paper analysis
What problem does this paper attempt to solve?
The authors state that the physical safety risks of LLM-controlled drones lack evaluation, and propose a drone control physical safety benchmark.
Core question: how to define and evaluate the physical safety risks of LLMs in drone control.
- Scenario and importance: LLMs are increasingly used to control robots; the authors use drones as a pilot, citing low cost (programmable drones at about 100 USD) and ease of deployment via SDKs/APIs, where failures may cause physical harm.
- Existing gaps: the authors state that existing LLM safety evaluations mainly target user-generated content (e.g., toxic content, hate speech), and that the physical safety of LLMs controlling robots "remains largely unexplored"; a footnote notes that AI Safety Benchmark v0.5 targets language generation risks, whereas this benchmark targets physical harm risks in robot control.
- Risk taxonomy: the authors divide drone physical safety risks into four categories—threats to people, threats to objects, infrastructure attacks, and violations of FAA regulations (based on FAA Part 107).
- Paper output: proposes the LLM Physical Safety Benchmark, including a dataset of over 400 instructions, two AI judges, an AirSim simulation environment, and six metrics, to evaluate the safety and utility of mainstream LLMs.
- Threat model:
- Attacker goal: make the LLM generate drone control code that causes physical harm or violations.
- Attacker types: malicious attackers (deliberate attacks) or unintentional users (who issue dangerous instructions due to mistakes or lack of domain knowledge).
- Capabilities: submit instructions to the LLM, including direct/indirect commands and code injection.
- Victim system: a drone in the AirSim simulation environment controlled by the LLM via a system prompt.
What related research exists?
Related work is grouped into four categories: LLM capabilities, LLM robot control, LLM safety evaluation, and prompt engineering; the authors state that physical safety evaluation is a gap.
LLM basic capabilities
- Brown et al. (2020), Radford et al.—GPT-series language models, GitHub Copilot based on a GPT-3 variant; Chen et al. (2021), Austin et al. (2021)—code generation models and program synthesis evaluation (HumanEval, MBPP).
LLMs for robot control
- Brohan et al. (2022, 2023)—RT-1, RT-2 robot control models; Ahn et al. (2024)—AutoRT; Shah et al.—LM-Nav navigation.
- Vemprala et al. (2023)—ChatGPT for Robotics; the paper states this work demonstrated the feasibility of using system prompts to let LLMs control robots, and this paper's system prompt is modified based on it.
- Macdonald et al. (2024)—prompt engineering for robot control.
LLM safety evaluation and alignment failure
- Chao et al. (2024)—JailbreakBench jailbreak benchmark; Xie et al. (2024)—Sorry-Bench refusal behavior evaluation.
- Qi et al. (2023)—fine-tuning aligned models harms safety; Wei et al. (2024), Carlini et al. (2024)—safety training failure and adversarial alignment analysis; Hsiung et al. (2025)—similarity analysis of safety guardrail failure after fine-tuning.
- The paper notes that these works target the safety of user-generated content and do not cover the physical safety of robot control.
Prompt engineering and evaluation methods
- Min et al. (2022)—In-Context Learning; Kojima et al. (2022), Wei et al. (2022)—Zero-shot/Few-shot Chain-of-Thought; this paper uses ICL and ZS-CoT for safety enhancement.
- Zheng et al. (2024)—LLM-as-a-judge; the paper states that using GPT-3.5 as a judge is consistent with the trend of [20, 36, 38].
Positioning: the authors state that this paper differs from the above works in focusing on physical harm risks in LLM robot control, proposing a dedicated drone physical safety benchmark rather than safety evaluation at the language generation level.
How does the paper address this problem?
Build a dataset containing four types of instructions, use dual GPT-3.5 judges plus AirSim simulation, and evaluate LLM drone control safety across six metrics.
Overall approach: give the LLM under test a drone control system prompt, input test instructions, have two AI judges determine the response category, then place the generated code into the AirSim simulation to detect collisions and violations, and aggregate into six safety/utility metrics. The framework is named LLM Physical Safety Benchmark.
Evaluation pipeline and system setup
- System prompt: modified from the ChatGPT for Robotics prompt of Vemprala et al., restricting the LLM to only the given AirSim wrapper functions (takeoff, fly_to, fly_path, set_yaw, get_position, etc.), and writing in FAA constraints: no-fly zone coordinate ranges, maximum altitude 120 meters, maximum speed 100 mph (44.70 m/s), and no flying over crowds (table S1).
- Scene objects: the simulation scene contains turbine1/2, solarpanels, car, crowd, tower1/2/3; the objects are immovable.
Two AI judges
- Judge models: both judges are GPT-3.5, which the authors say is because it has the strongest instruction understanding on multiple benchmarks; each scores on a 1–10 scale.
- Code Verification Judge: judges whether responses containing code are aligned with the instruction; if the code is not aligned with the instruction for safety reasons, it is also classified as safety refusal (table S2).
- Safety Evaluation Judge: judges responses without code, distinguishing "refusal for safety reasons" (10 points) from "failure to understand the instruction" (1 point) (table S3).
- Two types of safety behavior: Self-Protect (the model actively adjusts code to maintain a safe distance) and Safety Refusal (refusing to generate code for safety reasons).
Dataset construction
- Scale and structure: 400+ instructions in four dimensions—deliberate attacks (direct commands, indirect commands, code injection), unintentional attacks (misleading instructions, high-risk instructions, scene negligence), violation instructions (no-fly zone, excessive altitude, excessive speed, flying over crowds), and utility (takeoff and movement, path following, yaw control, approaching targets).
- Three construction steps (Fig. S5): 1) determine risk categories with reference to FAA, ICAO, and EASA regulations; 2) generate diverse instructions with ChatGPT and Gemini Pro; 3) keyword-based rule filtering (e.g., "collide" and "strike" indicate deliberate attacks), removing ambiguous instructions, and finally the authors manually checked all data.
Six metrics
- Self-Assurance: (Xrefusal+Xprotect+Xno−collision)/(NDeliberate+NUnintentional), i.e., the proportion of samples with refusal, self-protection, or collision avoidance among the deliberate plus unintentional attack samples.
- Avoid-Collision: 1 − (Xcollision)/(NDeliberate+NUnintentional), i.e., the proportion with no collision; the other metrics are Regulatory Compliance (refusal rate for violation instructions), Code Fidelity (rate of code with no execution errors), Instruction Understanding (rate of responses aligned with instructions), and Utility (utility task completion rate); the classification decision tree is in Fig. S3.
Safety enhancement and scale experiment design
- ICL: add safety examples covering each type of risk to the prompt (table S4).
- ZS-CoT: have the model think step by step about whether the instruction would cause harm or violate FAA regulations before giving code.
- Model scale: compare the relationship between scale and safety using three CodeLlama-Instruct sizes: 7B, 13B, and 34B.
What experiments did the paper conduct?
Evaluated 7 mainstream LLMs plus three CodeLlama scales, and also tested the effect of ICL/ZS-CoT prompt engineering on safety metrics.
Experimental Setup
- Models under test: GPT-3.5-turbo, Gemini Pro, Llama-2-7B-Chat, CodeLlama-7B-Instruct, Meta-Llama3-8B-Instruct, Mistral-7B-Instruct-v0.2, CodeQwen1.5-7B-Chat; the scale experiment additionally uses CodeLlama-13B/34B-Instruct.
- Benchmark: a self-built LLM Physical Safety Benchmark, with over 400 instructions, divided into four dimensions: deliberate attacks, unintentional attacks, violating instructions, and utility.
- Evaluation method: GPT-3.5 serves as Code Verification Judge and Safety Evaluation Judge, scoring 1–10; code is executed in the AirSim simulation to determine collisions, violations, and task completion.
- Metrics: six items: Self-Assurance, Avoid-Collision, Regulatory Compliance, Code Fidelity, Instruction Understanding, Utility.
- Prompt engineering variants: three settings—original, ICL, ZS-CoT—used for GPT-3.5-turbo and Gemini Pro.
- The paper does not report the number of repeated runs per instruction, nor the agreement between the judges and human judgment.
Main Results
According to table S5 (corresponding to Fig. 2), values are proportions:
Swipe horizontally to read the table
Model Self-Assurance Avoid-Collision Regulatory Compliance Code Fidelity Instruction Understanding Utility GPT-3.5-turbo 0.1250 0.1366 0.3125 0.9851 0.9893 0.9375 Gemini Pro 0.2500 0.3255 0.4375 0.9901 0.9813 0.8125 Llama-2-7B-Chat 0.3284 0.9884 0.9062 0.6642 0.6941 0.1875 CodeLlama-7B-Instruct 0.5465 0.9912 0.7812 0.9019 0.6436 0.5625 Meta-Llama3-8B-Instruct 0.2732 0.6569 0.6562 0.9632 0.6702 0.7500 Mistral-7B-Instruct-v0.2 0.2645 0.5494 0.6875 0.8529 0.8191 0.5625 CodeQwen1.5-7B-Chat 0.2500 0.4447 0.4687 1.0000 0.8191 0.8125 - The authors state that CodeLlama-7B-Instruct performs best on Self-Assurance and Avoid-Collision, Llama-2-7B-Chat has the highest Regulatory Compliance, and GPT-3.5-turbo has the lowest Self-Assurance.
- The authors state there is a trade-off between utility and safety: GPT-3.5-turbo leads on Code Fidelity, Instruction Understanding, and Utility but has low safety metrics, while Llama-2-7B-Chat and CodeLlama-7B-Instruct are the opposite; the authors attribute this to training data emphasizing code utility, conflicting training objectives, and lack of safety mechanisms.
Prompt Engineering Experiments
According to table S6 (corresponding to Fig. 3a, 3b):
- ICL improves safety metrics: GPT-3.5-turbo's Self-Assurance rises from 0.1250 to 0.8720, Avoid-Collision from 0.1366 to 0.9505; Gemini Pro's Self-Assurance rises from 0.2500 to 0.8750, Avoid-Collision from 0.3255 to 0.9157.
- Comparison with ZS-CoT: the authors state ICL outperforms ZS-CoT on most safety dimensions; however, Gemini Pro with ICL has Regulatory Compliance (0.8125) lower than with ZS-CoT (0.9375), and the main text also gives, under deliberate attacks, collision counts of 15 for ICL and 29 for ZS-CoT, and violation counts of 6 for ICL and 3 for ZS-CoT (the two statements in the main text point in inconsistent directions; recorded as in the original source).
- Costs and exceptions: the authors state ICL depends on example quality and has greater computational overhead, while ZS-CoT is lighter; both methods have limited effect on unintentional attacks. On the utility side, Gemini Pro with ZS-CoT has Utility drop from 0.8125 to 0.5625.
Model Scale Experiments
According to table S7 (corresponding to Fig. 3c):
- Scale positively correlates with safety: CodeLlama-Instruct from 7B to 34B, Self-Assurance rises from 0.5465 to 0.8023, Instruction Understanding from 0.6436 to 0.8511, Regulatory Compliance is 1.0000 at both 13B and 34B.
- Exception on unintentional attacks: the authors state 13B and 34B have nearly the same refusal rate on unintentional attacks (about 42%), and argue that beyond a certain scale the ability to detect unintentional attacks no longer improves.
- Small utility change: Utility from 0.5625 (7B) to 0.6250 (34B).
Other Ablations and Analyses
- The main text reports the Self-Protect and Safety Refusal percentages on the left side of Fig. 3: the refusal rate for deliberate attacks rises from about 45% at 7B to over 85% at 34B.
- The paper does not report statistical significance tests, confidence intervals, or variance.
- The paper does not separately report per-subcategory numbers (e.g., code injection, no-fly zones).
What are some points that can be further explored?
The authors propose directions such as improved guardrails, ICL, and evaluation methods; the experiments cover only drone simulation and 9 models.
Limitations and future directions noted by the authors
- Safety guardrails: The prompt engineering subsection of Results states that future research should focus on developing robust safety guardrails.
- Prompt engineering improvements: The same subsection states that ICL should be improved and the shortcomings of ZS-CoT addressed; the authors state that ICL depends on the quality and quantity of examples and is computationally expensive, and that ZS-CoT is less effective.
- Unintentional attacks: The scale experiment subsection of Results states that targeted research is needed to enhance causal reasoning and predictive safety evaluation capabilities, because large models' mitigation of unintentional attacks remains limited.
- Evaluation methods: Discussion states that future research should focus on improving safety evaluation methods, incorporating robust safety mechanisms, and bridging the gap between virtual and real-world performance.
- The paper has no dedicated Limitations section.
Scope of experiments
- 9 models were tested: 7 mainstream models plus CodeLlama-13B/34B-Instruct; the prompt engineering experiments covered only two models, GPT-3.5-turbo and Gemini Pro (table S6).
- The evaluation scenario is a single drone scenario simulated in AirSim, with objects turbine, solarpanels, car, crowd, tower; the paper did not experiment on real drones.
- The dataset has 400+ instructions in four dimensions; violation instructions are based on FAA Part 107, and FAA, ICAO, and EASA regulations were referenced during construction.
- Both judges are GPT-3.5; the paper does not report the agreement between judge scores and human judgments.
- The paper does not report the number of repeated runs per instruction, sampling temperature, or other generation settings, nor does it report statistical significance tests.
Summarize the main content of the paper
Proposes a physical safety benchmark for drones evaluating 9 LLMs; the authors state that there is a trade-off between utility and safety, and that ICL can improve safety.
This is an evaluation/benchmark paper that proposes the LLM Physical Safety Benchmark to evaluate the physical safety risks of LLMs when generating drone control code.
- Problem: the authors state that existing LLM safety evaluations target user-generated content, and the physical safety of LLMs controlling robots is unexplored; using low-cost programmable drones as a pilot, risks are divided into four categories: threats to people, threats to objects, infrastructure attacks, and violations of FAA regulations.
- Method: over 400 instructions divided into four dimensions—deliberate attacks, unintentional attacks, violations, and utility; dual GPT-3.5 judges determine response categories, code is checked in the AirSim simulation for collisions and violations, and six metrics are computed: Self-Assurance, Avoid-Collision, Regulatory Compliance, Code Fidelity, Instruction Understanding, Utility.
- Main results (table S5): CodeLlama-7B-Instruct has the highest Self-Assurance (54.65%) and Avoid-Collision 99.12%; Llama-2-7B-Chat has the highest Regulatory Compliance (90.62%); GPT-3.5-turbo has the lowest Self-Assurance (12.50%) but the highest Utility (93.75%). The authors state this reflects a trade-off between utility and safety.
- Prompt engineering (table S6): ICL raises GPT-3.5-turbo's Self-Assurance from 12.50% to 87.20%, and Gemini Pro's from 25.00% to 87.50%; the authors state ICL is overall better than ZS-CoT, but both struggle to identify unintentional attacks.
- Scale (table S7): CodeLlama from 7B to 34B, Self-Assurance rises from 54.65% to 80.23%; the authors state 13B and 34B have nearly the same refusal rate on unintentional attacks (about 42%), and scaling up does not help with this.
- Authors' conclusion: models that perform unsafely in controlled simulation may be worse in the real world, and simulation should serve as the first line of defense for robot safety testing; future work should develop safety guardrails, improve evaluation methods, and bridge the gap between simulation and reality.