디코딩 과정 중 안전 의식을 고려한 탐색을 통한 대규모 언어 모델의 탈옥 공격 방어
Defending Large Language Models Against Jailbreak Attacks via In-Decoding Safety-Awareness Probing
대규모 언어 모델(LLM)은 자연어 처리 작업에서 뛰어난 성능을 보이며, 실제 응용 분야에서 점점 더 많이 사용되고 있습니다. 광범위한 안전 정렬 노력이 있었음에도 불구하고, 최근 연구에서는 이러한 정렬이 종종 피상적이며 탈옥 공격에 취약하다는 사실이 밝혀졌습니다. 기존의 방어 메커니즘, 즉 디코딩 기반 제약 조건 및 사후 콘텐츠 탐지기는 정교한 탈옥 공격에 취약하며, 강력한 탐지를 어렵게 하거나 모델의 유용성을 지나치게 저하시키는 경우가 많습니다. 본 연구에서는 LLM의 디코딩 과정을 분석하고, 중요한 관찰 결과를 얻었습니다. 즉, 모델이 성공적으로 탈옥당하더라도, 생성 과정에서 잠재적인 안전 관련 신호가 내부적으로 나타납니다. 그러나 이러한 신호는 모델의 유창한 문장 생성 욕구에 의해 억제되어, 적절한 시점에 자체 수정이나 거부 반응이 일어나지 못합니다. 이러한 관찰을 바탕으로, 우리는 잠재적인 안전 신호를 명시적으로 드러내고 활용하여 디코딩 과정에서 안전하지 않은 콘텐츠를 조기에 탐지하는 간단하면서도 효과적인 방법을 제안합니다. 다양한 탈옥 공격에 대한 실험 결과, 제안하는 방법은 안전성을 크게 향상시키면서도, 무해한 입력에 대한 과도한 거부율을 낮추고 응답 품질을 유지함을 보여줍니다. 우리의 결과는 디코딩 과정에서 내재적인 안전 의식을 활성화하는 것이 탈옥 공격에 대한 방어라는 유망하고 보완적인 방향을 제시한다는 것을 시사합니다. 코드: https://github.com/zyz13590/SafeProbing
Large language models (LLMs) have achieved impressive performance across natural language tasks and are increasingly deployed in real-world applications. Despite extensive safety alignment efforts, recent studies show that such alignment is often shallow and remains vulnerable to jailbreak attacks. Existing defense mechanisms, including decoding-based constraints and post-hoc content detectors, struggle against sophisticated jailbreaks, often intervening robust detection or excessively degrading model utility. In this work, we examine the decoding process of LLMs and make a key observation: even when successfully jailbroken, models internally exhibit latent safety-related signals during generation. However, these signals are overridden by the model's drive for fluent continuation, preventing timely self-correction or refusal. Building on this observation, we propose a simple yet effective approach that explicitly surfaces and leverages these latent safety signals for early detection of unsafe content during decoding. Experiments across diverse jailbreak attacks demonstrate that our approach significantly enhances safety, while maintaining low over-refusal rates on benign inputs and preserving response quality. Our results suggest that activating intrinsic safety-awareness during decoding offers a promising and complementary direction for defending against jailbreak attacks. Code is available at: https://github.com/zyz13590/SafeProbing.
No Analysis Report Yet
This paper hasn't been analyzed by Gemini yet.