Industrial Control Systems (ICS) are the backbone of modern critical infrastructures, increasingly becoming the target of complex cyber-attacks that manipulate physical processes while hiding within normal operational noise. Traditional deep learning-based anomaly detection systems treat ICS telemetry as a numerical time series, relying on reconstruction metrics such as mean squared error (MSE). In this thesis, we explore the feasibility of a paradigm shift, reframing anomaly detection as a language modeling task. This approach is motivated by a core operational insight: industrial plants are governed by deterministic cause-and-effect relationships. By casting telemetry as a stream of tokens, we can leverage a Large Language Model's ability to learn syntax and patterns, treating cyber-attacks as unexpected token sequences. Drawing conceptual inspiration from Perplexity, a standard Natural Language Processing metric, we base our detection logic on measuring next-token prediction uncertainty. For computational convenience and numerical stability, the detection engine directly evaluates the Cross-Entropy loss, which is mathematically equivalent to the natural logarithm of Perplexity. To bridge the gap between continuous physics and a discrete language, we introduce a discretization strategy that maps ICS telemetry into domain-specific tokens added to the pre-trained vocabulary. During training, the model learns the nominal token distribution of the plant through efficient Low-Rank Adaptation (LoRA). During inference, we monitor the incoming token stream, triggering alarms whenever unexpected sequences manifest as spikes in the loss. We evaluated our approach against state-of-the-art baselines across three real-world benchmarks (SWaT, WADI, and HAI). Our model achieves competitive anomaly detection results (yielding an F1-Score of 0.833 on SWaT, 0.510 on WADI, and 0.566 on HAI), showing a robust trade-off between detected attacks, precision, and detection delay. Finally, this work demonstrates that modeling ICS telemetry as a structured language sequence offers an effective alternative for modern industrial intrusion detection.

I Sistemi di Controllo Industriale (ICS) formano il pilastro delle moderne infrastrutture critiche, divenendo sempre più spesso bersaglio di cyber attacchi che manipolano i processi fisici nascondendosi all'interno del normale rumore operativo. I tradizionali sistemi deep learning rilevano le anomalie trattando la telemetria come serie temporali numeriche tramite errori di ricostruzione (MSE). In questa tesi valutiamo la fattibilità di un nuovo paradigma basato sulla riformulazione del rilevamento di anomalie della telemetria ICS come un compito di modellazione di linguaggio. L'approccio è guidato da un'intuizione operativa: gli impianti industriali sono governati da relazioni deterministiche di causa-effetto. Rappresentando la telemetria ICS come un flusso di token, sfruttiamo la capacità di un Large Language Model (LLM) di apprendere la sintassi e i pattern del sistema, trattando gli attacchi come sequenze di token inattese. Traendo ispirazione concettuale da una metrica tipica degli LLM, la Perplexity, impostiamo il rilevamento sulla misurazione dell'incertezza nella previsione del token successivo. Per convenienza computazionale e stabilità numerica, calcoliamo direttamente la Cross-Entropy loss, matematicamente equivalente al logaritmo naturale della Perplexity. Per colmare il divario tra fisica continua e linguaggio discreto, introduciamo una strategia di discretizzazione che mappa la telemetria in token specifici aggiunti al vocabolario pre-addestrato. Durante l'addestramento, il modello apprende la distribuzione del comportamento nominale tramite Low-Rank Adaptation (LoRA), mentre in inferenza monitoriamo il flusso di token in arrivo, generando allarmi quando sequenze impreviste causano picchi della loss. Abbiamo valutato l'approccio su tre benchmark reali (SWaT, WADI, HAI). Il modello ottiene risultati competitivi, registrando un F1-Score di 0.833 su SWaT, 0.510 su WADI e 0.566 su HAI, e garantendo un solido compromesso tra attacchi rilevati, precisione e ritardo di rilevamento. Infine, questo lavoro dimostra che modellare la telemetria ICS come un linguaggio strutturato offre un'alternativa efficace per il moderno rilevamento delle intrusioni industriali.

Assessing the feasibility of Large Language Models for anomaly detection in Industrial Control Systems

Nuzzo, Lorenzo
2025/2026

Abstract

