Circuit Compositions: Exploring Modular Structures in Transformer-Based Language Models

Philipp Mondorf, Sondre Wold, Barbara Plank
10/2/2024
cs.LGcs.CL

No official code found. Best implementation: SondreWold/comp_rep_study (1 star, CC-BY-SA-4.0, last commit 2025-02-11).

Abstract

A fundamental question in interpretability research is to what extent neural networks, particularly language models, implement reusable functions through subnetworks that can be composed to perform more complex tasks. Recent advances in mechanistic interpretability have made progress in identifying $\textit{circuits}$, which represent the minimal computational subgraphs responsible for a model's behavior on specific tasks. However, most studies focus on identifying circuits for individual tasks without investigating how functionally similar circuits $\textit{relate}$ to each other. To address this gap, we study the modularity of neural networks by analyzing circuits for highly compositional subtasks within a transformer-based language model. Specifically, given a probabilistic context-free grammar, we identify and compare circuits responsible for ten modular string-edit operations. Our results indicate that functionally similar circuits exhibit both notable node overlap and cross-task faithfulness. Moreover, we demonstrate that the circuits identified can be reused and combined through set operations to represent more complex functional model capabilities.

View on arXivView PDF

Code Implementations(1)

CC-BY-SA-4.0

Official implementation for the ACL 2025 Main paper "Circuit Compositions: Exploring Modular Structures in Transformer-Based Language Models"

10TeX, ShellMay 31, 20241 years agoCC-BY-SA-4.0
acl2025interpretabilitynlp

Similar Papers

Cite this paper

@article{mondorf2024circuit,
  title  = {Circuit Compositions: Exploring Modular Structures in Transformer-Based Language Models},
  author = {Philipp Mondorf and Sondre Wold and Barbara Plank},
  year   = {2024},
  eprint = {2410.01434},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.01434v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2410.01434.svg)](https://codeofpaper.com/paper/2410.01434)

Discussion