Papers › torchdistill: A Modular, Configuration-Driven Framework for Knowledge Distillation

torchdistill: A Modular, Configuration-Driven Framework for Knowledge Distillation

25 Nov 2020arXiv:2011.12913archive 2025-07-28

Yoshitomo Matsubara

While knowledge distillation (transfer) has been attracting attentions from the research community, the recent development in the fields has heightened the need for reproducible studies and highly generalized frameworks to lower barriers to such high-quality, reproducible deep learning research. Several researchers voluntarily published frameworks used in their knowledge distillation studies to help other interested researchers reproduce their original work. Such frameworks, however, are usually neither well generalized nor maintained, thus researchers are still required to write a lot of code to refactor/build on the frameworks for introducing new methods, models, datasets and designing experiments. In this paper, we present our developed open-source framework built on PyTorch and dedicated for knowledge distillation studies. The framework is designed to enable users to design experiments by declarative PyYAML configuration files, and helps researchers complete the recently proposed ML Code Completeness Checklist. Using the developed framework, we demonstrate its various efficient training strategies, and implement a variety of knowledge distillation methods. We also reproduce some of their original experimental results on the ImageNet and COCO datasets presented at major machine learning conferences such as ICLR, NeurIPS, CVPR and ECCV, including recent state-of-the-art methods. All the source code, configurations, log files and trained model weights are publicly available at https://github.com/yoshitomo-matsubara/torchdistill .

