{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/undistillable-making-a-nasty-teacher-that-1","title":"Undistillable: Making A Nasty Teacher That CANNOT teach students","arxiv_id":"2105.07381","date":"2021-05-16","proceeding":"ICLR 2021 1","authors":["Haoyu Ma","Tianlong Chen","Ting-Kuei Hu","Chenyu You","Xiaohui Xie","Zhangyang Wang"],"abstract":"Knowledge Distillation (KD) is a widely used technique to transfer knowledge from pre-trained teacher models to (usually more lightweight) student models. However, in certain situations, this technique is more of a curse than a blessing. For instance, KD poses a potential risk of exposing intellectual properties (IPs): even if a trained machine learning model is released in 'black boxes' (e.g., as executable software or APIs without open-sourcing code), it can still be replicated by KD through imitating input-output behaviors. To prevent this unwanted effect of KD, this paper introduces and investigates a concept called Nasty Teacher: a specially trained teacher network that yields nearly the same performance as a normal one, but would significantly degrade the performance of student models learned by imitating it. We propose a simple yet effective algorithm to build the nasty teacher, called self-undermining knowledge distillation. Specifically, we aim to maximize the difference between the output of the nasty teacher and a normal pre-trained network. Extensive experiments on several datasets demonstrate that our method is effective on both standard KD and data-free KD, providing the desirable KD-immunity to model owners for the first time. We hope our preliminary study can draw more awareness and interest in this new practical problem of both social and legal importance.","url_abs":"https://arxiv.org/abs/2105.07381v1","url_pdf":"https://arxiv.org/pdf/2105.07381v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"undistillable-making-a-nasty-teacher-that-1","repo_url":"https://github.com/VITA-Group/Nasty-Teacher","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"knowledge-distillation","task_name":"Knowledge Distillation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2105.07381","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2105.07381"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"deterministic:regex_extraction","url":"https://github.com/VITA-Group/Nasty-Teacher","reach":null}],"summary":{"ran_draft_wrong":2,"ran_honours":2},"by_repo_kind":{"official":{"samples":4,"ran":4,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"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"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"838b348fdb6ed05a","entry":"loss_fn_kd","repo":"vita-group/nasty-teacher","repo_kind":"official","path":"train_kd.py","file_url":"https://github.com/vita-group/nasty-teacher/blob/HEAD/train_kd.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":2,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"838b348fdb6ed05a"}},{"code_sha256_prefix":"6d95fdf64bf8e718","entry":"adjust_learning_rate","repo":"vita-group/nasty-teacher","repo_kind":"official","path":"train_scratch.py","file_url":"https://github.com/vita-group/nasty-teacher/blob/HEAD/train_scratch.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6d95fdf64bf8e718"}},{"code_sha256_prefix":"3c49dac5735131bf","entry":"evaluate","repo":"vita-group/nasty-teacher","repo_kind":"official","path":"train_scratch.py","file_url":"https://github.com/vita-group/nasty-teacher/blob/HEAD/train_scratch.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3c49dac5735131bf"}},{"code_sha256_prefix":"c040e8a41c105d70","entry":"train_epoch_kd_adv","repo":"VITA-Group/Nasty-Teacher","repo_kind":"official","path":"train_nasty.py","file_url":"https://github.com/VITA-Group/Nasty-Teacher/blob/HEAD/train_nasty.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c040e8a41c105d70"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}