Papers › Self-Distillation Bridges Distribution Gap in Language Model Fine-Tuning

Self-Distillation Bridges Distribution Gap in Language Model Fine-Tuning

21 Feb 2024arXiv:2402.13669archive 2025-07-28

Zhaorui Yang, Tianyu Pang, Haozhe Feng, Han Wang, Wei Chen, Minfeng Zhu, Qian Liu

The surge in Large Language Models (LLMs) has revolutionized natural language processing, but fine-tuning them for specific tasks often encounters challenges in balancing performance and preserving general instruction-following abilities. In this paper, we posit that the distribution gap between task datasets and the LLMs serves as the primary underlying cause. To address the problem, we introduce Self-Distillation Fine-Tuning (SDFT), a novel approach that bridges the distribution gap by guiding fine-tuning with a distilled dataset generated by the model itself to match its original distribution. Experimental results on the Llama-2-chat model across various benchmarks demonstrate that SDFT effectively mitigates catastrophic forgetting while achieving comparable or superior performance on downstream tasks compared to the vanilla fine-tuning. Moreover, SDFT demonstrates the potential to maintain the helpfulness and safety alignment of LLMs. Our code is available at https://github.com/sail-sg/sdft.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2402.13669")

Code

Syntology Ran 11 of 11 code samples harvested from 1 repository linked to this paper; 0 have no recorded run. Of those that ran: 11 ran with no contract checked.

By repository: official repository: 11 samples from 1 repository, 11 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

sail-sg/sdft officialmentioned in papermentioned on GitHub report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

11 samples harvested; 11 ran; 0 honoured the contract we drafted; 0 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

11ran

Licence: 11 of the 11 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from sail-sg/sdft. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

check_magicoder sail-sg/sdft/eval/eval_magicoder.py official repository ran no licence file found · pointer only · 8e38a7f4c3b74f9f · report
check_openfunction sail-sg/sdft/eval/eval_openfunction.py official repository ran no licence file found · pointer only · 26b2773e736f78dd · report
contains_keywords sail-sg/sdft/eval/eval_magicoder.py official repository ran no licence file found · pointer only · b9d80359c50174e0 · report
eval sail-sg/sdft/eval/keyword_eval_safety.py official repository ran no licence file found · pointer only · c70eb4756e638ed0 · report
find_answer_key sail-sg/sdft/eval/gen_distilled_data.py official repository ran no licence file found · pointer only · 73cbe2d0163944c7 · report
find_last_integer sail-sg/sdft/eval/utils.py official repository ran fingerprinted no licence file found · pointer only · 7d02bf0b46db03b1 · report
get_bleu4_array sail-sg/sdft/eval/eval_bleu4.py official repository ran no licence file found · pointer only · f4218ed8a7d62be1 · report
get_outputs sail-sg/sdft/eval/utils.py official repository ran no licence file found · pointer only · b193dd7920d260e3 · report
is_safe sail-sg/sdft/eval/keyword_eval_safety.py official repository ran no licence file found · pointer only · a1f7d6db520591f5 · report
standardize_function_call sail-sg/sdft/eval/eval_openfunction.py official repository ran fingerprinted no licence file found · pointer only · daf7c701c6269867 · report
starts_right sail-sg/sdft/eval/eval_magicoder.py official repository ran no licence file found · pointer only · 11c643b41155d018 · report

Tasks

Instruction FollowingLanguage ModelingLanguage ModellingSafety Alignment

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections