19.3 Probing Classifiers
Logit lens는 hidden state가 model의 unembedding을 통과했을 때 무엇을 예측하는지 묻습니다. Probe 는 다른 질문을 던집니다. 제약된 보조 모델이 그 state에서 지정한 속성을 decode할 수 있는가?
이 구분이 이 절의 인식론적 경계입니다. 성공한 probe는 명시한 실험 protocol 아래의 decodability 를 보여줍니다. Base model이 그 정보를 사용한다거나, 유일한 한 방향에 저장한다거나, distribution shift 뒤에도 같은 feature를 드러낸다는 사실을 단독으로 입증하지는 않습니다.
1. 무엇을 측정하는가
Input 에서 model 위치를 정하고 activation 를 추출합니다. 은 layer, 는 token position과 stream 위치입니다. Label 를 예측하는 probe 를 학습합니다.
Activation artifact에는 다음 정보가 있어야 결과를 재현할 수 있습니다.
- Model checkpoint/tokenizer hash, chat template, input text
- Layer, module, normalization 전후 위치, token-position 선택 규칙
- Dtype, pooling, truncation, padding 동작
- Dataset example ID, split, label provenance, extraction code version
“Layer 20 activation”만으로는 부족합니다. Residual-stream input, attention output, MLP output, post-block residual은 서로 다른 tensor입니다.
2. 왜 Linear Probe를 쓰는가
고용량 nonlinear probe는 target이 복잡하게 표현되어도 유용한 decision surface를 만들 수 있습니다. Linear probe는 질문을 의도적으로 좁힙니다. Label이 affine boundary로 접근 가능한가? Linear Representation Hypothesis 는 고수준 속성이 언제 representation space의 선형 구조와 대응하는지를 연구합니다 [1].
낮은 capacity는 해석에 도움을 주지만 confound를 없애지는 않습니다. 고차원 공간의 linear classifier도 적은 data를 암기하거나, lexical identity 또는 label과 상관된 feature를 이용할 수 있습니다. Probe capacity, regularization, sample 수, representation dimension을 함께 보고해야 합니다.
3. 최소한의 Audit 가능한 실험
Transformation을 fitting하기 전에 split합니다. 관련 prompt, entity, paraphrase, synthetic sibling은 같은 split에 넣어야 합니다. 그렇지 않으면 속성의 일반화가 아니라 example을 인식할 수 있습니다. Normalization 통계는 training data에서만 계산합니다.
Code 범위: 미리 추출한 fixed-length activation과 class ID에 대해 실행할 수 있습니다. Activation hook, sequence pooling, class imbalance, hyperparameter selection, confidence interval, grouped split은 실험별 요소이므로 helper 밖에 둡니다.
import torch
import torch.nn as nn
class LinearProbe(nn.Module):
def __init__(self, width: int, classes: int):
super().__init__()
self.readout = nn.Linear(width, classes)
def forward(self, x: torch.Tensor) -> torch.Tensor:
return self.readout(x)
def fit_linear_probe(
train_x: torch.Tensor,
train_y: torch.Tensor,
test_x: torch.Tensor,
test_y: torch.Tensor,
*,
steps: int = 500,
learning_rate: float = 3e-3,
weight_decay: float = 1e-2,
) -> tuple[LinearProbe, float]:
if train_x.ndim != 2 or test_x.shape[1] != train_x.shape[1]:
raise ValueError("[example, hidden_width] shape과 동일 width가 필요합니다")
classes = int(train_y.max().item()) + 1
if classes < 2:
raise ValueError("training split에는 class가 둘 이상 있어야 합니다")
# Train에서만 preprocessing을 fit하고 probe artifact와 함께 보관합니다.
mean = train_x.mean(dim=0, keepdim=True)
scale = train_x.std(dim=0, keepdim=True).clamp_min(1e-6)
x_train = (train_x - mean) / scale
x_test = (test_x - mean) / scale
torch.manual_seed(0)
probe = LinearProbe(train_x.shape[1], classes).to(train_x.device)
optimizer = torch.optim.AdamW(
probe.parameters(), lr=learning_rate, weight_decay=weight_decay
)
for _ in range(steps):
optimizer.zero_grad(set_to_none=True)
loss = nn.functional.cross_entropy(probe(x_train), train_y)
loss.backward()
optimizer.step()
probe.eval()
with torch.no_grad():
accuracy = (probe(x_test).argmax(dim=-1) == test_y).float().mean().item()
return probe, accuracy
실제 연구에서는 validation data로 hyperparameter를 고르고, 여러 seed와 불확실성을 보고합니다. Majority baseline, token/embedding baseline, random initialization 또는 shuffled-layer representation과도 비교해야 합니다.
4. Control과 Selectivity
Hewitt와 Liang의 control task는 word type마다 random하지만 deterministic한 label을 부여합니다 [2]. Linguistic task와 이 암기하기 쉬운 control을 모두 잘 예측하는 probe는 lexical identity 또는 과한 capacity를 사용했을 수 있습니다.
높은 selectivity는 선택한 probe/data protocol이 해당 control보다 실제 구조를 선호한다는 유용한 근거입니다. Geometry가 인간의 concept을 “자연스럽게 표현한다”는 증명은 아닙니다. 결론은 control 구성, split, capacity measure, metric, distribution에 조건부입니다.
견고한 probe card에는 다음을 포함합니다.
- Label balance와 grouped train/dev/test split
- Test set을 보기 전에 정한 layer와 token position
- Probe family, parameter 수, regularization, seed, preprocessing
- In-distribution, paraphrase, entity-held-out, template-held-out 결과
- Control-task 성능과 단순 representation baseline
- Confidence interval과 best layer뿐 아니라 시도한 모든 hypothesis
5. Decodability에서 Intervention으로
Decodability는 상관관계입니다. Amnesic probing은 probe로 접근 가능한 정보를 제거한 뒤 downstream behavior가 바뀌는지 묻습니다 [3]. Probe matrix 에 대한 한 번의 linear null-space projection은
로 쓸 수 있습니다. 는 Moore–Penrose pseudoinverse입니다. INLP는 선택한 linear probe family가 label을 더 이상 복구하지 못할 때까지 probe fitting과 projection을 반복합니다.
정확한 해석은 “이 probe family가 복구할 수 있는 정보를 intervention이 줄였다”입니다. Concept의 모든 nonlinear encoding을 지운 것이 아니며, 같은 subspace를 공유한 무관한 정보도 제거했을 수 있습니다. 후속 연구는 INLP가 target 이외의 변화를 만들 수 있음을 보고하고, 평가한 설정에서 Mean Projection이나 LEACE가 더 targeted한 제거를 보였다고 설명합니다 [5].
Causal claim에는 control이 필요합니다.
- Completeness: 새 probe도 target을 decode하지 못하는가?
- Intervention selectivity: 대응시킨 non-target 속성은 유지되는가?
- 같은 rank의 random projection과 magnitude-matched noise 비교
- Probe accuracy가 아니라 미리 선언한 downstream behavior 측정
- Layer, seed, removal method, held-out distribution 반복
Canby et al.은 completeness–selectivity trade-off를 실증적으로 정의하고, 평가한 방법 중 모든 조건에서 완벽한 family는 없다고 보고합니다 [6]. 따라서 projection 뒤 behavior 변화는 collateral damage를 배제한 범위에서만 causal contribution의 근거가 됩니다.
6. Unsupervised Probing과 CCS
Contrast-Consistent Search (CCS)는 statement와 negation 같은 pair를 사용합니다. Task label 없이도 prediction이 confident하고 서로 consistent한 low-capacity direction을 찾습니다 [4]. 단순화한 consistency 조건은
입니다.
이는 ground truth가 아니라 가정이자 training signal입니다. 자연어 negation이 완전한 논리적 complement가 아닐 수 있고, 두 문장이 서로 다른 해석에서 모두 모호하거나 거짓일 수 있습니다. Objective에는 sign symmetry가 있으므로 축의 어느 쪽이 true인지 정해야 합니다. Label-free training이라고 model selection까지 label-free인 것도 아닙니다.
CCS 논문은 평가한 dataset과 model에서 zero-shot accuracy 대비 평균 개선을 보고합니다. 이는 latent knowledge elicitation의 초기 방법이지, 보편적인 truth direction이나 모델이 “거짓말한다”는 사실을 확정하는 detector가 아닙니다.
7. 과장 없이 제품 Debugging에 쓰기
Probe는 유용한 계측기가 될 수 있습니다.
- Over-refusal: 정상적인 security 교육과 위험 요청 사이의 risk signal이 layer별로 분리되는지 확인
- RAG grounding: entity/template-held-out data에서 answer-time state가 document-supported answer와 parametric answer를 예측하는지 확인
- Tool readiness: 성공·실패 trace의 pre-call state를 비교해 action choice가 언제 decodable해지는지 확인
이는 hypothesis이지 곧바로 production gate가 아닙니다. Shadow mode에서 시작하고 slice별 false-positive/false-negative 비용을 calibration하며, model/template update마다 drift를 확인해야 합니다. Output 또는 behavior 수준의 fallback도 필요합니다. Base artifact가 바뀌면 activation geometry와 probe calibration도 달라질 수 있습니다.
2-D 모형 표현의 linear separability
Model activation이 아닌 synthetic point입니다. Linear probe가 측정하는 대상을 설명할 뿐, 특정 모델에 대한 근거가 아닙니다.
Interactive는 synthetic 2-D point를 사용합니다. 고정된 linear boundary가 signal과 distribution shift에 어떻게 반응하는지 보여줄 뿐 layer evolution을 모사하거나 LRH를 검증하지 않습니다.
8. 핵심 정리
Probe는 control을 통해 타당성을 확보하는 측정 도구입니다. Linear accuracy는 decodability를, selectivity는 대안 설명의 범위를 좁히는 근거를, 통제된 intervention은 causal contribution을 지지할 수 있습니다. 어느 하나도 유일한 인간 가독 feature를 드러내지는 않습니다. 다음 절의 sparse autoencoder는 미리 정한 label 대신 학습된 feature dictionary를 사용하지만, identifiability와 evaluation이라는 다른 문제를 가져옵니다.
Quizzes
Quiz 1: 높은 held-out linear-probe accuracy만으로 정당화되는 가장 강한 결론은 무엇인가요?
명시한 extraction, split, preprocessing, probe family 아래에서 그 label이 activation으로부터 선형 decode 가능합니다. Model의 사용과 인과성에는 추가 근거가 필요합니다.
Quiz 2: Normalization을 training split에서만 fitting해야 하는 이유는 무엇인가요?
Test 통계를 사용하면 evaluation distribution의 정보가 probe pipeline에 새어 들어가 추정치가 편향될 수 있기 때문입니다.
Quiz 3: INLP 뒤 behavior 저하가 targeted causal dependence를 자동으로 입증하지 않는 이유는 무엇인가요?
Projection이 non-target 정보도 제거하거나 activation을 분포 밖으로 옮길 수 있습니다. Completeness, collateral-feature retention, matched intervention 검증이 필요합니다.
Quiz 4: CCS가 consistent한 statement–negation axis를 찾아도 남는 모호성은 무엇인가요?
Consistency만으로 어느 방향이 true인지 정해지지 않으며, 자연어 pair가 complement 가정을 어길 수 있습니다. Orientation과 외부 평가가 여전히 필요합니다.
Quiz 5: Random example split에서는 잘 되지만 entity-held-out data에서 실패하는 probe는 무엇을 시사하나요?
Random split이 lexical/entity shortcut을 허용했을 가능성이 큽니다. 근거는 일반 속성 표현보다 암기 또는 좁은 interpolation을 지지합니다.
References
- Park, K., et al. (2023). The Linear Representation Hypothesis and the Geometry of Large Language Models. arXiv:2311.03658.
- Hewitt, J., & Liang, P. (2019). Designing and Interpreting Probes with Control Tasks. ACL Anthology.
- Elazar, Y., et al. (2021). Amnesic Probing: Behavioral Explanation with Amnesic Counterfactuals. ACL Anthology.
- Burns, C., et al. (2022). Discovering Latent Knowledge in Language Models Without Supervision. arXiv:2212.03827.
- Dobrzeniecka, A., Fokkens, A., & Sommerauer, P. (2025). Improving Causal Interventions in Amnesic Probing with Mean Projection or LEACE. ACL Anthology.
- Canby, M. E., Davies, A., Rastogi, C., & Hockenmaier, J. (2025). How Reliable are Causal Probing Interventions? ACL Anthology.