Patchscopes: A Unifying Framework for Inspecting Hidden Representations of Language Models

Asma Ghandeharioun, Avi Caciularu, Adam Pearce, Lucas Dixon, Mor Geva

arXiv:2401.06102 · 2026-07-27 공개 · arXiv · PDF

language-models transformer-architecture model-interpretability error-correction natural-language-explanation representation-inspection llm-exploration multimodel-explanation

Abstract

Understanding the internal representations of large language models (LLMs) can help explain models' behavior and verify their alignment with human values. Given the capabilities of LLMs in generating human-understandable text, we propose leveraging the model itself to explain its internal representations in natural language. We introduce a framework called Patchscopes and show how it can be used to answer a wide range of questions about an LLM's computation. We show that many prior interpretability methods based on projecting representations into the vocabulary space and intervening on the LLM computation can be viewed as instances of this framework. Moreover, several of their shortcomings such as failure in inspecting early layers or lack of expressivity can be mitigated by Patchscopes. Beyond unifying prior inspection techniques, Patchscopes also opens up new possibilities such as using a more capable model to explain the representations of a smaller model, and multihop reasoning error correction.

한국어 요약

한 줄 요약

Patchscopes는 LLM 내부 표현을 해석하기 위한 통합적이고 유연한 프레임워크로, 기존 방법의 한계를 극복하고 새로운 해석 가능성과 오류 수정 기능을 제공한다.

핵심 기여도

핵심 아이디어

Patchscopes는 LLM이 생성하는 자연어를 활용해 모델 내부 표현을 해석하는 프레임워크이다. 기존 방법은 표현을 단어 공간으로 투영하거나 계산에 개입하는 방식이었으나, Patchscopes는 특정 정보를 추출하도록 설계된 다른 프롬프트에 활성화 정보를 '패치(patch)'하여 해석한다. 이는 기존 activation patching 기법을 확장한 것으로, 다양한 해석 목적에 따라 구성 가능한 inspection tool로 활용된다.

예를 들어, "tok1 → tok1; tok2 → tok2; …" 형식의 few-shot 프롬프트를 사용하면, 토큰 ID 예측 성능이 vocabulary projection 방법 대비 크게 향상된다. 또한, Patchscopes는 훈련 데이터 없이도 12개의 common sense 및 사실 추론 작업 중 6개에서 probing 방법을 초과하는 성능을 보인다.

기술적 접근법

주요 결과

의의 및 한계

Patchscopes는 기존 해석 방법을 통합하면서도 새로운 해석 가능성(예: cross-model inspection, multi-hop 오류 수정)을 제공한다. 특히, 훈련 데이터 없이도 높은 성능을 보이는 점에서 실용적 가치가 크다. 또한, early layer 분석 실패 문제를 해결함으로써 LLM의 내부 작동 메커니즘을 더 깊이 이해할 수 있다.

그러나, Patchscopes는 패치된 정보가 원본 프롬프트의 문맥과 분리되기 때문에, 일부 정보는 재구성되지 않을 수 있다. 또한, 패치된 계산 이후의 정보가 원래 표현에 포함되어 있지 않을 수 있으므로, 모든 정보를 정확히 복원하지는 못한다.

실용적 활용

Patchscopes는 LLM의 내부 작동 메커니즘을 해석하고, 오류를 수정하는 데 유용하게 활용될 수 있다. 예를 들어, 교육, 의료, 법률 분야에서 모델의 결정 과정을 설명하거나, 모델의 신뢰성을 높이기 위한 디버깅 도구로 사용 가능하다. 또한, 더 강력한 모델을 활용해 작은 모델의 내부 표현을 해석하는 cross-model inspection 기법은 모델 개발 및 최적화에도 기여할 수 있다.