PaperPDFCodeCode Syntology ranMethod as code

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

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

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 26 code samples harvested from 1 repository linked to this paper: 10 ran (of which 0 constructed an object rather than computing a result; 0 with no instrument failure: 0 honoured, 0 violated, 0 with no contract checked; 10 where Syntology's instrument failed) · 16 unverified. Where Syntology's instrument failed: 10 where our contract draft was wrong; failures of Syntology's instrument, not of the code. Every run on this page is a failure of Syntology's instrument, not of the code.

By repository: official repository: 26 samples from 1 repository, 10 ran (0 with no instrument failure; 10 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Levels written on 2026-09-22 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

yoshitomo-matsubara/torchdistill officialmentioned in papermentioned on GitHubpytorchSyntology: 26 samples, 10 ran (10 instrument-failed) · 16 unverified 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

26 samples harvested: 10 ran (of which 0 constructed an object rather than computing a result; 0 with no instrument failure: 0 honoured, 0 violated, 0 with no contract checked; 10 where Syntology's instrument failed) · 16 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Every run on this page is a failure of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

10ran · our draft was wrong
16unverified

Licence: 0 of the 26 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 yoshitomo-matsubara/torchdistill. “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. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (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 are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. 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 six 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; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. 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.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity.

yoshitomo-matsubara/torchdistill official repository 26 samples, 10 ran (10 instrument-failed) · 16 unverified
_resolve_module_path_flag torchdistill/core/distillation.py ran · our draft was wrong MIT (permissive) · c3ed65ba6ea90613 · report fixture: signature flag_config:list/1/str, target_module_path_set:set/0/? · returned set · level recorded 2026-09-22
build_proc_func torchdistill/core/distillation.py ran · our draft was wrong MIT (permissive) · 3254f2af805330f9 · report fixture: signature proc_config:dict/0/?, get_registered_proc_func:callable/0/? · returned function · level recorded 2026-09-22
get_device_index torchdistill/core/distillation.py ran · our draft was wrong MIT (permissive) · 87b46952aaf35391 · report fixture: signature data:Tensor/2/float · returned str · level recorded 2026-09-22
get_proc_config torchdistill/core/distillation.py ran · our draft was wrong MIT (permissive) · fd6d7563a4a31ea5 · report fixture: signature train_config:dict/0/?, key:str/0/str · returned dict · level recorded 2026-09-22
register_forward_hook_with_dict torchdistill/core/distillation.py ran · our draft was wrong MIT (permissive) · 4b491e5e58b0f881 · report fixture: signature root_module:callable/0/?, module_path:str/0/str, requires_input:bool/0/bool, requires_output:bool/0/bool, io_dict:dict/0/?, accumulates:bool/0/bool · returned RemovableHandle · level recorded 2026-09-22
register_post_epoch_proc_func torchdistill/core/distillation.py ran · our draft was wrong MIT (permissive) · c92bc6d24855c49a · report fixture: signature arg:callable/0/?, kwargs:dict/0/? · returned function · level recorded 2026-09-22
register_post_forward_proc_func torchdistill/core/distillation.py ran · our draft was wrong MIT (permissive) · 7c61d41d0c3e500d · report fixture: signature arg:callable/0/?, kwargs:dict/0/? · returned function · level recorded 2026-09-22
register_pre_epoch_proc_func torchdistill/core/distillation.py ran · our draft was wrong MIT (permissive) · b354561e7df46cce · report fixture: signature arg:callable/0/?, kwargs:dict/0/? · returned function · level recorded 2026-09-22
register_pre_forward_proc_func torchdistill/core/distillation.py ran · our draft was wrong MIT (permissive) · 6a583218d3dff95c · report fixture: signature arg:callable/0/? · returned function · level recorded 2026-09-22
set_hooks torchdistill/core/distillation.py ran · our draft was wrong MIT (permissive) · f44f1f4a4378af5a · report fixture: returned list · level recorded 2026-09-22
DistillationBox torchdistill/core/distillation.py unverified MIT (permissive) · 5e932d9e557d1152 · report
ForwardHookManager torchdistill/core/distillation.py unverified MIT (permissive) · 733dc5424bd2b106 · report
_extract_module torchdistill/core/distillation.py unverified MIT (permissive) · 62cb0c77042128ad · report
clear_io_dict torchdistill/core/distillation.py unverified MIT (permissive) · 3f67b3fedf426f90 · report
clear_io_dict_values torchdistill/core/distillation.py unverified MIT (permissive) · 0b996e294219e230 · report
default_post_epoch_process_with_teacher torchdistill/core/distillation.py unverified MIT (permissive) · 7b5cddaa746c727a · report
default_post_forward_process torchdistill/core/distillation.py unverified MIT (permissive) · 25556f7f6770ba26 · report
default_pre_epoch_process_with_teacher torchdistill/core/distillation.py unverified MIT (permissive) · 4d443b9aef2436a9 · report
default_pre_forward_process torchdistill/core/distillation.py unverified MIT (permissive) · aaa26d595f56f023 · report
get_forward_proc_func torchdistill/core/distillation.py unverified MIT (permissive) · d6b164151ea048bc · report
get_post_epoch_proc_func torchdistill/core/distillation.py unverified MIT (permissive) · c2780237c1682ad8 · report
get_post_forward_proc_func torchdistill/core/distillation.py unverified MIT (permissive) · e78710c20c16f470 · report
get_pre_epoch_proc_func torchdistill/core/distillation.py unverified MIT (permissive) · d75c1131fcde7500 · report
get_pre_forward_proc_func torchdistill/core/distillation.py unverified MIT (permissive) · 7f13327e06b694aa · report
update_io_dict torchdistill/core/distillation.py unverified MIT (permissive) · 3933a969d27c0f3a · report
wrap_model in 7 papers torchdistill/core/distillation.py unverified MIT (permissive) · 0c2e416b9fd8f9e7 · report

Method as code Syntology

What Syntology's graph records as this paper's claimed method, lifted into code: each assembly names its bricks (functions and classes), each with its own role and its own verification level. An assembly is not a check that the code implements the method correctly or reproduces the paper's results. Levels are each brick's own verification level in Syntology's graph (level 0: no recorded run), listed brick by brick and never combined into one level; “ran” means the brick executed on a synthesized input, not that its output is correct, and the instrument figure counts failures of Syntology's instrument, not of the code. Where a model read the code against the paper's claim, each assembly's label verdict is one model's judgement, kept in this page's JSON twin; it is not calibrated, so no card prints it.

1 assembly on this paper: 1 harvested, 0 generated.

harvested Assembly for torchdistill (graph method: torchdistill). 26 bricks; individually on a fixture: 10 ran (of which 0 constructed an object rather than computing a result; 0 with no instrument failure: 0 honoured, 0 violated, 0 with no contract checked; 10 where Syntology's instrument failed) · 16 unverified. The assembly has not been run end-to-end.

  1. DistillationBox entry · level 0 · unverified · 5e932d9e557d1152
  2. ForwardHookManager helper · level 0 · unverified · 733dc5424bd2b106
  3. build_proc_func helper · level 1 · ran · our draft was wrong · 3254f2af805330f9
  4. default_post_epoch_process_with_teacher helper · level 0 · unverified · 7b5cddaa746c727a
  5. default_post_forward_process helper · level 0 · unverified · 25556f7f6770ba26
  6. default_pre_epoch_process_with_teacher helper · level 0 · unverified · 4d443b9aef2436a9
  7. default_pre_forward_process helper · level 0 · unverified · aaa26d595f56f023
  8. get_forward_proc_func helper · level 0 · unverified · d6b164151ea048bc
  9. get_post_epoch_proc_func helper · level 0 · unverified · c2780237c1682ad8
  10. get_post_forward_proc_func helper · level 0 · unverified · e78710c20c16f470
  11. get_pre_epoch_proc_func helper · level 0 · unverified · d75c1131fcde7500
  12. get_pre_forward_proc_func helper · level 0 · unverified · 7f13327e06b694aa
  13. get_proc_config helper · level 1 · ran · our draft was wrong · fd6d7563a4a31ea5
  14. set_hooks helper · level 1 · ran · our draft was wrong · f44f1f4a4378af5a
  15. update_io_dict helper · level 0 · unverified · 3933a969d27c0f3a
  16. wrap_model helper · level 0 · unverified · 0c2e416b9fd8f9e7
  17. clear_io_dict_values helper · level 0 · unverified · 0b996e294219e230
  18. register_forward_hook_with_dict helper · level 1 · ran · our draft was wrong · 4b491e5e58b0f881
  19. register_post_epoch_proc_func helper · level 1 · ran · our draft was wrong · c92bc6d24855c49a
  20. register_post_forward_proc_func helper · level 1 · ran · our draft was wrong · 7c61d41d0c3e500d
  21. clear_io_dict helper · level 0 · unverified · 3f67b3fedf426f90
  22. register_pre_epoch_proc_func helper · level 1 · ran · our draft was wrong · b354561e7df46cce
  23. register_pre_forward_proc_func helper · level 1 · ran · our draft was wrong · 6a583218d3dff95c
  24. _extract_module helper · level 0 · unverified · 62cb0c77042128ad
  25. _resolve_module_path_flag helper · level 1 · ran · our draft was wrong · c3ed65ba6ea90613
  26. get_device_index helper · level 1 · ran · our draft was wrong · 87b46952aaf35391

Each brick ends with its code_sha256, Syntology's identity for that exact code; click one to copy the get_code call that returns it. For agents, on Syntology's MCP service: assembly(arxiv_id="2011.12913") returns these assemblies with each brick's role and wiring (how to connect).

Tasks

Image ClassificationInstance SegmentationKnowledge DistillationModel CompressionNeural Network CompressionObject Detection

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Image Classification ImageNet ResNet-18 (PAD-L2 w/ ResNet-34 teacher) Top 1 Accuracy 71.71% #1005 of 1060 Archive leaderboard report
Image Classification ImageNet ResNet-18 (FT w/ ResNet-34 teacher) Top 1 Accuracy 71.56% #1008 of 1060 Archive leaderboard report
Image Classification ImageNet ResNet-18 (KD w/ ResNet-34 teacher) Top 1 Accuracy 71.37% #1011 of 1060 Archive leaderboard report
Image Classification ImageNet ResNet-18 (L2 w/ ResNet-34 teacher) Top 1 Accuracy 71.08% #1014 of 1060 Archive leaderboard report
Image Classification ImageNet ResNet-18 (CRD w/ ResNet-34 teacher) Top 1 Accuracy 70.93% #1016 of 1060 Archive leaderboard report
Image Classification ImageNet ResNet-18 (tf-KD w/ ResNet-18 teacher) Top 1 Accuracy 70.52% #1020 of 1060 Archive leaderboard report
Image Classification ImageNet ResNet-18 (SSKD w/ ResNet-34 teacher) Top 1 Accuracy 70.09% #1024 of 1060 Archive leaderboard report
Instance Segmentation COCO test-dev Mask R-CNN (Bottleneck-injected ResNet-50, FPN) mask AP 33.6 #101 of 112 Archive leaderboard report
Object Detection COCO test-dev Mask R-CNN (Bottleneck-injected ResNet-50, FPN) box mAP 36.9 #220 of 225 Archive leaderboard report
Object Detection COCO test-dev Faster R-CNN (Bottleneck-injected ResNet-50 and FPN) box mAP 35.9 #225 of 225 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Knowledge Distillation

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