Research
Physics-Informed Large Language Models for HVAC Anomaly Detection with Autonomous Rule Generation
Overview Research area: Applied AI for smart buildings — physics-informed large language models, evolutionary program search, and automated fault detection and diagnostics (AFDD) for heating, ventilat
- arXiv
- 2510.17146
- Published
- 2025-10-20
- Authors
- Subin Lin, Chuanbo Hua
AI summary
Overview
- Research area: Applied AI for smart buildings — physics-informed large language models, evolutionary program search, and automated fault detection and diagnostics (AFDD) for heating, ventilation, and air-conditioning (HVAC) systems.
- Technical level: Intermediate. Readers should know roughly how LLMs are prompted and what precision/recall/F1 mean; the HVAC physics involved is explained in plain terms (temperature dynamics, airflow, occupancy schedules).
- Scope in one sentence: The paper proposes PILLM, an LLM-driven evolutionary loop that generates, evaluates, and refines readable Python rules for HVAC anomaly detection while embedding thermodynamic and control-theoretic constraints.
What This Paper Is About
HVAC systems are a major share of building energy use, but their faults are hard to spot in large streams of sensor data. Classical rule-based detectors are explainable yet static and expert-dependent, while deep learning detectors are accurate but opaque and often physically implausible; recent LLM-based detectors improve interpretability but ignore the physics governing HVAC operation. PILLM addresses this by letting an LLM generate and evolve anomaly-detection rules that are simultaneously adaptive, explainable, and grounded in building physics.
Key Contributions
- PILLM framework: integrates LLMs with evolutionary search to automatically generate anomaly detection rules while explicitly incorporating building physics and operational semantics.
- Physics-informed operators: designs a physics-informed reflection (PIR) mechanism and a physics-informed crossover (PIC) mechanism that steer LLM-generated rules toward physical plausibility and robustness, rather than purely statistical or heuristic hybrids.
- Evaluation on a public benchmark: evaluates the framework on the public LBNL Automated Fault Detection for Buildings dataset, reporting state-of-the-art performance together with interpretable, actionable diagnostic rules.
- Rule output as code: rules are emitted as executable, human-readable Python snippets, each accompanied by a short natural-language rationale and a physical hypothesis.
Main Findings
- Best precision and F1 in the comparison: PILLM reaches precision 0.968, recall 0.859, and F1 0.926 on the public dataset, the highest precision and F1 among all reported methods.
- ARGOS is the closest competitor: ARGOS scores precision 0.921, recall 0.885, and F1 0.902 — the strongest recall of any method, but an F1 slightly below PILLM.
- Removing physics hurts: ablating physics-informed reflection drops performance to precision 0.889, recall 0.851, F1 0.869; ablating physics-informed crossover gives precision 0.945, recall 0.803, F1 0.868. Both ablations degrade F1 clearly.
- Classical and neural baselines trail: LSTMAD reaches precision 0.861, recall 0.781, F1 0.818; AutoRegression 0.731 / 0.699 / 0.668; AnomalyTransformer 0.482 / 0.395 / 0.282.
- LLM-based baselines struggle on precision: LLMAD reports precision 0.045, recall 0.835, F1 0.083; SigLLM reports precision 0.012, recall 0.502, F1 0.021 — high recall traded away for very poor precision.
- Explainability as a design property: evolved rules are transparent Python code that can explicitly relate abnormal thermal gradients to fan speed or weather conditions, giving operators physical reasoning behind each anomaly flag.
- Evaluation protocol: results use the Event-F1 with Point Adjustment (Event-F1 PA) metric, where an anomaly incident counts as detected if at least one point in the ground-truth incident is flagged, while false positives are penalized at the point level.
- Reported experimental setup: experiments ran on an AMD Ryzen 9 7950X 16-Core Processor with a single NVIDIA RTX 5090 GPU, in a Python 3.12 environment, using Google's Gemini 2.5 Flash model.
- Fault types in the dataset: the appendix lists heating coil leaking, stuck dampers, sensor drift/bias (e.g., a sensor consistently reporting 5°F higher than true temperature), and control logic faults such as Simultaneous_Heat_Cool, with a separate fault intensity value indicating severity.
- Motivating statistics: the introduction cites that buildings account for approximately 40% of global energy consumption and a third of greenhouse gas emissions.
- Cited prior result (not a PILLM result): the related work section notes that fine-tuned DistilBERT models for HVAC fault classification have reported F1 scores up to 99%.
- Not reported: the dataset size, the numeric value of the initial population size (given only as N), the number of evolutionary generations, wall-clock runtime or cost, and any statistical significance testing are not reported in the provided content.
Methodology in Plain English
The authors build on a "reflective evolution" paradigm in which an LLM acts as the reasoning engine for the genetic operators — initialization, reflection, crossover, and mutation — rather than as a direct anomaly classifier.
- Seeding. The generator LLM is prompted with a task specification: which inputs it will see (room and floor temperatures, fan status, fan speed, and similar signals), what it must output (an anomaly score), and what it should optimize (e.g., detection accuracy). It is also given a simple baseline heuristic (a peak-over-threshold rule) and asked to produce a diverse population of N candidate rules as executable code, each with a short rationale.
- Physics-informed reflection. Each iteration, the LLM compares better-performing and worse-performing rules and interrogates them against metadata describing what each sensor physically means — for example, that zone temperature reflects indoor thermal conditions and fan speed governs airflow rate and pressure. The output is a structured reflection saying which physical aspects a rule captures and which it misses.
- Physics-informed crossover. Those reflections guide how parent rules are merged. Instead of combining code blindly, the LLM fuses the physical contexts of two parents — say, one focused on indoor/outdoor temperature gradients and another on fan speed and airflow pressure — so the offspring models a causal relationship rather than an arbitrary hybrid.
- Elitist mutation. The best rules receive targeted refinements suggested by accumulated reflections, such as adding occupancy schedules or weather normalization, rather than complete rewrites.
The appendix also describes the intended diagnostic output as a structured, human-readable report that names the fault type, cites the physical evidence from the input data, and assesses severity. Adaptation to a new problem setting is described as requiring only a problem description, a function description, and a function signature.
Why This Matters
Research impact. PILLM sits at the intersection of physics-informed machine learning and LLM-driven automated machine learning. Rather than constraining a neural network's solution space with physics (as in physics-informed neural networks), it injects physical reasoning into the search process that writes the detection rules. This offers a route to models that are accurate, inspectable, and reproducible at once — addressing the persistent tension the paper identifies between heuristic interpretability and learned accuracy.
Real-world applications:
- Building operations and facility management: operators can read, validate, debug, and refine the generated Python rules before deploying them in a building management system.
- Energy efficiency and decarbonization programs: sharper HVAC fault detection reduces wasted energy in a sector tied to roughly 40% of global energy consumption and a third of greenhouse gas emissions.
- Maintenance and diagnostics workflows: rules that flag heating coil leaks, stuck dampers, sensor bias, and control logic faults can translate directly into inspection actions.
- Cyber-physical and infrastructure monitoring: the approach generalizes the agentic rule-generation idea, originally demonstrated on cloud infrastructure by ARGOS, to physical systems where thermodynamic constraints apply.
Industry relevance. The appeal for the buildings industry is that the deliverable is not a black box but portable code plus an explanation. Because rule generation is automated, the expert-labor bottleneck that makes classical rule libraries expensive to build and maintain is reduced, and because the rules are physical rather than purely statistical, the authors argue they should be less prone to false alarms and better aligned with real building dynamics.
Future Directions
- Extending beyond HVAC: applying PILLM to other building subsystems, as stated in the conclusion.
- Scaling to real-time operation: investigating scalability for real-time anomaly detection in large-scale smart infrastructure.
- Zero-shot and compound fault diagnosis: the appendix suggests reasoning from physical features could let the system characterize novel or compound faults not present in training data — an open question the experiments do not measure.
- Lifecycle maintenance of evolved rules: how rules should be refreshed as buildings are retrofitted or their operational conditions drift, which is the adaptability gap the paper attributes to static classical rule sets.
Target Audience
Researchers and practitioners working on HVAC fault detection and diagnostics, smart-building and building-energy analytics, physics-informed machine learning, and LLM-based program generation or agentic anomaly detection. It is also relevant to building operators and facilities engineers who want transparent, deployable detection logic, and to applied AI researchers interested in how evolutionary LLM search can be constrained by domain physics.
Authors’ abstract
Heating, Ventilation, and Air-Conditioning (HVAC) systems account for a substantial share of global building energy use, making reliable anomaly detection essential for improving efficiency and reducing emissions. Classical rule-based approaches offer explainability but lack adaptability, while deep learning methods provide predictive power at the cost of transparency, efficiency, and physical plausibility. Recent attempts to use Large Language Models (LLMs) for anomaly detection improve interpretability but largely ignore the physical principles that govern HVAC operations. We present PILLM, a Physics-Informed LLM framework that operates within an evolutionary loop to automatically generate, evaluate, and refine anomaly detection rules. Our approach introduces physics-informed reflection and crossover operators that embed thermodynamic and control-theoretic constraints, enabling rules that are both adaptive and physically grounded. Experiments on the public Building Fault Detection dataset show that PILLM achieves state-of-the-art performance while producing diagnostic rules that are interpretable and actionable, advancing trustworthy and deployable AI for smart building systems.