in-context-learning causal-intervention graph-learning pca-analysis induction-circuits graph-random-walk latent-structure llm-internal-representation
Abstract
How do LLMs learn in-context? Is it by pattern-matching recent tokens, or by inferring latent structure? We probe this question using a toy graph random-walk across two competing graph structures. This task's answer is, in principle, decidable: either the model tracks global topology, or it copies local transitions. We present two lines of evidence that neither account alone is sufficient. First, reconstructing the internal representation structure via PCA reveals that at intermediate mixture ratios, both graph topologies are encoded in orthogonal principal subspaces simultaneously. This pattern is difficult to reconcile with purely local transition copying. Second, residual-stream activation patching and graph-difference steering causally intervene on this graph-family signal: late-layer patching almost fully transfers the clean graph preference, while linear steering moves predictions in the intended direction and fails under norm-matched and label-shuffled controls. Taken together, our findings are most consistent with a dual-mechanism account in which genuine structure inference and induction circuits operate in parallel.
한국어 요약
📋 한 줄 요약
**[Mechanistic Interpretability / In-Context Learning]** 그래프 랜덤워크 토이 태스크와 인과적 개입 기법으로, LLM의 인-컨텍스트 학습이 국소 패턴 매칭과 잠재 구조 추론이 병렬로 작동하는 이중 메커니즘임을 보였다.
🎯 핵심 기여도
- LLM의 인-컨텍스트 학습이 '국소 토큰 복사'와 '글로벌 구조 추론' 둘 다 단독으로는 부족함을 입증
- 두 그래프 구조가 중간 혼합 비율에서 직교하는 주요 부분공간에 동시에 인코딩됨을 발견
- 잔차 스트림(residual-stream) 활성 패칭을 통한 인과적 메커니즘 검증
- '구조 추론 + 유도 회로(induction circuit)'가 병렬 작동하는 이중 메커니즘 가설 제시
💡 핵심 아이디어
LLM의 인-컨텍스트 학습을 '국소 패턴 매칭'이냐 '구조 추론'이냐의 이분법으로 보지 말고, 두 메커니즘이 동시에 직교 부분공간에서 작동하는 이중 시스템으로 봐야 한다.
🔬 기술적 접근법
- **모델/방법론**: 두 그래프 구조 위의 랜덤워크를 결정 가능한 토이 태스크로 사용
- **핵심 기법**: PCA를 통한 내부 표현 재구성, 잔차 스트림 활성 패칭, 그래프 차이 기반 선형 스티어링, 노름 일치/레이블 셔플 통제 실험
📊 주요 결과
- 중간 혼합 비율에서 두 그래프 토폴로지가 직교 주요 부분공간에 동시 인코딩됨을 PCA로 확인
- 후기 층 패칭이 깨끗한 그래프 선호도를 거의 완전히 전이
- 선형 스티어링이 의도한 방향으로 예측 이동, 통제 조건에서는 실패
💭 의의 및 한계
**의의**: 인-컨텍스트 학습의 작동 방식을 단일 가설이 아닌 병렬 메커니즘으로 재정의한 인과적 증거를 제공한다. **한계**: 토이 그래프 환경에 한정된 결과로, 자연어 추론에서의 일반화는 추가 연구가 필요하다.
🚀 실용적 활용
- LLM 해석 가능성 진단 도구 개발
- 인-컨텍스트 학습 능력을 강화하는 학습 데이터 설계
- 회로 수준 안전성 분석과 디버깅