Hypothesis Testing the Circuit Hypothesis in LLMs

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Shi, Claudia, Beltran-Velez, Nicolas, Nazaret, Achille, Zheng, Carolina, Garriga-Alonso, Adrià, Jesson, Andrew, Makar, Maggie, Blei, David M.
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910654004199424
author Shi, Claudia
Beltran-Velez, Nicolas
Nazaret, Achille
Zheng, Carolina
Garriga-Alonso, Adrià
Jesson, Andrew
Makar, Maggie
Blei, David M.
author_facet Shi, Claudia
Beltran-Velez, Nicolas
Nazaret, Achille
Zheng, Carolina
Garriga-Alonso, Adrià
Jesson, Andrew
Makar, Maggie
Blei, David M.
contents Large language models (LLMs) demonstrate surprising capabilities, but we do not understand how they are implemented. One hypothesis suggests that these capabilities are primarily executed by small subnetworks within the LLM, known as circuits. But how can we evaluate this hypothesis? In this paper, we formalize a set of criteria that a circuit is hypothesized to meet and develop a suite of hypothesis tests to evaluate how well circuits satisfy them. The criteria focus on the extent to which the LLM's behavior is preserved, the degree of localization of this behavior, and whether the circuit is minimal. We apply these tests to six circuits described in the research literature. We find that synthetic circuits -- circuits that are hard-coded in the model -- align with the idealized properties. Circuits discovered in Transformer models satisfy the criteria to varying degrees. To facilitate future empirical studies of circuits, we created the \textit{circuitry} package, a wrapper around the \textit{TransformerLens} library, which abstracts away lower-level manipulations of hooks and activations. The software is available at \url{https://github.com/blei-lab/circuitry}.
format Preprint
id arxiv_https___arxiv_org_abs_2410_13032
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Hypothesis Testing the Circuit Hypothesis in LLMs
Shi, Claudia
Beltran-Velez, Nicolas
Nazaret, Achille
Zheng, Carolina
Garriga-Alonso, Adrià
Jesson, Andrew
Makar, Maggie
Blei, David M.
Artificial Intelligence
Machine Learning
Large language models (LLMs) demonstrate surprising capabilities, but we do not understand how they are implemented. One hypothesis suggests that these capabilities are primarily executed by small subnetworks within the LLM, known as circuits. But how can we evaluate this hypothesis? In this paper, we formalize a set of criteria that a circuit is hypothesized to meet and develop a suite of hypothesis tests to evaluate how well circuits satisfy them. The criteria focus on the extent to which the LLM's behavior is preserved, the degree of localization of this behavior, and whether the circuit is minimal. We apply these tests to six circuits described in the research literature. We find that synthetic circuits -- circuits that are hard-coded in the model -- align with the idealized properties. Circuits discovered in Transformer models satisfy the criteria to varying degrees. To facilitate future empirical studies of circuits, we created the \textit{circuitry} package, a wrapper around the \textit{TransformerLens} library, which abstracts away lower-level manipulations of hooks and activations. The software is available at \url{https://github.com/blei-lab/circuitry}.
title Hypothesis Testing the Circuit Hypothesis in LLMs
topic Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2410.13032