Table of Contents
Fetching ...

A Rule-Aware Prompt Framework for Structured Numeric Reasoning in Cyber-Physical Systems

Yichen Liu, Hongyu Wu, Bo Liu

TL;DR

The paper addresses the challenge of enabling rule-consistent reasoning over high-dimensional CPS telemetry using LLMs by proposing a modular, rule-aware prompt framework that decouples domain context, numeric normalization, and decision rules. It formalizes a five-module prompt architecture (Role, Context, Normalization, Rule Reasoning, Output) with a separate value block, instantiated in an IEEE 118-bus power system case study using a three-sigma rule and z-score normalization. Empirical results show that a z-score-only value block substantially improves zero-shot anomaly detection and, when combined with increasing supervision, yields strong performance; a hybrid LLM-detector further enhances precision and overall F1, while reducing token usage. The work provides a reusable CPS analytics template that can accommodate different rules, sensors, and backbones, demonstrating meaningful improvements in interpretability and efficiency and suggesting broad applicability across CPS domains and rule sets.

Abstract

Many cyber-physical systems (CPS) rely on high-dimensional numeric telemetry and explicit operating rules to maintain safe and efficient operation. Recent large language models (LLMs) are increasingly considered as decision-support components in such systems, yet most deployments focus on textual inputs and do not directly address rule-grounded reasoning over numeric measurements. This paper proposes a rule-aware prompt framework that systematically encodes CPS domain context, numeric normalization, and decision rules into a modular prompt architecture for LLMs. The framework decomposes prompts into five reusable modules, including role specification, CPS domain context, numeric normalization, rule-aware reasoning, and output schema, and exposes an interface for plugging in diverse rule sets. A key design element is separating rule specification from the representation of normalized numeric deviations, which enables concise prompts that remain aligned with domain rules. We analyze how different normalization strategies and prompt configurations influence rule adherence, interpretability, and token efficiency. The framework is model-agnostic and applicable across CPS domains. To illustrate its behavior, we instantiate it on numeric anomaly assessment in an IEEE 118-bus electric power transmission network and evaluate several prompting and adaptation regimes. The results show that rule-aware, z-score-based value blocks and a hybrid LLM-detector architecture can substantially improve consistency with CPS rules and anomaly detection performance while reducing token usage, providing a reusable bridge between numeric telemetry and general-purpose LLMs.

A Rule-Aware Prompt Framework for Structured Numeric Reasoning in Cyber-Physical Systems

TL;DR

The paper addresses the challenge of enabling rule-consistent reasoning over high-dimensional CPS telemetry using LLMs by proposing a modular, rule-aware prompt framework that decouples domain context, numeric normalization, and decision rules. It formalizes a five-module prompt architecture (Role, Context, Normalization, Rule Reasoning, Output) with a separate value block, instantiated in an IEEE 118-bus power system case study using a three-sigma rule and z-score normalization. Empirical results show that a z-score-only value block substantially improves zero-shot anomaly detection and, when combined with increasing supervision, yields strong performance; a hybrid LLM-detector further enhances precision and overall F1, while reducing token usage. The work provides a reusable CPS analytics template that can accommodate different rules, sensors, and backbones, demonstrating meaningful improvements in interpretability and efficiency and suggesting broad applicability across CPS domains and rule sets.

Abstract

Many cyber-physical systems (CPS) rely on high-dimensional numeric telemetry and explicit operating rules to maintain safe and efficient operation. Recent large language models (LLMs) are increasingly considered as decision-support components in such systems, yet most deployments focus on textual inputs and do not directly address rule-grounded reasoning over numeric measurements. This paper proposes a rule-aware prompt framework that systematically encodes CPS domain context, numeric normalization, and decision rules into a modular prompt architecture for LLMs. The framework decomposes prompts into five reusable modules, including role specification, CPS domain context, numeric normalization, rule-aware reasoning, and output schema, and exposes an interface for plugging in diverse rule sets. A key design element is separating rule specification from the representation of normalized numeric deviations, which enables concise prompts that remain aligned with domain rules. We analyze how different normalization strategies and prompt configurations influence rule adherence, interpretability, and token efficiency. The framework is model-agnostic and applicable across CPS domains. To illustrate its behavior, we instantiate it on numeric anomaly assessment in an IEEE 118-bus electric power transmission network and evaluate several prompting and adaptation regimes. The results show that rule-aware, z-score-based value blocks and a hybrid LLM-detector architecture can substantially improve consistency with CPS rules and anomaly detection performance while reducing token usage, providing a reusable bridge between numeric telemetry and general-purpose LLMs.

Paper Structure

This paper contains 22 sections, 4 equations, 1 figure, 3 tables.

Figures (1)

  • Figure 1: Zero-shot anomaly detection performance under different value-block designs. All configurations share the same role, context, and three-sigma decision rule; only the numeric representation in the value block is changed.