GradSentry: Gradient Spectral Entropy for Backdoor Sample Filtering in Large Language Model Fine-Tuning

arXiv:2605.26574 · 2026-05-28 공개 · arXiv · PDF

llm fine-tuning parameter-efficient lora spectral-entropy backdoor-attacks backdoor-detection sample-filtering

Abstract

Fine-tuning Large Language Models with untrusted data exposes models to backdoor attacks, where poisoned samples cause targeted misbehavior. Existing sample-filtering defenses rely on clustering, which requires sufficient data and can fail at extreme poison ratios. We propose GradSentry ({Grad}ient {Sentry}), a backdoor sample filtering method based on the spectral entropy of per-sample gradients. Our key finding is that poisoned samples produce gradients with higher spectral entropy compared to clean samples. GradSentry captures output-altering backdoor signatures using per-sample gradient spectra, avoiding pairwise sample comparisons and clustering during feature construction. Importantly, our method is training-agnostic: it works for both parameter-efficient fine-tuning methods like LoRA and full-parameter tuning, as the gradient analysis operates independently of which parameters are being updated during training. GradSentry requires no clustering, operates effectively across all poison ratios (1%--90%), and introduces minimal computational overhead (20-50ms per sample for 7B model). Evaluation on four QA datasets and four attack types demonstrates the effectiveness of spectral entropy for backdoor detection. Code is available at https://github.com/dongdongzhaoUP/GradSentry.

한국어 요약

📋 한 줄 요약

**[Backdoor Defense / LLM Fine-Tuning]** GradSentry가 per-sample gradient의 spectral entropy로 poisoned 샘플을 필터링 — 클러스터링 없이 1~90% poison ratio 전 영역에서 작동, LoRA·full-tuning 모두 호환·7B 모델에서 20~50ms/sample overhead.

🎯 핵심 기여도

💡 핵심 아이디어

Backdoor 샘플 탐지는 데이터 분포 clustering이 아니라 per-sample gradient의 spectral entropy라는 model-internal 신호로 가능하며, 이는 어떤 parameter가 업데이트되는지와 독립적이어서 LoRA·full-tuning 모두에 training-agnostic으로 적용된다.

🔬 기술적 접근법

📊 주요 결과

💭 의의 및 한계

**의의**: LLM fine-tuning의 backdoor defense에 clustering-free·training-agnostic 신호 도입, extreme poison ratio까지 robust, parameter-efficient·full-tuning 양 환경 호환의 실용성. **한계**: gradient 계산 필요로 train-time defense에 한정, spectral entropy threshold의 도메인 의존성, 새로운 stealthy attack에 대한 robustness는 후속 검증.

🚀 실용적 활용