LLM-based automatic identification and early warning of construction safety risks
Abstract
Ensuring construction safety requires timely identification of latent risks embedded within unstructured documents such as inspection logs, incident reports, and supervisor notes. Traditional rule-based or statistical methods often struggle to extract such knowledge due to linguistic ambiguity, domain-specific expressions, and lack of contextual understanding. With the advent of large language models (LLMs), prompt engineering and fine-tuning have shown promise for structured information extraction, yet existing methods often treat them in isolation and fall short under low-resource or ambiguous conditions. In this work, we propose a hybrid framework that integrates prompt-guided attention with lightweight supervised fine-tuning to extract structured risk triples—comprising entities, attributes, and contexts—from heterogeneous construction texts. Our model first employs task-specific prompts to guide a pre-trained LLM towards relevant semantic spans, then applies a dual-objective training strategy combining masked language modeling and structured tuple loss for domain adaptation. We conduct extensive experiments on three datasets, including a real-world log corpus (ConRisk-Log), annotated incident reports (BuildSafe-Report), and a synthetically perturbed dataset (SynthRiskSim) designed to stresstest linguistic robustness. Results show that our method outperforms strong baselines such as BERT-NER, GPT-ZeroShot, and T5-FullFinetune by up to 9.7% in F1 score and maintains high extraction coverage and stability across diverse risk expressions. Ablation studies further demonstrate the complementary value of prompt design and fine-tuning. This work provides a scalable, accurate, and interpretable solution for real-time construction risk mining and contributes to safer engineering practices through advanced NLP techniques.