# Do Benign-Trained Hidden-State Probes Detect Tool Errors Under Adversarial Conditions?

양성 데이터로 학습한 은닉 상태 프로브는 적대적 조건에서도 도구 오류를 탐지하는가?

Bibek Bhandari, Kshitij Lingthep · arXiv · 2026년 11월 8일

- **연구 문제** LLM 에이전트의 잘못된 도구 호출을 적대적 조건에서도 benign 궤적으로 학습한 hidden-state probe가 탐지할 수 있는지 검증합니다.
- **연구 방법** benign과 비방어 궤적에서만 학습한 단계별 로지스틱 회귀 probe를 세 가지 스칼라 불확실성 지표와 AUROC·AP로 비교합니다.
- **주요 결과** probe가 일관되게 우위에 있지는 않았습니다. Qwen2.5-14B-Instruct의 system-override 조건에서는 세 스칼라 지표가 모두 더 높은 AUROC와 AP를 보였고, 이 차이는 Holm 보정 후 여섯 개 비교에서 유의했습니다.

## 연구 질문과 배경

LLM 에이전트는 외부 도구를 호출해 데이터를 얻고 명령을 실행하지만, 잘못된 도구 호출을 낼 수 있습니다. 이는 일반 텍스트 생성의 사실성 문제와는 다른 운영 신뢰성 문제입니다. 적대적 조건에서는 신뢰할 수 없는 도구 출력이나 충돌하는 지시가 에이전트의 운영 결정을 더 크게 흔들 수 있습니다.

이 연구는 모델 내부의 hidden state로 다음 행동의 정확성을 예측하는 probe가 공격 상황에서도 쓸 만한지를 묻습니다. 여기서 중요한 구분은 공격이나 주입 표면을 탐지하는 것과 잘못된 행동을 탐지하는 것이 같지 않다는 점입니다. 최근 연구는 주입된 지시를 표현 수준에서 인식하더라도 그것이 곧 안전을 뜻하지 않는다고 지적합니다.

따라서 이 논문은 benign 조건에서만 학습한 probe를 도구 행동 정확성의 관점에서 평가합니다. 같은 과제 그룹을 held-out으로 두고 평균 도구 호출 토큰 엔트로피, 음의 평균 도구 호출 토큰 로그확률, 자기일관성 불확실성과 비교합니다.

## 도구 행동 정확성 레이블과 비교 신호

이 연구는 AgentDojo 궤적의 각 단계마다 정답 도구 호출과 모델이 생성한 도구 호출을 비교하여 이진 레이블을 붙입니다. 단계 레이블은 생성된 도구 호출이 벤치마크의 정답 요건을 만족하면 0, 그렇지 않으면 1입니다. 도구 선택, 인자, 스키마 유효성, 호출 순서, 프로토콜 제약이 모두 판정에 포함됩니다. 필요한 도구 호출이 빠진 경우에도 도구 호출 토큰 구간이 없더라도 레이블은 1입니다.

정답 소진 표식은 데이터셋의 표식일 뿐 운영 행동이 아니므로 학습과 평가에서 제외됩니다. 반면 정답 호출 순서가 끝난 뒤에 나온 불필요한 도구 호출은 운영 오류로 남깁니다.

probe의 입력은 도구 호출 토큰이 생성되기 직전 마지막 프롬프트 토큰에서 얻은 마지막 transformer layer의 hidden state입니다. 풀링은 적용하지 않으며 특징 차원은 모델의 hidden size입니다. 분류기는 StandardScaler 뒤에 logistic regression을 연결한 파이프라인이고, 표준화 파라미터는 각 fold의 학습 과제 분할에서만 맞춘 뒤 held-out 기록에 적용합니다. 클래스 가중치와 과제 균형 표본 가중치를 함께 사용하며, 단계별 학습에는 최소 세 개의 학습 과제 그룹이 필요합니다. 조건이 충족되지 않으면 현재 fold 학습 과제의 benign 기록만으로 학습한 pooled fallback 모델을 씁니다.

