TrajGuard: 디코딩 단계에서의 탈옥 방어를 위한 스트리밍 기반 잠재 상태 궤적 탐지
TrajGuard: Streaming Hidden-state Trajectory Detection for Decoding-time Jailbreak Defense
기존의 탈옥 방어 방식은 주로 프롬프트, 출력 또는 내부 상태를 정적으로 탐지하는 데 의존하며, 디코딩 과정에서의 위험 변화를 간과하는 경우가 많습니다. 이러한 간과로 인해 디코딩 궤적에 내재된 위험 신호가 활용되지 못하고 있으며, 이는 현재 방어 시스템의 중요한 약점입니다. 본 연구에서는 실험적으로 입증된 바와 같이, 디코딩 단계에서 중요한 레이어의 잠재 상태가 입력된 탈옥 프롬프트보다 더 강력하고 안정적인 위험 신호를 포함하고 있음을 확인했습니다. 특히, 탈옥 시도 중에 생성된 토큰의 잠재 표현은 점진적으로 잠재 공간 내의 고위험 영역으로 이동합니다. 이러한 관찰을 바탕으로, 학습이 필요 없는 디코딩 단계 방어 프레임워크인 TrajGuard를 제안합니다. TrajGuard는 슬라이딩 윈도우를 사용하여 잠재 상태 궤적을 집계하고 실시간으로 위험을 측정하며, 특정 지역 내의 위험이 지속적으로 설정된 임계값을 초과할 때만 가벼운 의미 분석을 수행합니다. 이러한 메커니즘은 후속 디코딩을 즉시 중단하거나 제한할 수 있도록 합니다. 12가지의 다양한 탈옥 공격 및 여러 공개 LLM에 대한 광범위한 실험 결과, TrajGuard는 평균 95%의 방어율을 달성했습니다. 또한, 오탐율을 1.5% 미만으로 유지하면서 탐지 지연 시간을 5.2ms/토큰으로 줄였습니다. 이러한 결과는 디코딩 과정에서의 잠재 상태 궤적이 실시간 탈옥 탐지에 효과적으로 기여할 수 있음을 보여주며, 모델 수정 없이 방어를 구현할 수 있는 유망한 방향을 제시합니다.
Existing jailbreak defense paradigms primarily rely on static detection of prompts, outputs, or internal states, often neglecting the dynamic evolution of risk during decoding. This oversight leaves risk signals embedded in decoding trajectories underutilized, constituting a critical blind spot in current defense systems. In this work, we empirically demonstrate that hidden states in critical layers during the decoding phase carry stronger and more stable risk signals than input jailbreak prompts. Specifically, the hidden representations of tokens generated during jailbreak attempts progressively approach high-risk regions in the latent space. Based on this observation, we propose TrajGuard, a training-free, decoding-time defense framework. TrajGuard aggregates hidden-state trajectories via a sliding window to quantify risk in real time, triggering a lightweight semantic adjudication only when risk within a local window persistently exceeds a threshold. This mechanism enables the immediate interruption or constraint of subsequent decoding. Extensive experiments across 12 jailbreak attacks and various open-source LLMs show that TrajGuard achieves an average defense rate of 95%. Furthermore, it reduces detection latency to 5.2 ms/token while maintaining a false positive rate below 1.5%. These results confirm that hidden-state trajectories during decoding can effectively support real-time jailbreak detection, highlighting a promising direction for defenses without model modification.
No Analysis Report Yet
This paper hasn't been analyzed by Gemini yet.
Log in to request an AI analysis.