- Rating
- 4
- Clarity
- 3
- Confidence
- 4
- Originality
- 3
- Quality
- 3
- Significance
- 3
Read review
Summary
This paper proposes a novel test-time, gradient-guided safety calibration method. It shifts input embeddings toward high-density regions where the model exhibits stronger safety alignment, thereby enabling the detection of harmful prompts. To achieve this shift, the method employs a top-k gradient-based update strategy and a masking-based gradient loss calculation for guidance. Experiments demonstrate the method's effectiveness compared to similar smoothing-based approaches.
Strengths and weaknesses
Strengths
- High novelty. This work systematically and quantitatively formalizes the reasons behind successful jailbreaks and proposes the hypothesis that safety alignment is concentrated in high-density regions. The mathematical formulations are rigorous yet concise, setting this paper apart from, and above most existing research on jailbreaking.
- Comprehensive experiments. The paper provides experimental results demonstrating the method's effectiveness.
- Clear logical flow and high readability.
Weaknesses:
-
The reasons behind the defense effectiveness appear mixed and somewhat confusing. The authors' main selling point is that jailbreaks succeed because harmful requests wrapped in prompts do not fall into the high‑density region seen during the LLM's training phase, resulting in weak defense. Their solution is to use the LLM’s normal output range as a loss, compute the gradient direction, and guide the embeddings into high‑density regions. But this directly alters the semantics of input. And, the connection to the noise perturbation used in smoothing is not clearly established, and the experimental results actually show that smaller perturbations work better. If there is no noise perturbation, does the attack still remain effective? I hope the authors can supplement relevant experiments. Moreover, I think this only resembles Langevin dynamics in mathematical form; essentially, the two parameters here are decoupled, and both seem to require careful tuning.
-
I notice that the defense baselines are mainly smoothing‑based methods. The proposed method already exploits gradient information and uses more computational resources, so its superior performance is expected. In appendix, Llama Guard’s defense capability is not state‑of‑the‑art, and SafeDecoding is not the latest work. On the one hand, an evaluation of computational cost is needed. on the other hand, comparisons with more recent work are required. (e.g., [1], and the SafeProbing[1] has better defense performance on Qwen model for AutoDAN attack, in Tab. 1. So I suppose method in this paper is not SOTA, but it's okay considering the overall contribution) In the appendix, as I understand it, the pipeline and parallel approaches essentially trade space for time, so significant computational overhead still exists. Moreover, if the input prompt is very long (common in current SOTA prompt-based jailbreak attacks), the token length is directly related to this paper's computational needs, because this paper applies token-level gradient guiding. Different from GCG, which optimize only the suffix (fixed positions, short token length), this paper 'optimize' the whole input, therfore introducing heavy and uncontrolled computing budget. So is it practical to deploy? The paper acknowledges that this method is more effective for models with stronger safety capabilities, as it essentially guides inputs into the model’s detectable safe zone and thereby produces effective refusals. Hence, this work has issues regarding computational cost and generalization (e.g., can you add results on Mistral, which is a common model for jailbreak task?).
-
Has the method really guided the inputs into high‑density regions? Could the authors plot a density trajectory, for example, the change in perplexity (PPL) during the smoothing process? This would more directly support the motivation of the work.
-
There are some issues with the 'surrogate' used for the first loss . The process from token to embedding is nonlinear, so going from embedding back to token is not an invertible transformation. Furthermore, although these are autoregressive models, the proposed method transforms the objective into a paradigm similar to BERT’s masked‑based language model, used to optimize token embeddings at each position. I would therefore like to see the defense results when optimizing the gradients from the two losses separately. In addition, is Gauss‑Southwell essentially the same as the top‑k token position concept in GCG, and what is the difference?
I understand that I have raised many questions. Therefore, as long as the authors can provide reasonable explanations with appropriate experiment results, I am willing to raise my score.
References:
[1] Zhao, Yinzhi, Ming Wang, Shi Feng, Xiaocui Yang, Daling Wang, and Yifei Zhang. "Defending Large Language Models Against Jailbreak Attacks via In-Decoding Safety-Awareness Probing." arXiv preprint arXiv:2601.10543 (2026).
Questions
See weaknesses. I am willing to raise the score if the authors solve my concerns.
Limitations
yes
Paper formatting concerns
NAN
Final justification
Some of the concerns have been resolved, I raise the score to 4.
We sincerely thank the reviewer for the detailed and constructive feedback.
Before addressing the individual concerns, we would like to clarify two central aspects of our work:
Our central hypothesis is not that high-density inputs are necessarily safe. Rather, the base model's existing safety behavior is generally more reliable in better-modeled regions, where the model can more consistently recognize harmful intent and activate the safety knowledge acquired during alignment. Density is therefore used as a perturbation-guidance signal, not as a harmfulness criterion or rejection threshold.
The gradient update is deliberately small and sparse. It does not guarantee mathematically identical semantics, but explicitly limits semantic drift through the Gauss–Southwell rule and a small update scale. Appendix G.1 and Table 14 provide direct empirical evidence: after five iterations, more than 99.8% of perturbed embeddings still decode to the original tokens. Thus, the method modifies the continuous representation locally rather than rewriting the instruction.
Noise and gradient guidance serve complementary roles:
We agree that the role of noise can be shown more directly. We therefore add a σ=0 ablation:
Without noise, the perturbation trajectory becomes deterministic given the same initialization, reducing the benefit of multiple smoothing trials.
We agree that Eq. (5) has the mathematical form of Langevin dynamics, as explicitly stated in Line 135. We do not claim to introduce Langevin dynamics itself. The method contribution is its LLM-specific realization through: (a) context-aware input-density modeling, (b) continuous embedding perturbations with frozen model parameters, (c) sparse Gauss–Southwell updates for semantic preservation, and (d) its application to stabilizing existing safety behavior.
The noise scale σ and update speed η are separately controlled parameters, and Tables 2–3 provide sensitivity analyses for both. Excessive noise damages semantic fidelity and utility, while an overly large gradient step can overshoot the useful local neighborhood. This explains why a small nonzero noise scale and a moderate update speed perform best.
The main experiments focus on smoothing-based defenses to enable a controlled comparison under the same backbone models, attacks, metrics, and trial budget. Since our contribution is specifically to replace unguided smoothing with density-guided smoothing, these baselines isolate the benefit of gradient guidance.
We do not claim universal SOTA performance over all safety-defense paradigms. GradientSmooth addresses a narrower problem: stabilizing safety behavior that the base model has already learned. It cannot create a reliable refusal capability when the model itself fails to recognize or act upon deeply embedded harmful intent. In such cases, alignment (such as SafeProbing), safety training, decoding-time intervention, or classifier-based filtering may be more effective. These approaches are complementary in terms of both effective range and operation stage: (a) safety-alignment methods strengthen the model’s safety capability, whereas GradientSmooth perturbs only the user-input representation to stabilize existing safety behavior. (b) Safe enhancement methods modify the model itself, including parameters, system prompts, etc., while smoothing perturbs user input without affecting the model. Table 4 and 9 further support that GradientSmooth can be directly deployed on models enhanced by these methods.
We agree that GradientSmooth introduces more computation, and that parallel execution reduces wall-clock latency rather than aggregate compute, as explicitly reported in Table 6. Extremely long prompts remain an efficiency limitation, and we will revise the manuscript to avoid implying complete independence from input length. Fortunately, for wall-clock latency, the forward or backward calculations are parallelized on input tokens. For additional trainable-state and optimizer-memory overhead, all model parameters are fixed and only embedding-level perturbation variables gather gradients.
We want to clarify that we do not claim universal generalization. Our experiments currently cover Llama3.1, Qwen2.5 at two model scales, Qwen3 with and without reasoning, and LlamaGuard-based safety classifiers, where we have demonstrated and analyzed effective and failure situations in Sections 3, B, and E, and discussed our effective range in Limitations. We provide additional experiments on Mistral as the reviewer recommended:
The results show that Mistral, which only underwent early safe training, failed to form reliable safe boundaries and even regenerated harmful content after rejection. This suggests that Mistral does not exhibit sufficiently reliable existing safety behavior under these attacks for smoothing to recover. The result further supports our scope claim: GradientSmooth is strongly dependent on the safety capability already present in the underlying model and should be viewed as complementary to alignment or external safety enhancement rather than as a general-purpose standalone defense.
Appendix G.1 and Table 15 have provided the requested trajectory-level density analysis. As the number of gradient-guided perturbation steps increases, both autoregressive NLL and SoftNLL generally decrease on GCG, PAIR, and benign AlpacaEval inputs. The trend is particularly clear for SoftNLL, indicating that the perturbed continuous representations become more compatible with the model-assigned contextual distribution rather than merely optimizing individual hard token predictions. Table 14 simultaneously shows that token recovery and representation similarity remain high, indicating that the density increase is achieved through small local perturbations. Table 16 further shows that refusal probability progressively increases across iterations on adversarial inputs, while remaining low and stable on benign inputs. We agree that these results directly support the central motivation and should be more visible. We will move a density-trajectory visualization and its discussion from the appendix into the main paper.
We agree that the token-to-embedding mapping is not theoretically invertible, because we use the dot product rather than cosine similarity in Line 166 and approximate the token distribution with softmax, not argmax. Fortunately, our method does not require or assume an inverse transformation, because we just need a continuous relaxation to provide an approximate local guidance toward higher density rather than to recover a mathematically unique discrete token. In addition, Table 14, not intended to prove invertibility, empirically verifies that the learned perturbations remain sufficiently local: more than 99.8% of perturbed embeddings decode to their original tokens under the evaluated configuration.
We add the separate ablations on the two losses as recommended:
Lp aligns the active embedding with what the model predicts from the preceding context, which may serve as a semantic fluency protection mechanism with autoregressive constraints. Ls preserves compatibility with the subsequent context and contributes stronger safety improvements, but using it alone results in larger utility degradation. Their combination provides the best overall safety–utility balance.
Gauss–Southwell and GCG both use gradient information to prioritize coordinates, but their objectives, update variables, and purposes are different.
Therefore, the similarity is limited to the use of gradient information. GCG optimizes adversarial tokens toward a specific unsafe target, whereas GradientSmooth optimizes for no target response but increasing input density and preserving consistency.