Industrial Control Systems (ICS) are the backbone of modern critical infrastructures, increasingly becoming the target of complex cyber-attacks that manipulate physical processes while hiding within normal operational noise. Traditional deep learning-based anomaly detection systems treat ICS telemetry as a numerical time series, relying on reconstruction metrics such as mean squared error (MSE). In this thesis, we explore the feasibility of a paradigm shift, reframing anomaly detection as a language modeling task. This approach is motivated by a core operational insight: industrial plants are governed by deterministic cause-and-effect relationships. By casting telemetry as a stream of tokens, we can leverage a Large Language Model's ability to learn syntax and patterns, treating cyber-attacks as unexpected token sequences. Drawing conceptual inspiration from Perplexity, a standard Natural Language Processing metric, we base our detection logic on measuring next-token prediction uncertainty. For computational convenience and numerical stability, the detection engine directly evaluates the Cross-Entropy loss, which is mathematically equivalent to the natural logarithm of Perplexity. To bridge the gap between continuous physics and a discrete language, we introduce a discretization strategy that maps ICS telemetry into domain-specific tokens added to the pre-trained vocabulary. During training, the model learns the nominal token distribution of the plant through efficient Low-Rank Adaptation (LoRA). During inference, we monitor the incoming token stream, triggering alarms whenever unexpected sequences manifest as spikes in the loss. We evaluated our approach against state-of-the-art baselines across three real-world benchmarks (SWaT, WADI, and HAI). Our model achieves competitive anomaly detection results (yielding an F1-Score of 0.833 on SWaT, 0.510 on WADI, and 0.566 on HAI), showing a robust trade-off between detected attacks, precision, and detection delay. Finally, this work demonstrates that modeling ICS telemetry as a structured language sequence offers an effective alternative for modern industrial intrusion detection.
ING - Scuola di Ingegneria Industriale e dell'Informazione
22-lug-2026
2025/2026
I Sistemi di Controllo Industriale (ICS) formano il pilastro delle moderne infrastrutture critiche, divenendo sempre più spesso bersaglio di cyber attacchi che manipolano i processi fisici nascondendosi all'interno del normale rumore operativo. I tradizionali sistemi deep learning rilevano le anomalie trattando la telemetria come serie temporali numeriche tramite errori di ricostruzione (MSE). In questa tesi valutiamo la fattibilità di un nuovo paradigma basato sulla riformulazione del rilevamento di anomalie della telemetria ICS come un compito di modellazione di linguaggio. L'approccio è guidato da un'intuizione operativa: gli impianti industriali sono governati da relazioni deterministiche di causa-effetto. Rappresentando la telemetria ICS come un flusso di token, sfruttiamo la capacità di un Large Language Model (LLM) di apprendere la sintassi e i pattern del sistema, trattando gli attacchi come sequenze di token inattese. Traendo ispirazione concettuale da una metrica tipica degli LLM, la Perplexity, impostiamo il rilevamento sulla misurazione dell'incertezza nella previsione del token successivo. Per convenienza computazionale e stabilità numerica, calcoliamo direttamente la Cross-Entropy loss, matematicamente equivalente al logaritmo naturale della Perplexity. Per colmare il divario tra fisica continua e linguaggio discreto, introduciamo una strategia di discretizzazione che mappa la telemetria in token specifici aggiunti al vocabolario pre-addestrato. Durante l'addestramento, il modello apprende la distribuzione del comportamento nominale tramite Low-Rank Adaptation (LoRA), mentre in inferenza monitoriamo il flusso di token in arrivo, generando allarmi quando sequenze impreviste causano picchi della loss. Abbiamo valutato l'approccio su tre benchmark reali (SWaT, WADI, HAI). Il modello ottiene risultati competitivi, registrando un F1-Score di 0.833 su SWaT, 0.510 su WADI e 0.566 su HAI, e garantendo un solido compromesso tra attacchi rilevati, precisione e ritardo di rilevamento. Infine, questo lavoro dimostra che modellare la telemetria ICS come un linguaggio strutturato offre un'alternativa efficace per il moderno rilevamento delle intrusioni industriali.
File allegati
File Dimensione Formato  
2026_07_Nuzzo_Executive_Summary.pdf

accessibile in internet solo dagli utenti autorizzati

Descrizione: Executive Summary della Tesi
Dimensione 438.13 kB
Formato Adobe PDF
438.13 kB Adobe PDF   Visualizza/Apri
2026_07_Nuzzo_Thesis.pdf

accessibile in internet solo dagli utenti autorizzati

Descrizione: Testo della tesi
Dimensione 3.2 MB
Formato Adobe PDF
3.2 MB Adobe PDF   Visualizza/Apri

I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/10589/259995