arXiv:2610.05282cs.CLOct 2026

Manuscript Offprint

arXiv:2610.05282

Red-TTT: Test-Time Training for Automated Jailbreaking Large Language Models

Tongyan Hu, Hao Li, Xiaogeng Liu, Ruida Wang, Zhengyu Liu, Shuyao Xu, Ning Zhang, Ziyang Li, Yinzhi Cao, Bryan Hooi, Chaowei Xiao

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

ABSTRACT

Large language models remain vulnerable to jailbreaks, and automated red teaming is the standard way to find jailbreaks in large language models at scale. Current methods either draw more samples at test time through search, rewriting, and tree expansion, or train a stronger attacker offline with reinforcement learning. Both share a limitation: once an attack on a specific target behavior begins, the attacker's weights are frozen. Any signal it gathers about the behavior stays in its context window and is discarded afterward. The attacker never adapts its proposal distribution mid-attack, so success depends almost entirely on the sampling budget, and under a budget affordable at scale, many behaviors remain unbroken. We propose Red-TTT, which updates the attacker's parameters during the attack on each behavior. At each round, the attacker samples a group of candidates, scores them against the victim's replies, and takes a policy-gradient step before drawing the next group, so what it discovers about the current victim is consolidated into weights rather than accumulated as context. We also adapt the training objective to red teaming, where success is judged by the single best sample rather than the average. Red-TTT requires only sampling access to the victim and integrates into existing attack pipelines with no other changes. Against the Best-of-N baseline, Red-TTT raises attack success rate from 55.9% to 72.4% on average at a budget of 120 samples, improving over the baseline in every configuration and cracking many behaviors previous method cannot. The code is available at https://github.com/SaFoLab/Red-TTT

1 INTRODUCTION

As Large Language Models (LLMs) are deployed in increasingly open-ended settings, identifying their safety failures becomes increasingly important. Red teaming plays a central role in this process by exposing vulnerabilities that can inform stronger defenses. In particular, automated red teaming seeks to discover jailbreak prompts that induce aligned models to generate responses they would otherwise refuse (Lv et al., 2024; Jiang et al., 2024; Liu et al., 2024; Zhu et al., 2023; Chao et al., 2023; Mehrotra et al., 2023; Ding et al., 2024; Yu et al., 2023; Zou et al., 2023; Qi et al., 2024; Ziakas et al., 2026; Samvelyan et al., 2024; Andriushchenko & Flammarion, 2025; Liu et al., 2025a; Rahman et al., 2025; Ren et al., 2025; Ha et al., 2025; Russinovich et al., 2025). Improving the effectiveness of these attacks is therefore an important step toward more reliable safety evaluation.

Existing automated jailbreak attacks primarily improve their effectiveness through search. Given a target behavior, an attacker generates candidate prompts, evaluates the victim's responses, and uses the resulting feedback to select or refine subsequent candidates through repeated sampling, iterative refinement, tree search, or template-based rewriting (Chao et al., 2023; Mehrotra et al., 2023; Liu et al., 2025b; Ding et al., 2024). In refinement-based methods such as PAIR and TAP, this feedback is consumed in context: previous prompts, responses, and judge scores are placed in the attacker's prompt, and the attacker must infer a better candidate from them (Madaan et al., 2023; Shinn et al., 2023). The attacker's parameters never change, so the benefit of feedback is bounded by what a frozen model can extract from a growing context. Offline training can improve the initial attacker (Guo et al., 2025), but does not adapt its parameters to a specific target behavior during the attack.

A complementary route in the general domain is test-time training, which updates the model's parameters from outcomes on the test instance itself (Yuksekgonul et al., 2026; Akyürek et al., 2024; Zuo et al., 2025). Applying it to red teaming is nontrivial for three reasons. First, there is no verifiable answer: the only signal is the victim's response, and a binary success judgment is almost always zero on hard behaviors, leaving policy updates with no advantage to learn from. Second, the objective is best-case rather than average-case, since an attack succeeds if any single candidate does, so improving the mean reward need not surface the rare successful prompt. Third, test-time training is expensive: TTT-Discover uses 25600 rollouts per problem, whereas a red-teaming attack must adapt within the same small budget it spends on search.

In this work, we introduce RED-TTT, a test-time training method for automated jailbreaking that uses attack feedback to update the attacker itself rather than only to guide prompt selection. For each target behavior, RED-TTT starts from the original attacker and iteratively generates groups of candidates, scores them against the victim, and updates a lightweight LoRA adapter with a critic-free group-relative policy gradient. Each design choice addresses one of the challenges above. To obtain a usable signal without reference outputs, RED-TTT scores responses with a dense multi-dimensional rubric gated by relevance to the target behavior, so that partial compliance still produces nonzero advantages. To target best-case success, it uses a risk-seeking advantage estimator that concentrates the update on the highest-scoring candidates, together with an elite replay buffer that retains the strongest prompts found so far. To stay within budget and remain behavior-specific, the adapter is reset for every behavior–victim pair and all updates are paid for from the same pool of attacker generations used for search.

To evaluate whether test-time adaptation provides benefits beyond additional sampling, we compare RED-TTT against a budget-matched BEST-OF-N baseline that starts from the same attacker and uses the same number of attacker generations, but never updates the attacker. We evaluate on HarmBench (Mazeika et al., 2024) against four victim models. RED-TTT reaches 72.4% ASR on average, compared with 55.9% for the budget-matched baseline, and improves over it in every configuration. Since RED-TTT updates only the attacker and leaves the search procedure unchanged, it improves ASR across all three substrates, including the offline-trained JB-R1.

Our contributions are twofold:

• Test-time adaptation for automated red teaming. We introduce RED-TTT, a method that uses feedback from attempted jailbreaks to update the attacker during the attack. By adapting a lightweight adapter separately for each target behavior, RED-TTT enables behavior-specific learning without modifying the original attacker. The method can be integrated into existing automated jailbreak frameworks without changing their underlying search topology.

• Evaluating adaptation beyond additional sampling. We compare RED-TTT with frozen-attacker baselines under matched budgets. Our results show that test-time adaptation improves attack success over fixed-policy search, including when the initial attacker has already undergone offline jailbreak training.

References (1)