Fine-tuning large language models (LLMs) on custom datasets has become a standard approach for adapting these models to specific domains and applications. However, recent studies have shown that such fine-tuning can lead to significant degradation in the model's safety. Existing defense methods operate at the sample level and often suffer from an unsatisfactory trade-off between safety and utility. To address this limitation, we perform a systematic token-level diagnosis of safety degradation during fine-tuning. Based on this, we propose token-level data selection for safe LLM fine-tuning (TOSS), a novel framework that quantifies the safety risk of each token by measuring the loss difference between a safety-degraded model and a utility-oriented model. This token-level granularity enables accurate identification and removal of unsafe tokens, thereby preserving valuable task-specific information. In addition, we introduce a progressive refinement strategy, TOSS-Pro, which iteratively enhances the safety-degraded model's ability to identify unsafe tokens. Extensive experiments demonstrate that our approach robustly safeguards LLMs during fine-tuning while achieving superior downstream task performance, significantly outperforming existing sample-level defense methods. Our code is available at https://github.com/Polly-LYP/TOSS.
TokenSeek: Memory Efficient Fine Tuning via Instance-Aware Token Ditching
Rochester Institute of Technology(罗切斯特理工学院);Meta AI;Kent State University(肯特州立大学);Rutgers University(罗格斯大学);UC Davis(加州大学戴维斯分校);Accenture(安永);University of Missouri-Kansas City(密苏里大学堪萨斯城分校)
Explainable Token-level Noise Filtering for LLM Fine-tuning Datasets
The State Key Laboratory of Blockchain and Data Security, Zhejiang University(浙江大学区块链与数据安全全国重点实验室);Hangzhou HighTech Zone (Binjiang) Blockchain and Data Security Research Institute(杭州高新区(滨江)区块链与数据安全研究院)
Safeguarding RAG Pipelines with GMTP: A Gradient-based Masked Token Probability Method for Poisoned Document Detection
Graduate School of Artificial Intelligence, POSTECH, Republic of Korea(人工智能研究生院,POSTECH,韩国);Department of Computer Science and Engineering, POSTECH, Republic of Korea(计算机科学与工程系,POSTECH,韩国)
Towards Understanding the Fragility of Multilingual LLMs against Fine-Tuning Attacks
Meta;University of Pisa(比萨大学);University of Modena and Reggio Emilia(摩德纳与雷焦艾米利亚大学);Brown University(布朗大学);University of Illinois Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校)
LookAhead Tuning: Safer Language Models via Partial Answer Previews
Zhejiang University(浙江大学);Zhejiang University - Ant Group Joint Laboratory of Knowledge Graph(浙江大学-蚂蚁集团知识图谱联合实验室);Ant Group(蚂蚁集团);National University of Singapore(新加坡国立大学)
Safe Delta: Consistently Preserving Safety when Fine-Tuning LLMs on Diverse Datasets
Guangdong Provincial Key Laboratory of Brain-Inspired Intelligent Computation, Department of CSE, SUSTech(脑启发智能计算广东省重点实验室,计算机科学与工程系,华南理工大学);Department of CSE, HKUST(计算机科学与工程系,香港科技大学);Department of CSE, PolyU(计算机科学与工程系,PolyU);Department of CSE, SUSTech(计算机科学与工程系,华南理工大学);Huawei Technologies CO.(华为技术有限公司);College of Computing(计算学院)
SPARD: Defending Harmful Fine-Tuning Attack via Safety Projection with Relevance-Diversity Data Selection
Department of Computer Science and Engineering, The Hong Kong University of Science and Technology(香港科学与技术大学计算机科学与工程系);Department of Computer Science and Engineering, Southern University of Science and Technology(南方科技大学计算机科学与工程系);Department of Computer Science and Engineering, The Chinese University of Hong Kong(香港中文大学计算机科学与工程系);Platform and Content Group, Tencent(腾讯平台与内容组);Chinese Medicine Guangdong Laboratory(广东中医实验室)
Beyond Token-Level Guidance: Inference-Time Alignment of Specialized LLMs via Cross-Family Representation Steering
College of Computing and Data Science, Nanyang Technological University(南洋理工大学计算与数据科学学院);College of Cryptology and Cyber Science, Nankai University(南开大学密码与网络科学学院)
Enhancing Large Language Model Reasoning via Selective Critical Token Fine-Tuning
Southern University of Science and Technology(南方科技大学);Peking University(北京大学);Shanghai University of Finance and Economics(上海金融学院);Tsinghua University(清华大学)
SafeSteer: Localized On-Policy Distillation for Efficient Safety Alignment
Beihang University(北航);Beijing Institute of Technology(北京理工大学);Beijing University of Posts and Telecommunications(北京邮电大学);Peking University(北京大学);Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);Shanghai Artificial Intelligence Laboratory(上海人工智能实验室);Beijing Academy of Artificial Intelligence(北京人工智能研究院)