{"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/kga-a-general-machine-unlearning-framework","title":"KGA: A General Machine Unlearning Framework Based on Knowledge Gap Alignment","arxiv_id":"2305.06535","date":"2023-05-11","proceeding":null,"authors":["Lingzhi Wang","Tong Chen","Wei Yuan","Xingshan Zeng","Kam-Fai Wong","Hongzhi Yin"],"abstract":"Recent legislation of the \"right to be forgotten\" has led to the interest in machine unlearning, where the learned models are endowed with the function to forget information about specific training instances as if they have never existed in the training set. Previous work mainly focuses on computer vision scenarios and largely ignores the essentials of unlearning in NLP field, where text data contains more explicit and sensitive personal information than images. In this paper, we propose a general unlearning framework called KGA to induce forgetfulness. Different from previous work that tries to recover gradients or forces models to perform close to one specific distribution, KGA maintains distribution differences (i.e., knowledge gap). This relaxes the distribution assumption. Furthermore, we first apply the unlearning method to various NLP tasks (i.e., classification, translation, response generation) and propose several unlearning evaluation metrics with pertinence. Experiments on large-scale datasets show that KGA yields comprehensive improvements over baselines, where extensive analyses further validate the effectiveness of KGA and provide insight into unlearning for NLP tasks.","url_abs":"https://arxiv.org/abs/2305.06535v1","url_pdf":"https://arxiv.org/pdf/2305.06535v1.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":"kga-a-general-machine-unlearning-framework","repo_url":"https://github.com/lingzhi-wang/kgaunlearn","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"machine-unlearning","task_name":"Machine Unlearning"},{"task_slug":"response-generation","task_name":"Response Generation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2305.06535","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2305.06535"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/lingzhi-wang/kgaunlearn","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_violates":1,"unverified":8},"by_repo_kind":{"official":{"samples":9,"ran":1,"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":"f35babe3912ec8b1","entry":"sigmoid","repo":"lingzhi-wang/kgaunlearn","repo_kind":"official","path":"classification/run_classification.py","file_url":"https://github.com/lingzhi-wang/kgaunlearn/blob/HEAD/classification/run_classification.py","link_basis":"plan_row","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f35babe3912ec8b1"}},{"code_sha256_prefix":"6b3716364a307c21","entry":"convert_examples_to_features","repo":"lingzhi-wang/kgaunlearn","repo_kind":"official","path":"classification/utils.py","file_url":"https://github.com/lingzhi-wang/kgaunlearn/blob/HEAD/classification/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6b3716364a307c21"}},{"code_sha256_prefix":"ab1fc5c157f23c1e","entry":"dev_loop","repo":"lingzhi-wang/kgaunlearn","repo_kind":"official","path":"response/run_generation.py","file_url":"https://github.com/lingzhi-wang/kgaunlearn/blob/HEAD/response/run_generation.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ab1fc5c157f23c1e"}},{"code_sha256_prefix":"2f6edd20b524ee65","entry":"evaluate","repo":"lingzhi-wang/kgaunlearn","repo_kind":"official","path":"classification/run_classification.py","file_url":"https://github.com/lingzhi-wang/kgaunlearn/blob/HEAD/classification/run_classification.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2f6edd20b524ee65"}},{"code_sha256_prefix":"340d2237f9509870","entry":"evaluate_multilabels","repo":"lingzhi-wang/kgaunlearn","repo_kind":"official","path":"classification/utils.py","file_url":"https://github.com/lingzhi-wang/kgaunlearn/blob/HEAD/classification/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"340d2237f9509870"}},{"code_sha256_prefix":"9d89819a5e128380","entry":"get_dataLoader","repo":"lingzhi-wang/kgaunlearn","repo_kind":"official","path":"response/data.py","file_url":"https://github.com/lingzhi-wang/kgaunlearn/blob/HEAD/response/data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9d89819a5e128380"}},{"code_sha256_prefix":"c6c0c0019eebe367","entry":"get_dataLoader","repo":"lingzhi-wang/kgaunlearn","repo_kind":"official","path":"translation/data.py","file_url":"https://github.com/lingzhi-wang/kgaunlearn/blob/HEAD/translation/data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c6c0c0019eebe367"}},{"code_sha256_prefix":"d0417cd78cab8469","entry":"multihot","repo":"lingzhi-wang/kgaunlearn","repo_kind":"official","path":"classification/utils.py","file_url":"https://github.com/lingzhi-wang/kgaunlearn/blob/HEAD/classification/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d0417cd78cab8469"}},{"code_sha256_prefix":"72c0db7655ddb2d6","entry":"train_loop","repo":"lingzhi-wang/kgaunlearn","repo_kind":"official","path":"response/run_generation.py","file_url":"https://github.com/lingzhi-wang/kgaunlearn/blob/HEAD/response/run_generation.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"72c0db7655ddb2d6"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}