Large Language Models (LLMs) are powerful but opaque "black boxes", posing significant risks for safety, reliability, and alignment with human values. The field of Mechanistic Interpretability (MI) seeks to reverse-engineer their internal algorithms by identifying causally-responsible "circuits". However, current circuit discovery methods are fundamentally edge-centric, focusing on the importance of individual connections. This perspective is limited, as it fails to capture the flow of information, which unfolds along multi-step computational paths. This thesis introduces and evaluates a novel path-centric methodology called Isolating Path Effects (IPE), which moves the fundamental unit of analysis from individual edges to entire, end-to-end computational paths. We develop a formalism to define and score path contributions and introduce two new search algorithms: Path Message Patching (PMP), a precise causal method, and Path Attribution Patching (PAP), an efficient gradient-based approximation. We also present an interactive framework specifically designed to visualize and intuitively interpret computational paths. We provide a comprehensive validation of the IPE methodology, 1. demonstrating that our path-centric approach is computationally feasible, through PMP and our PAP approximation; 2. functionally correct, successfully recovering the "ground truth" Indirect Object Identification (IOI) circuit; 3. and competitive with state-of-the-art edge-centric methods on standard benchmarks. Our findings establish path-centric analysis as a viable and highly interpretable approach for reverse-engineering the internal mechanisms of LLMs.
I Large Language Models (LLMs) sono potenti ma opache "scatole nere", ciò pone rischi significativi per quanto riguarda la sicurezza, l’affidabilità e l’allineamento con i valori umani. Il campo dell’Interpretabilità Meccanicistica (MI) cerca di decodificare i loro meccanismi interni, identificando "circuiti" ai quali è attribuibile la causa di un determinato comportamento del modello. Tuttavia, gli attuali metodi di scoperta di questi circuiti sono fortemente incentrati sull’interazione tra singole coppie di componenti. Questa prospettiva è limitata, in quanto non riesce a catturare il flusso di informazione che si sviluppa lungo percorsi computazionali composti da più componenti. In questa tesi introduciamo e valutiamo un nuovo metodo, incentrato su interi percorsi (path-centric), chiamato Isolating Path Effects (IPE). IPE sposta l’unità fondamentale dell’analisi da singole coppie di componenti ad interi percorsi computazionali che partono dall’input del modello e giungono al suo output. A tale scopo formalizziamo la definizione di contributo di un percorso computazionale, inoltre introduciamo due algoritmi di ricerca: Path Message Patching (PMP), un metodo di attribuzione causale preciso, e Path Attribution Patching (PAP), la sua approssimazione lineare. Infine presentiamo un framework interattivo per visualizzare e comprendere intuitivamente il ruolo svolto da differenti percorsi. Questo lavoro fornisce una validazione della metodologia IPE, dimostrando come un approccio path-centric sia: 1. computazionalmente fattibile; 2. funzionalmente corretto, recuperando con successo il circuito noto dell’Indirect Object Identification (IOI); e 3. competitivo con i metodi allo stato dell’arte. I nostri risultati consolidano l’analisi path-centric come un paradigma praticabile, scalabile ed intuitivo per il reverse-engineering dei meccanismi interni degli LLMs.
A look inside Large Language Models: isolating path effects for latent circuit identification
Cerutti, Andrea
2024/2025
Abstract
Large Language Models (LLMs) are powerful but opaque "black boxes", posing significant risks for safety, reliability, and alignment with human values. The field of Mechanistic Interpretability (MI) seeks to reverse-engineer their internal algorithms by identifying causally-responsible "circuits". However, current circuit discovery methods are fundamentally edge-centric, focusing on the importance of individual connections. This perspective is limited, as it fails to capture the flow of information, which unfolds along multi-step computational paths. This thesis introduces and evaluates a novel path-centric methodology called Isolating Path Effects (IPE), which moves the fundamental unit of analysis from individual edges to entire, end-to-end computational paths. We develop a formalism to define and score path contributions and introduce two new search algorithms: Path Message Patching (PMP), a precise causal method, and Path Attribution Patching (PAP), an efficient gradient-based approximation. We also present an interactive framework specifically designed to visualize and intuitively interpret computational paths. We provide a comprehensive validation of the IPE methodology, 1. demonstrating that our path-centric approach is computationally feasible, through PMP and our PAP approximation; 2. functionally correct, successfully recovering the "ground truth" Indirect Object Identification (IOI) circuit; 3. and competitive with state-of-the-art edge-centric methods on standard benchmarks. Our findings establish path-centric analysis as a viable and highly interpretable approach for reverse-engineering the internal mechanisms of LLMs.| File | Dimensione | Formato | |
|---|---|---|---|
|
2025_12_Cerutti_Executive Summary.pdf
accessibile in internet per tutti
Descrizione: executive summary
Dimensione
1.56 MB
Formato
Adobe PDF
|
1.56 MB | Adobe PDF | Visualizza/Apri |
|
2025_12_Cerutti_Tesi.pdf
accessibile in internet per tutti
Descrizione: testo tesi
Dimensione
8.53 MB
Formato
Adobe PDF
|
8.53 MB | Adobe PDF | Visualizza/Apri |
I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.
https://hdl.handle.net/10589/247568