Source-linked AI summary
ElecSafety: Diagnosing Large Language Model Safety Judgments for Microcontroller Boards
Linjian Yang, Xinyan Wang, Kunpeng Liu
TL;DR
Board-specific electrical safety judgments matter because the same operation can be safe for one microcontroller board and hazardous for another, while existing benchmarks do not directly test this judgment. ElecSafety builds manufacturer-grounded scenarios and evaluates six open-weight models under differing rule access and token budgets. Board rules improve accuracy, but models remain unreliable in important cases and can justify correct labels with inaccurate constraints.
Problem
Existing embedded-development benchmarks do not directly test whether LLMs judge proposed operations against a specific board’s manufacturer limits, despite board-dependent electrical safety.
Source: §I · p. 1Method
ElecSafety derives decisive conditions and gold labels from manufacturer documentation, constructs five scenario types, and evaluates six open-weight models with varied rule access and token limits.
Source: §I · pp. 1–2Results
Providing board rules raises mean accuracy by 10.7 percentage points under Free and 10.4 points under Limited, but correct labels often rest on inaccurate constraints.
Source: §II · p. 2, §III · p. 2Takeaways & Limitations
Evaluations should assess constraint grounding, label sensitivity, and abstention alongside accuracy.
Source: §III · p. 2Board rules improve accuracy but remain insufficient; aggregate accuracy conceals near-boundary and missing-information errors.
Source: §III · p. 2, §II · p. 2
Abstract
from arXiv · showhide
Large language models (LLMs) progressively support embedded hardware development, but a plausible recommendation may pose safety risks when acting on the physical hardware. Because electrical safety can be different between every microcontroller board, a practical question is raised: can LLMs have the capability to make the right decision on whether a proposed user operation is safe for the board? Although benchmarks for embedded development exist, they primarily target code generation and hardware design tasks. This highlights the lack of tested board-specific judgment regarding electrical safety. To address this gap, we introduce the ElecSafety benchmark to evaluate whether an LLM can respond with the correct label and derive that label from the proper manufacturer constraints and rules. We extract these constraints from vendor datasheets and hardware manuals. Each scenario is defined by a decisive condition and a gold label (safe, hazardous, or cannot determine) before translating the scenario into natural language. We categorize the scenarios into violation and compliant cases, board-swap, near-boundary, and missing-information. We then evaluated the scenario on six open-weight LLMs under various conditions of rule access and token limitations. The finding shows board rules can improve accuracy, whereas limiting the token has a smaller impact. Even the best configuration remains unreliable on near-boundary and missing-information scenarios, and a correct label often rests on the inaccurate constraints.
I. INTRODUCTION
Electrical safety judgments for microcontroller operations must account for the specific board’s manufacturer constraints and operating context. ElecSafety tests whether models make those judgments using the decisive constraint, including when a condition is missing.
I. INTRODUCTION
- The same operation can be safe on one board and hazardous on another, so judgments must apply board- and context-specific user-operable constraints.A judgment is safe when all relevant constraints are satisfied, hazardous when any is violated, and cannot determine when a decisive condition is missing.Source: §I · p. 1
- Existing embedded-development benchmarks focus on programming, circuit design, and PCB reasoning rather than judging operations against a specific board’s manufacturer limits.Overall accuracy alone also cannot show whether a model grounds its answer in the decisive condition, responds to board or boundary changes, or abstains when information is insufficient.Source: §I · p. 1
- ElecSafety defines each scenario with a board, proposed operation, decisive constraint and condition, and gold label established from manufacturer documentation.Its five scenario types cover violating and compliant operations, board swaps, near-boundary values, and missing decisive information; scenarios are rendered in natural language and checked for other rule violations and consistency.Source: §I · pp. 1–2
- The evaluation tests six open-weight instruction-tuned models in a 2×2 design crossing access to normalized board rules with a 100-token cap.Prompts request one of three labels; rationale consistency is separately sampled and is not included in accuracy.Source: §I · p. 2
II. RESULTS
Board rules produce the more consistent improvement in final labels, but aggregate accuracy conceals important judgment and explanation failures.
II. RESULTS
- 10.7 percentage points under Free and 10.4 points under Limited: providing board rules raises mean accuracy, while the highest accuracy is 69.5%.The highest accuracy exceeds the 48% always-hazardous baseline, but only 29 of 216 responses satisfy all constraint-application criteria, with incorrect constraint selection the most common failure.Source: §II · p. 2
- The limited token cap raises mean accuracy by 4.6 points without rules and 4.3 points with rules, but its effect varies across models.Qwen3-4B loses 2.4 points without rules yet gains 13.1 points with them.Source: §II · p. 2
- Aggregate accuracy conceals errors in near-boundary and missing-information cases and does not measure whether explanations apply the correct constraint.The explanation audit finds incorrect constraint selection to be the most common failure.Source: §II · p. 2
III. CONCLUSION
ElecSafety diagnoses LLM safety judgments against documented manufacturer constraints. Board rules improve accuracy but do not ensure reliable judgments or correct constraint grounding.
III. CONCLUSION
- Board rules enhance accuracy but remain insufficient, and restricting the reasoning token budget has an inconsistent impact.Correct labels often rest on inaccurate constraints, while overall accuracy exaggerates how reliably models judge operation safety.Source: §III · p. 2
- Future evaluations should measure constraint grounding, label sensitivity, and abstention alongside accuracy to reveal persistent failure.Source: §III · p. 2