Sparse Feature Circuits: Discovering and Editing Interpretable Causal Graphs in Language Models

Link
Abstract

We introduce methods for discovering and applying sparse feature circuits. These are causally implicated subnetworks of human-interpretable features for explaining language model behaviors. Circuits identified in prior work consist of polysemantic and difficult-to-interpret units like attention heads or neurons, rendering them unsuitable for many downstream applications. In contrast, sparse feature circuits enable detailed understanding of unanticipated mechanisms. Because they are based on fine-grained units, sparse feature circuits are useful for downstream tasks: We introduce SHIFT, where we improve the generalization of a classifier by ablating features that a human judges to be task-irrelevant. Finally, we demonstrate an entirely unsupervised and scalable interpretability pipeline by discovering thousands of sparse feature circuits for automatically discovered model behaviors.

Synth

Problem:: 기존 신경망 해석 방법들이 Polysemantic하고 해석 어려운 Coarse-Grained Component (Attention Head, MLP Module)에 집중 / Fine-Grained 분석은 연구자 가설에 의존하며 예상치 못한 모델 행동 설명 불가 / 인간이 해석 가능한 Fine-Grained Component로 모델 행동을 설명하는 확장 가능한 방법 부재

Solution:: Sparse Autoencoder (SAE)로 해석 가능한 Feature 추출 / Linear Approximation (Attribution Patching, Integrated Gradients)으로 수천 개 Feature의 인과 효과를 병렬로 효율적 계산 / Threshold 기반으로 중요 Feature와 Edge만 선별하여 Sparse Circuit 구성 / SHIFT를 통해 인간 판단으로 Task-Irrelevant Feature 제거

Novelty:: SAE Feature 기반 Circuit Discovery (기존은 Neuron/Attention Head 단위) / Disambiguating Data 없이 Human Interpretability만으로 Spurious Signal 제거 가능 / 완전 비지도 방식으로 수천 개 모델 행동 자동 발견 및 Circuit 구축 / SAE Error Term을 Circuit에 포함시켜 모델 행동 완전 분해

Note:: Feature Circuit이 Neuron Circuit보다 10-100배 적은 Component로 동일 성능 설명 / Pythia-70M에서 100개 Feature로 80% 성능 설명 (vs 1,500개 Neuron) / SHIFT로 Gender Bias 87.4% → 54.0% 감소하며 Profession 정확도 61.9% → 88.5% 향상 / feature-circuits.xyz에서 수천 개 자동 발견 Circuit 확인 가능

Summary

file-20250613092236014.png

전체 파이프라인 개요: Contrastive Pairs, Classification Data, 또는 Auto-discovered Behaviors를 입력으로 받아 Human-Interpretable Sparse Feature로 구성된 Circuit을 발견하고, 필요시 Spurious Feature를 제거하여 시스템의 일반화 성능을 개선

Motivation

Method

핵심 목적과 접근 방식

Sparse Autoencoder를 통한 Feature Disentanglement

Linear Approximation을 통한 인과 효과 측정

Sparse Feature Circuit Discovery 상세 과정

file-20250613092424227.png

Step 1: Cache Activations and Metric

Step 2: Backpropagate and Store Gradients

Step 3: Compute Effects and Filter Nodes

Step 4: Compute and Filter Edges

SHIFT (Sparse Human-Interpretable Feature Trimming)

배경: 기존 Spurious Correlation 제거 방법의 한계

SHIFT 방법론 상세

  1. Feature Circuit 발견
    • 분류기 C의 정확도를 설명하는 Circuit 계산
    • Metric: m=logC(y|x) (올바른 레이블에 대한 Negative Log Likelihood)
    • Zero-Ablation Variant 사용: IE(m;a;x)=m(x|do(a=0))m(x)
  2. 인간의 Feature 해석 및 판별
    • Neuronpedia Interface 사용: 대규모 텍스트 코퍼스에서 각 Feature의 Maximally Activating Example 표시
    • Feature의 Direct Effect on Output Logits 확인
    • Task-Irrelevant Feature 식별: 예) 여성 전기에서 여성 관련 언어를 촉진하는 Feature
    • 추가적인 Unlabeled Data는 사용하지만, 추가 Labeled Data나 Classification Data는 사용하지 않음
  3. Feature Ablation
    • 식별된 Task-Irrelevant Feature들을 Zero-Ablation (활성화를 0으로 설정)
    • 모델의 다른 부분은 그대로 유지
    • Spurious Signal에 대한 의존성만 선택적으로 제거
  4. 선택적 Fine-Tuning
    • Ablation으로 인한 성능 저하 복구
    • 원래의 Ambiguous Training Set으로 Linear Classification Head만 재학습
    • Ablated Model에서 추출한 활성화를 사용하여 새로운 분류기 학습

Method 검증

Subject-Verb Agreement Task 실험

file-20250613092604598.png

Case Study: Relative Clause를 넘어선 Subject-Verb Agreement

file-20250613092645806.png

Pythia (a)와 Gemma-2 (b)의 Circuit 구조

Pythia-70M Circuit (86 nodes):

Gemma-2-2B Circuit (223 nodes):

대규모 비지도 Circuit Discovery

file-20250613092803008.png

자동 발견된 Cluster와 Feature 예시:

Cluster 382: Incrementing Sequences

Cluster 475: "to" as Infinitive Object

Bias in Bios Dataset에서 SHIFT 적용