TRACE Improves LLM Safety Post-Fine-Tuning Without Utility Loss

Changyue Li, Jiaming He, Youliang Yuan, Jialin Wu, Boxi Yu, Zhicong Huang, Pinjia He· July 21, 2026 View original

Summary

This research introduces TRACE, a trajectory-based safety patch learning framework that realigns fine-tuned LLMs to safety standards without sacrificing task utility. It addresses the challenge of task-safety update entanglement by optimizing a plug-in patch that minimally interferes with task-relevant directions.

Fine-tuning Large Language Models (LLMs) for specific tasks, often through Fine-Tuning-as-a-Service (FTaaS) platforms, can inadvertently compromise their safety alignment. Service providers face the challenge of restoring safety without re-running full alignment or losing the utility gained from customization. Existing parameter merging methods, which add a "safety patch," often struggle with task-safety update entanglement, where safety and task updates conflict, making calibration difficult. This paper proposes TRACE (Trajectory-Based Safety Patch Learning), shifting the focus from online merging operators to offline patch learning. TRACE aims to find a safety patch that effectively controls unsafe behaviors while minimally interfering with task-relevant directions. It achieves this by simulating harmful tuning trajectories to generate progressively corrupted model states. The framework then optimizes a plug-in patch designed to recover safety and maintain utility across these varying corrupted states. Evaluated across six benchmarks and two different models, TRACE consistently outperformed other methods, achieving nearly 100% safety while preserving utility comparable to the undefended fine-tuned model.

Why it matters

For AI developers, platform providers, and enterprises using customized LLMs, TRACE offers a practical solution to maintain safety alignment post-fine-tuning, ensuring that specialized models remain responsible and trustworthy without compromising their performance on specific tasks.

How to implement this in your domain

  1. 1Integrate TRACE or similar safety patch learning frameworks into LLM post-training pipelines.
  2. 2Develop methods to simulate harmful tuning trajectories to generate diverse corrupted model states for patch optimization.
  3. 3Prioritize safety patches that demonstrate minimal interference with task-specific utility.
  4. 4Regularly evaluate the safety and utility trade-offs of fine-tuned models using robust benchmarks.

Who benefits

AI DevelopmentCloud ServicesEnterprise AICybersecurityContent Moderation

Key takeaways

  • Fine-tuning LLMs can erode safety alignment, requiring effective post-training realignment.
  • TRACE framework uses trajectory-based learning to create safety patches.
  • It effectively recovers safety without degrading task-specific utility.
  • This approach addresses the challenge of task-safety update entanglement.

Original post by Changyue Li, Jiaming He, Youliang Yuan, Jialin Wu, Boxi Yu, Zhicong Huang, Pinjia He

"arXiv:2607.16242v1 Announce Type: new Abstract: Fine-Tuning-as-a-Service (FTaaS) platforms let users train large language models (LLMs) on customized tasks, but this pipeline could erode models' safety alignment. In practice, service providers need to recover models' safety witho…"

View on X

Originally posted by Changyue Li, Jiaming He, Youliang Yuan, Jialin Wu, Boxi Yu, Zhicong Huang, Pinjia He on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses