Testing the ethical robustness of large language models (LLMs) requires the exploration of settings that reflect the dynamic nature of real-world interactions. Standard red-teaming practices, largely based on single-turn prompts or static datasets, capture isolated policy violations but cannot detect gradual harmful content degeneration emerging across dialogues. This thesis introduces PATH (Persuasion-guided Automated Testing for Harm), a novel framework to frames testing of LLMs testing for harmful behavior as an optimization problem using multi-turn persuasion techniques. Starting from a set of seeds (potentially dangerous prompts), a test session in PATH realizes multi-turn dialogues as a tree search in which a Persuader agent incrementally steers the conversation toward potentially harmful behavior, while an LLM-as-a-Judge provides ethical assessment according to configurable taxonomies. Dialogue trajectories are expanded using a Monte Carlo Tree Search (MCTS) that balances contextual exploration and exploitative refinement, enabling the discovery of subtle, progressive degeneration patterns. PATH supports arbitrary LLMs as Persuader, Judge, or System Under Test (SUT), and can operate with custom taxonomies or seed datasets. Empirical comparisons with a state-of-the-art baseline so-called EvoTox shows that PATH achieves lower refusal rate and higher harmful content degeneration in larger LLMs, while smaller LLMs remain more susceptible to direct, single-turn queries. An analyses of the adopted LLM-as-a-Judge approache reveals disalignment between LLM-based and classifier-based evaluations, indicating that they capture distinct dimensions of ethical failure.

Testare la robustezza etica dei large language models (LLM) richiede l'esplorazione di scenari che riflettano la natura dinamica delle interazioni reali. Le pratiche standard di red-teaming, basate principalmente su prompt a singolo turno o su dataset statici, permettono di individuare violazioni isolate delle policy, ma non riescono a rilevare forme di degenerazione dannosa graduale che emergono nel corso di dialoghi prolungati. Questa tesi introduce PATH (Persuasion-guided Automated Testing for Harm), un nuovo framework che riformula il testing dei LLM rispetto a comportamenti dannosi come un problema di ottimizzazione, sfruttando tecniche di persuasione multi-turno. A partire da un insieme di seed (prompt potenzialmente pericolosi), una sessione di test in PATH si sviluppa come una ricerca ad albero, in cui un agente Persuader guida progressivamente la conversazione verso comportamenti potenzialmente dannosi, mentre un LLM-as-a-Judge fornisce una valutazione etica secondo tassonomie configurabili. Le traiettorie dialogiche vengono espanse tramite una Monte Carlo Tree Search (MCTS) che bilancia esplorazione contestuale e raffinamento sfruttativo, consentendo di individuare schemi di degenerazione sottili e progressivi. PATH supporta l'uso di LLM arbitrari nei ruoli di Persuader, Judge o System Under Test (SUT), e può operare con tassonomie o dataset di seed personalizzati. I confronti empirici con il baseline allo stato dell'arte, EvoTox, mostrano che PATH ottiene un tasso di rifiuto inferiore e una maggiore degenerazione di contenuti dannosi nei LLM di grandi dimensioni, mentre i modelli più piccoli restano più vulnerabili a query dirette a singolo turno. Un'analisi degli approcci LLM-as-a-Judge adottati rivela infine una disallineamento tra valutazioni basate su LLM e su classificatori, suggerendo che esse catturano dimensioni distinte del fallimento etico.

Persuasion-guided automated testing for harmful content degeneration in Large Language Models

NEGRI, FRANCESCO RENATO
2024/2025

Abstract

Testing the ethical robustness of large language models (LLMs) requires the exploration of settings that reflect the dynamic nature of real-world interactions. Standard red-teaming practices, largely based on single-turn prompts or static datasets, capture isolated policy violations but cannot detect gradual harmful content degeneration emerging across dialogues. This thesis introduces PATH (Persuasion-guided Automated Testing for Harm), a novel framework to frames testing of LLMs testing for harmful behavior as an optimization problem using multi-turn persuasion techniques. Starting from a set of seeds (potentially dangerous prompts), a test session in PATH realizes multi-turn dialogues as a tree search in which a Persuader agent incrementally steers the conversation toward potentially harmful behavior, while an LLM-as-a-Judge provides ethical assessment according to configurable taxonomies. Dialogue trajectories are expanded using a Monte Carlo Tree Search (MCTS) that balances contextual exploration and exploitative refinement, enabling the discovery of subtle, progressive degeneration patterns. PATH supports arbitrary LLMs as Persuader, Judge, or System Under Test (SUT), and can operate with custom taxonomies or seed datasets. Empirical comparisons with a state-of-the-art baseline so-called EvoTox shows that PATH achieves lower refusal rate and higher harmful content degeneration in larger LLMs, while smaller LLMs remain more susceptible to direct, single-turn queries. An analyses of the adopted LLM-as-a-Judge approache reveals disalignment between LLM-based and classifier-based evaluations, indicating that they capture distinct dimensions of ethical failure.
LESTINGI, LIVIA
SCOTTI, VINCENZO
ING - Scuola di Ingegneria Industriale e dell'Informazione
10-dic-2025
2024/2025
Testare la robustezza etica dei large language models (LLM) richiede l'esplorazione di scenari che riflettano la natura dinamica delle interazioni reali. Le pratiche standard di red-teaming, basate principalmente su prompt a singolo turno o su dataset statici, permettono di individuare violazioni isolate delle policy, ma non riescono a rilevare forme di degenerazione dannosa graduale che emergono nel corso di dialoghi prolungati. Questa tesi introduce PATH (Persuasion-guided Automated Testing for Harm), un nuovo framework che riformula il testing dei LLM rispetto a comportamenti dannosi come un problema di ottimizzazione, sfruttando tecniche di persuasione multi-turno. A partire da un insieme di seed (prompt potenzialmente pericolosi), una sessione di test in PATH si sviluppa come una ricerca ad albero, in cui un agente Persuader guida progressivamente la conversazione verso comportamenti potenzialmente dannosi, mentre un LLM-as-a-Judge fornisce una valutazione etica secondo tassonomie configurabili. Le traiettorie dialogiche vengono espanse tramite una Monte Carlo Tree Search (MCTS) che bilancia esplorazione contestuale e raffinamento sfruttativo, consentendo di individuare schemi di degenerazione sottili e progressivi. PATH supporta l'uso di LLM arbitrari nei ruoli di Persuader, Judge o System Under Test (SUT), e può operare con tassonomie o dataset di seed personalizzati. I confronti empirici con il baseline allo stato dell'arte, EvoTox, mostrano che PATH ottiene un tasso di rifiuto inferiore e una maggiore degenerazione di contenuti dannosi nei LLM di grandi dimensioni, mentre i modelli più piccoli restano più vulnerabili a query dirette a singolo turno. Un'analisi degli approcci LLM-as-a-Judge adottati rivela infine una disallineamento tra valutazioni basate su LLM e su classificatori, suggerendo che esse catturano dimensioni distinte del fallimento etico.
File allegati
File Dimensione Formato  
2025_12_Negri.pdf

accessibile in internet per tutti

Descrizione: Thesis
Dimensione 2.39 MB
Formato Adobe PDF
2.39 MB Adobe PDF Visualizza/Apri
2025_12_Negri_ExecutiveSummary.pdf

accessibile in internet per tutti

Descrizione: Executive Summary
Dimensione 1.05 MB
Formato Adobe PDF
1.05 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/246623