TRACE: Trajectory-Based Safety Patch Learning for LLM Post-Training Realignment
Changyue LiJiaming HeYouliang YuanJialin WuBYBoxi YuZhicong Huang
Pinjia He Changyue Li
Jiaming He
Youliang Yuan
Jialin Wu
BYBoxi Yu
Zhicong Huang

Pinjia He
+7
TRACE learns a single safety patch during an offline stage by simulating harmful supervised fine-tuning (SFT) trajectories and optimizing the patch across progressively corrupted model states. At inference, this patch is applied to any user's fine-tuned checkpoint without per-user calibration. Experiments across two models, three harmful SFT datasets, and three utility benchmarks show that TRACE dominates the safety-utility frontier, improving safety rate by up to 77 percentage points over baselines while retaining task performance comparable to the undefended model.

arXiv ·
· June 26, 2026