평가는 suite와 task\_id를 합친 과제 그룹 단위의 5-fold OOF로 수행하며 seed는 42입니다. 같은 그룹의 모든 단계와 조건 기록은 같은 fold에 들어가고, 각 held-out 그룹은 그 그룹을 뺀 데이터로 학습한 probe가 채점합니다. 비교 신호는 hidden-state probe, 평균 도구 호출 토큰 엔트로피, 음의 평균 도구 호출 토큰 로그확률, 자기일관성 불확실성이며, 모두 값이 클수록 오류 위험이 크다는 방향으로 정렬됩니다. 자기일관성 불확실성은 생성 출력 중 가장 흔한 도구 호출 signature와 일치하는 비율의 보수이고, 이 출력들은 궤적 수집 중 미리 저장되어 평가에 쓰입니다.

## 쌍별 검정과 통계 절차

쌍별 차이는 hidden-state probe 점수에서 기준선 점수를 뺀 Δ = M\_probe − M\_baseline으로 정의됩니다. 따라서 음수 값은 기준선이 더 높다는 뜻입니다. 주 검정에서는 각 비교마다 10,000회의 cluster-swap 순열을 수행합니다. 순열에서는 각 과제 클러스터 안의 probe 점수와 기준선 점수를 무작위로 맞바꾸고 쌍별 지표 차이를 다시 계산합니다. 부트스트랩 구간은 과제 클러스터 단위의 재표본으로 추정합니다.

총 72개 비교는 3개 모델, 4개 조건, 2개 지표, 3개 기준선으로 구성되며, Holm correction은 AUROC 계열과 AP 계열에 각각 따로 적용됩니다. 그 결과 여섯 개 차이가 유의하며, 모두 Qwen2.5-14B-Instruct의 system-override 조건에서 나타납니다. 세 비교의 Holm 보정 p값은 모두 0.0036입니다.

Fig. 그림의 양의 값은 hidden-state probe가 유리하고, 음의 값은 스칼라 비교 신호가 유리하다는 뜻입니다.

![Figure 1: Paired detector differences. Positive values favor the hidden-state probe; negative values favor the scalar comparator. The figure shows family-wise…](https://refivu.com/papers/ad8a6dcb-d3ec-4ca8-a949-049aee235a40/figures/figure-ceb82b1d09adc4897e523f93f4124207.png?thumb=512)

**Fig. 1** . Paired detector differences. Positive values favor the hidden-state probe; negative values favor the scalar comparator. The figure shows family-wise max-\|t\|simultaneous bootstrap intervals and Holm-adjusted paired cluster-swap permutation results. Asterisks indicate comparisons that remain significant after Holm correction (p Holm \<0.05). Entropy denotes mean tool-call-token entropy.

[원문](https://arxiv.org/abs/2611.11172v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Bibek Bhandari, Kshitij Lingthep · Do Benign-Trained Hidden-State Probes Detect Tool Errors Under Adversarial Conditions? · 원문 그림 인용 · 원본 PDF 5쪽에서 그림 영역을 추출했습니다.

## 모델과 조건별 탐지 성능

Qwen2.5-7B-Instruct에서는 평균 도구 호출 토큰 엔트로피, 음의 평균 로그확률, 자기일관성 불확실성이 네 조건 모두에서 hidden-state probe보다 높은 AUROC와 AP를 보입니다. 가장 큰 차이는 system-override 조건에서 나타납니다. 이 조건에서 probe는 AUROC 0.575와 AP 0.694이고, 엔트로피는 AUROC 0.782와 AP 0.871입니다.

GLM-4.6V-Flash에서는 탐지기 사이의 차이가 작습니다. 엔트로피와 음의 평균 로그확률은 네 조건 모두에서 probe보다 높은 값을 보입니다. system-override에서는 자기일관성 불확실성이 AUROC 0.742로 가장 높고, 음의 평균 로그확률이 AP 0.807로 가장 높습니다. 이 모델에서는 probe가 스칼라 불확실성 지표를 일관되게 앞서지 못하며, Holm 보정 후 유의한 쌍별 차이도 남지 않습니다.

Qwen2.5-14B-Instruct에서는 benign, prompt-injection, tool-poisoning 조건의 probe AUROC가 Qwen2.5-7B-Instruct보다 높습니다. 그러나 system-override에서는 probe가 AUROC 0.431과 AP 0.573으로 떨어지고, 엔트로피는 AUROC 0.758과 AP 0.821을 보입니다. 따라서 모델 크기가 커질수록 probe 성능이 일관되게 좋아지는 것은 아닙니다. 이 수치들은 세 모델과 네 조건의 공통 완전 사례 집단에서 얻은 것입니다.

## 폴백 예측을 제외한 민감도 분석

이 분석은 폴백 예측이 Qwen2.5-14B-Instruct의 system-override 결과를 만든 것인지 확인하기 위한 것입니다.

Qwen2.5-14B-Instruct의 system-override 조건에서 폴백을 포함하면 probe의 AUROC와 AP는 0.431과 0.573입니다. 폴백을 제외하면 0.428과 0.564로 거의 같습니다. 같은 조건에서 엔트로피는 0.758/0.821에서 0.762/0.819로, 음의 평균 로그확률은 0.744/0.798에서 0.747/0.794로, 자기일관성은 0.730/0.781에서 0.731/0.778로 바뀝니다. 따라서 hidden-state probe와 스칼라 불확실성 지표 사이의 질적 차이는 폴백 추정을 제외해도 유지됩니다.

## 데이터 제약과 적용 범위

첫째, 311개의 missing\_tool\_call 기록에는 유효한 도구 호출 토큰 경계가 없으므로 엔트로피와 음의 평균 로그확률을 계산할 수 없습니다. 이 기록은 전체 OOF 집단에는 남지만 네 신호 비교에서는 제외되며, 값을 임의로 채우지 않습니다. 둘째, 384개의 OOF 예측이 pooled fallback에 의존하므로 쌍별 비교의 해석 범위가 제한됩니다.

셋째, 평가는 AgentDojo 96개 과제 그룹에서 이루어졌고 slack/user\_task\_11 그룹은 사용할 수 없었습니다. 그룹 분할은 층화되지 않은 shuffled K-fold이며, 독립적인 과제 그룹 수가 작아 교차 검증 결과에 분산이 생길 수 있습니다.

넷째, 평가는 저장된 비방어 궤적에 대해 오프라인으로 수행되었습니다. 지연 시간, 계산 비용, 실행 전 도구 호출 차단의 유용성은 다루지 않으므로 탐지기 순위가 차단 전략의 효과를 보장하지는 않습니다. 또한 라벨은 운영 도구 행동의 정확성을 평가하므로 결과를 자연어 환각이나 에이전트 안전 문제로 일반화해서는 안 됩니다.

## 논문 정보

- **저자**: Bibek Bhandari, Kshitij Lingthep
- **학회·저널**: arXiv · 프리프린트
- **최초 공개일**: 2026년 11월 8일
- **등록일**: 2026년 11월 10일
- **수정일**: 2026년 11월 8일
- **버전**: v1
- **arXiv**: 2611.11172
- **분류**: cs.CR · cs.AI · cs.CL
- **원문 이용 조건**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **제공 범위**: 논문 정보, 해설, 허용된 원문 그림

[논문 원문 ↗](https://arxiv.org/abs/2611.11172v1) · [원문 PDF ↗](https://arxiv.org/pdf/2611.11172v1)

AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.

## 초록

Although hidden-state probes efficiently monitor model operation, it remains unclear whether probes trained on benign tool use remain useful for detecting incorrect actions under adversarial conditions. In this research, we assess this problem from the perspective of operational tool-action correct- ness. we use four AgentDojo suites, four conditions, and three models: Qwen2.5-7B-Instruct, Qwen2.5-14B-Instruct, and GLM- 4.6V-Flash (9B). We perform a five-fold, task-grouped out-of-fold (OOF) evaluation for each model. We train step-specific logistic- regression probes only on benign and non-defended trajectories and evaluate them on held-out trajectories for benign, prompt- injection, system-override, and tool-poisoning conditions. We compare our hidden-state probe to mean tool-call-token entropy, negative mean tool-call-token log-probability, and self-consistency uncertainty. The paired tests highlight six significant differences after Holm correction. All of the tests involve Qwen2.5-14B- Instruct under the system-override condition, with all three scalar uncertainty metrics obtaining higher area under the receiver operating characteristic curve (AUROC) and average precision (AP) than the hidden-state probe. These results suggest that benign-trained hidden-state probes should not be assumed to reliably detect operational tool-action errors under adversarial conditions.

## 원문 인용

Bibek Bhandari, Kshitij Lingthep (2026). Do Benign-Trained Hidden-State Probes Detect Tool Errors Under Adversarial Conditions?. arXiv:2611.11172v1. https://arxiv.org/abs/2611.11172v1

**BibTeX**

```
@misc{bhandari2026benign,
  title = {{Do Benign-Trained Hidden-State Probes Detect Tool Errors Under Adversarial Conditions?}},
  author = {Bibek Bhandari and Kshitij Lingthep},
  year = {2026},
  eprint = {2611.11172},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.11172v1}
}
```

## 이 논문의 용어

- [AUROC](https://refivu.com/terms/096f06e69425-auroc)
- [logistic regression](https://refivu.com/terms/3551369d301a-logistic-regression)
- [Holm correction](https://refivu.com/terms/9901890e77ae-holm-correction)
- [average precision](https://refivu.com/terms/1764eaa249a6-average-precision)
- [AgentDojo](https://refivu.com/terms/c65f2862fdf3-agentdojo)
- [task-cluster bootstrap](https://refivu.com/terms/735d06b80e78-task-cluster-bootstrap)

## 다른 논문 해설

- [Discrete Diffusion Playground: A 2D Benchmark for Discrete Generative Models](https://refivu.com/papers/8302d4e3-3c08-482a-9d5c-9d7f82e3e5b0-discrete-diffusion-playground-a-2d-benchmark-for-discrete.md)
- [Explicitly capturing demonstrator multi-modality for distillation into diffusion policies](https://refivu.com/papers/1fe9a7d4-0db0-4fca-80ae-f222859f2131-explicitly-capturing-demonstrator-multi-modality-for.md)
- [Reconciling European Electricity Data with Diffusion Priors Learned from Observations Alone](https://refivu.com/papers/9b64e54c-076c-496c-9236-8744425c1c5a-reconciling-european-electricity-data-with-diffusion-priors.md)
- [ChainFlow: Few-Step Latent Flow Matching for Speculative Decoding](https://refivu.com/papers/93c02290-232b-4fea-be96-dcb416a7416b-chainflow-few-step-latent-flow-matching-for-speculative.md)
- [Functional Dependency beyond Similarity: Hierarchical Decomposition of Training Data Attribution in Music Generative Models](https://refivu.com/papers/ae97ff2b-7044-477b-b620-e8d4984e7fc8-functional-dependency-beyond-similarity-hierarchical.md)
- [VESPER: Online Learning of Free Energies with a Multi-Tempered Variational Objective](https://refivu.com/papers/04cc6b0b-2813-4236-aec2-26ed4e60479a-vesper-online-learning-of-free-energies-with-a.md)
- [Not All Layers Are Equal in Image-to-Video Transfer](https://refivu.com/papers/c4eb2a03-2ada-4c45-9874-7cf852b35737-not-all-layers-are-equal-in-image-to.md)
- [When Self-Consistency Hurts: The Hidden Cost of Majority Voting in Small Language Models](https://refivu.com/papers/8b81d672-60fe-46ec-bd1b-b3bd76e21ceb-when-self-consistency-hurts-the-hidden-cost-of.md)
- [Horizon-Scalable Q-Learning](https://refivu.com/papers/7423413a-b61a-4919-884f-a61103a7ae8f-horizon-scalable-q-learning.md)
- [Slim Foundation Models for Latency-Critical Recommendation Serving](https://refivu.com/papers/34517bd8-2896-4eca-b991-f6fad30318ef-slim-foundation-models-for-latency-critical-recommendation.md)
- [PIA: Agentic Physics-Informed Runtime Anomaly Detection](https://refivu.com/papers/9759ea5e-4edd-4749-bb03-45759285d767-pia-agentic-physics-informed-runtime-anomaly-detection.md)
- [GradReason: LLMs as Meta-Learners that Replace Training Epochs with Training-Data-Free Weight Updates](https://refivu.com/papers/256ec645-cf61-4699-8fbc-03d5adc197dc-gradreason-llms-as-meta-learners-that-replace-training.md)

---

AI 해설에는 오류가 있을 수 있습니다. [Refivu](https://refivu.com/papers/ad8a6dcb-d3ec-4ca8-a949-049aee235a40-do-benign-trained-hidden-state-probes-detect-tool)
