Manuscript Offprint

arXiv:2608.29564

TACS: Trajectory-Aware Candidate Selection for LLM Jailbreak Suffix Optimization

Shiliang Xiao

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Shiliang Xiao

slxiao@mail.gdufs.edu.cn

Abstract. Gradient-based jailbreak suffix optimization methods typically update the suffix by retaining the candidate with the lowest current loss. We show that this seemingly natural design is fundamentally myopic: candidates that look better under the current-step proxy often fail to produce better jailbreak outcomes later in the search, revealing a form of selection-stage reward hacking. This suggests that candidate selection, rather than candidate generation alone, is a hidden bottleneck in suffix optimization. To address this issue, we propose TACS, a trajectory-aware candidate selection framework for jailbreak suffix optimization. Instead of selecting candidates solely by their immediate loss, TACS augments per-step evaluation with a trajectory-aware proxy and stabilizes selection with reference-policy regularization and a discriminator-estimated chi-squared correction, encouraging choices that remain effective beyond the current step. Experiments on HarmBench show that TACS consistently outperforms strong baselines under the same search budget, substantially improving attack success rates while exhibiting more stable optimization behavior throughout the search. Our findings highlight that mitigating selection-stage reward hacking caused by myopic candidate selection is critical for improving jailbreak suffix optimization.

Keywords: Large Language Models · Jailbreak Attacks · Gradient-based Suffix Optimization · Reward Hacking · Candidate Selection

1 Introduction

In recent years, large language models (LLMs) have rapidly advanced across a wide range of tasks, yet safety-aligned LLMs remain vulnerable to jailbreak attacks. Studying such attacks is important because they provide a practical testbed for auditing and stress-testing alignment mechanisms, helping reveal where safety training fails under adversarial optimization pressure. Existing jailbreak methods attempt to bypass model safeguards through malicious inputs, including gradient-based optimization, heuristic-based algorithms, and rewriting-based approaches. Among these paradigms, gradient-based optimization stands out as an effective white-box setting because it directly maximizes the probability of generating malicious content, making optimization-level failure modes especially visible. In particular, gradient-based suffix optimization, as exemplified by GCG [15], has become a representative setting for studying how aligned LLMs can still be driven toward unsafe behavior under direct optimization pressure.

S. Xiao

Figure

Fig. 1: Optimization trajectory of standard loss-based candidate selection in GCG. Although the training loss decreases steadily, ASR remains low for much of the search and improves only in delayed, irregular bursts, revealing a clear mismatch between the current-step proxy and the final jailbreak outcome.

Although jailbreak attacks have advanced rapidly, prior work has focused mainly on improving attack strength. Much less attention has been paid to a more fundamental question: whether the signal steering the search is itself reliable. This concern is not unique to jailbreak. In RLHF, recent research has increasingly focused on preference optimization, which aims to align language models with human preferences by optimizing preference signals more directly and efficiently. Yet this line of work has also exposed a well-known failure mode: More aggressive proxy optimization can fail to improve the true objective and instead overfit imperfections in the proxy signal. A similar risk may arise in jailbreak suffix optimization, where the selector must repeatedly convert a local proxy score into an actual search decision. This phenomenon is commonly referred to as reward hacking.

Motivated by the research above, a natural question arises: does reward hacking also emerge in gradient-based suffix optimization for jailbreak attacks? To answer this question, we revisit the optimization trajectory of standard loss-based suffix search. As shown in Figure 1, the training loss decreases steadily throughout optimization, while the attack success rate (ASR) remains low for a long stretch and improves only in delayed, irregular bursts. This reveals a clear loss–ASR mismatch: a candidate that appears better under the current-step proxy is often not the candidate that leads to a better downstream jailbreak outcome.

This mismatch points to a previously underexplored bottleneck in jailbreak suffix optimization: the search is ultimately governed by a myopic candidate selector. In existing methods, each step typically retains the candidate with the lowest current loss, which introduces two coupled problems: (1) it overemphasizes immediate proxy gains at the expense of downstream search utility; and (2) it gradually steers the trajectory toward locally attractive but globally suboptimal updates. To address this issue, we propose TACS, a trajectory-aware candidate selection framework for jailbreak suffix optimization. By incorporating trajectory-aware and reference-regularized signals into candidate selection, TACS favors candidates that remain beneficial for subsequent optimization rather than merely appearing optimal at the current step. Experiments on HarmBench show that TACS improves average ASR by nearly 10%.

Our contributions are summarized as follows:

– We identify selection-stage reward hacking in jailbreak suffix optimization, showing that standard loss-based candidate selection can overfit short-horizon proxy improvement and induce a pronounced loss–ASR mismatch during search.

– We propose TACS, a trajectory-aware, reference-regularized candidate selection framework that directly mitigates selection-stage reward hacking in jail-break suffix optimization.

– Experiments on HarmBench show that TACS consistently outperforms strong baselines under the same search budget, yielding stronger jailbreak performance and more stable optimization trajectories.

References (15)

  • Play guessing game with LLM: indirect jailbreak attack with implicit clues
  • Jailbreaking black box large language models in twenty queries
  • MASTERKEY: automated jailbreaking of large language model chatbots
  • Efficient LLM jailbreak via adaptive dense-to-sparse constrained optimization
  • Improved techniques for optimization-based jailbreaking on large language models
  • Correlated proxies: A new definition and improved mitigation for reward hacking
  • Autodanturbo: A lifelong agent for strategy self-exploration to jailbreak llms
  • AutoDAN: Generating stealthy jailbreak prompts on aligned large language models
  • Harmbench: A standardized evaluation framework for automated red teaming and robust refusal
  • Tree of attacks: Jailbreaking black-box LLMs automatically
  • Advprompter: Fast adaptive adversarial prompting for LLMs
  • Attngcg: Enhancing jailbreaking attacks on llms with attention manipulation
  • Foot-in-the-door: A multi-turn jailbreak for llms
  • Guiding not forcing: Enhancing the transferability of jailbreaking attacks on llms via removing superfluous constraints
  • Universal and Transferable Adversarial Attacks on Aligned Language Models