Manuscript Offprint

arXiv:2610.01323

TRACE: Trajectory Return Attribution and Contrastive Erasure for Multi-Turn Safety

Fengpeng Li, Kemou Li, Qizhou Wang, Haiwei Wu, Jiantao Zhou, Di Wang

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

ABSTRACT

Safety-aligned large language models (LLMs) often refuse a harmful request but comply once the same goal is spread over several turns. Preference objectives score whole responses to single prompts, so their training loss alone cannot control risk on unseen histories. Our analysis gives sufficient conditions under which suppression at supervised single-turn contexts yields a bound on multi-turn trajectory risk. The bound accounts for coverage, transfer slack, and leakage, and characterizes contraction relative to a base-policy risk budget evaluated on the trained policy's contexts. TRACE (Trajectory Return Attribution and Contrastive Erasure) turns this principle into a token-level objective. On the safe response, each token is weighted by the discounted return of a refusal-attributable advantage. The advantage compares a frozen reference model with its refusal-ablated copy, allowing earlier response tokens to receive credit from later refusal-related evidence. At high-gap positions on rejected responses, TRACE combines the observed token with policy-selected alternatives in the erasure target. A gradient-norm penalty replaces the retain set. Across five open-weight models and seven multi-turn attacks, TRACE gives the lowest attack success rate (ASR) in all 35 model and attack pairs, while the model utility evaluated on MMLU and HellaSwag drop by at most 1.23 points. Source code can be found in the supplemental material.

1 INTRODUCTION

Interactive LLMs must remain safe over histories shaped by both user queries and their own replies. Common post-training objectives instead score complete responses under fixed contexts, including RLHF (Ouyang et al., 2022), response-level preference optimization (Rafailov et al., 2023; Azar et al., 2024; Ethayarajh et al., 2024; Hong et al., 2024; Meng et al., 2024) and SafeDPO (Kim et al., 2025). Token-weighted methods such as W-DOOR (Zhao et al., 2025) refine supervision within a response. Multi-turn adversaries exploit

Figure

Figure 1: Aligned LLMs resist single-turn attacks yet remain vulnerable to multi-turn ones.

the changing context: they open with benign exchanges and progressively elicit harmful assistance, sometimes reusing the model's outputs in later prompts (Russinovich et al., 2025; Zhou & Arel, 2025; Li et al., 2024; Ren et al., 2024; Cao et al., 2025; Song et al., 2026). We call the resulting failure of safety across interaction histories trajectory fragility. Multi-turn training covers the strategies represented in its dialogues; retain-set losses against the alignment tax (Huang et al., 2025; Niu et al., 2025; Zhao et al., 2026b) likewise depend on their benign examples (Zhang et al., 2024; Zhao et al., 2025; Chang & Lee, 2025; Slocum et al., 2025). Both raise the question of how supervision extends to unseen contexts and behaviours. More information about related work is in Appendix B.

∗^{*}Corresponding author: Di Wang (di.wang@kaust.edu.sa)

We study how to improve multi-turn safety using single-turn supervision. Different attack histories can lead to similar harmful answers (Russinovich et al., 2025; Ren et al., 2024; Yang et al., 2025). Our training data pair each harmful request with a preferred safe response and a rejected response. The challenge is to allocate supervision within each response. On the preferred branch, refusal-related evidence may be strongest after the response has begun, so an immediate token score can underweight earlier tokens. On the rejected branch, suppressing a whole response can penalize benign text while leaving likely harmful alternatives available. We therefore aggregate continuation evidence on the preferred branch and localize suppression on the rejected branch.

Following this path, we propose TRACE, supervising single-turn preference tuples at the token level through two terms. On the preferred branch, immediate token-level contrasts do not account for evidence appearing later in the continuation. Trajectory-aware adaptive weighting (TAW) aggregates reference-ablated log-probability contrasts from each token onward into a discounted return, allowing later refusal-related evidence to contribute to earlier token weights. On the rejected branch, risk-localized proxy erasure (RLPE) selects positions with the largest reference-normalized log-probability gaps. At each selected position, it constructs an erasure target combining the observed rejected token with high-probability alternatives under the current policy. A gradient-norm penalty regularizes the alignment objective using the same preference batch, without an additional retain dataset. Across various experiments with five LLM models against seven multi-turn attack methods, TRACE is more robust to multi-turn attacks and degrades utility less.

Our contributions are summarized as fourfold:

• We formalize trajectory fragility: response-level objectives cannot by themselves bound the risk a dialogue accumulates, however large their margins.

• We derive a conditional trajectory-risk bound that relates local suppression at supervised single-turn contexts to multi-turn risk through coverage, transfer slack, and leakage.

• We constructively show that discounted returns, unlike shared non-decreasing transformations of immediate advantages, can rank an earlier token above a later one with greater immediate advantage. We also explicitly bound the within-response token-weight ratio.

• On five models from 1B to 27B and seven multi-turn attacks, TRACE gives the lowest ASR in all 35 model and attack pairs. Compared with previous methods, it lowers the mean multi-turn ASR from 52.81% to 28.98%, and MMLU and HellaSwag drop by at most 1.23 points.

Notation. πθ\pi_{\theta} is the trainable policy and πref=πbase=πθ0\pi_{\text{ref}} = \pi_{\text{base}} = \pi_{\theta_0} the frozen initial checkpoint, also the pre-alignment policy in the theory. πabl\pi_{\text{abl}} ablates its refusal direction; πnew\pi_{\text{new}} is the trained policy. The preference data Dpref={(x,y+,y−)}\mathcal{D}_{\text{pref}} = \{(x, y^+, y^-)\} pair a harmful request xx with a preferred safe response y+y^+ and a rejected response y−y^-. The branches share the request and follow separate response histories, cj±=(x,y<j±)\mathbf{c}_j^\pm = (x, y_{<j}^\pm). Each partial response is the history within its supervised answer. A continuation at position jj starts with the current token and extends to the end of that answer. Table 4 in Appendix A collects the notation with detailed introduction.

References (56)