2605.07990v1 May 08, 2026 cs.CL

언어 모델에서 도구 호출은 선형적으로 읽히고 제어될 수 있다

Tool Calling is Linearly Readable and Steerable in Language Models

Seonglae Cho
Seonglae Cho
Citations: 18
h-index: 3
Zekun Wu
Zekun Wu
Citations: 169
h-index: 7
Adriano S. Koshiyama
Adriano S. Koshiyama
Citations: 218
h-index: 8
María Pérez-Ortiz
María Pérez-Ortiz
Citations: 103
h-index: 3
S. Bulathwela
S. Bulathwela
Citations: 194
h-index: 8
Zekun Wang
Zekun Wang
Citations: 26
h-index: 2
Yufei Yang
Yufei Yang
Citations: 68
h-index: 3

도구 호출 에이전트가 잘못된 도구를 선택할 때, 오류는 실행될 때까지 보이지 않습니다. 예를 들어, 이메일이 잘못 전송되거나 회의에 참석하지 못할 수 있습니다. Gemma 3, Qwen 3, Qwen 2.5, 및 Llama 3.1 (270M에서 27B) 모델 12개를 분석한 결과, 모델 내부에서 선택된 도구의 정보가 선형적으로 읽히고 제어될 수 있다는 것을 확인했습니다. 두 도구의 평균 내부 활성 값 차이를 평균값으로 추가하면, 93-100% (4B+ 모델에서는 93-100%)의 정확도로 모델이 선택하는 도구가 변경됩니다. 또한, autoregressively 생성되는 JSON 인자들은 새로운 도구의 스키마와 일치하므로, 도구 이름만 변경하는 것으로도 충분합니다. 각 도구별 평균값은 잠재적인 오류를 사전에 감지하는 데에도 도움이 됩니다. Gemma 3 12B 및 27B 모델에서, 상위 1개와 상위 2개 도구 간의 간격이 가장 작은 쿼리는, 간격이 가장 큰 쿼리에 비해 14-21배 더 많은 오류를 발생시킵니다. 원인적인 효과는 주로 하나의 방향, 즉 대상 도구의 첫 번째 토큰을 생성하는 출력 레이어의 행에 집중되어 있습니다. 일정한 크기의 단위 벡터를 이 방향으로 적용하는 것만으로도 93-100%의 정확도를 달성할 수 있으며, 나머지 요소는 선택에 거의 영향을 미치지 않습니다. 활성화 값 변경을 통해 이 현상은 중간 및 후반 레이어의 일부 attention heads에 국한된다는 것을 알 수 있습니다. 또한, 14개의 유사한 도메인의 $τ$-bench 항공 도구를 사용한 실험 결과, 5개의 4B-14B 모델에서 상위 1개 도구의 정확도가 61-89%로 나타났으며, 이는 모델이 단순히 특정 주제 축을 따라 움직이는 것이 아니라는 것을 시사합니다. 심지어 기본 모델에서도 도구를 선택하기 전에 올바른 도구를 인코딩합니다. 내부 상태에서 cosine readout를 사용하면 BFCL 데이터셋에서 69-82%의 정확도를 얻을 수 있지만, 기본 생성 모델은 2-10%의 정확도에 그치므로, 사전 훈련이 표현을 형성하고, 이후 instruction tuning이 이를 출력에 연결하는 것으로 보입니다. 본 연구에서는 단일 턴, 고정 메뉴 환경에서 도구 선택 및 JSON 스키마 정확도를 측정했으며, 다중 턴 에이전트 기반 전이는 더 불안정하며, 이는 제한 사항에서 논의됩니다.

Original Abstract

When a tool-calling agent picks the wrong tool, the failure is invisible until execution: the email gets sent, the meeting gets missed. Probing 12 instruction-tuned models across Gemma 3, Qwen 3, Qwen 2.5, and Llama 3.1 (270M to 27B), we find the identity of the chosen tool is linearly readable and steerable inside the model. Adding the mean-difference between two tools' average internal activations switches which tool the model selects at 77-100% accuracy on name-only single-turn prompts (93-100% at 4B+), and the JSON arguments that follow autoregressively match the new tool's schema, so flipping the name is enough. The same per-tool means also flag likely errors before they happen: on Gemma 3 12B and 27B, queries where the gap between the top-1 and top-2 tool is smallest produce 14-21x more wrong calls than queries with the largest gap. The causal effect concentrates along one direction, the row of the output layer that produces the target tool's first token: a unit vector along it at matched magnitude already reaches 93-100%, while what is left over leaves the choice almost untouched. Activation patching localises this to a small set of mid- and late-layer attention heads, and a within-topic probe across 14 same-domain $τ$-bench airline tools reaches top-1 61-89% across five 4B-14B models, ruling out the reading that we are just moving the model along a topic axis. Even base models encode the right tool before they can emit it: cosine readout from the internal state recovers 69-82% on BFCL while base generation reaches only 2-10%, suggesting pretraining forms the representation and instruction tuning later wires it to the output. We measure tool identity selection and JSON schema correctness in single-turn fixed-menu settings; multi-turn agentic transfer is more fragile and is discussed in Limitations.

4 Citations
1 Influential
4 Altmetric
26.0 Score
Original PDF

No Analysis Report Yet

This paper hasn't been analyzed by Gemini yet.

Log in to request an AI analysis.

댓글

댓글을 작성하려면 로그인하세요.

아직 댓글이 없습니다. 첫 번째 댓글을 남겨보세요!