{"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/consistent-representation-learning-for","title":"Consistent Representation Learning for Continual Relation Extraction","arxiv_id":"2203.02721","date":"2022-03-05","proceeding":"Findings (ACL) 2022 5","authors":["Kang Zhao","Hua Xu","Jiangong Yang","Kai Gao"],"abstract":"Continual relation extraction (CRE) aims to continuously train a model on data with new relations while avoiding forgetting old ones. Some previous work has proved that storing a few typical samples of old relations and replaying them when learning new relations can effectively avoid forgetting. However, these memory-based methods tend to overfit the memory samples and perform poorly on imbalanced datasets. To solve these challenges, a consistent representation learning method is proposed, which maintains the stability of the relation embedding by adopting contrastive learning and knowledge distillation when replaying memory. Specifically, supervised contrastive learning based on a memory bank is first used to train each new task so that the model can effectively learn the relation representation. Then, contrastive replay is conducted of the samples in memory and makes the model retain the knowledge of historical relations through memory knowledge distillation to prevent the catastrophic forgetting of the old task. The proposed method can better learn consistent representations to alleviate forgetting effectively. Extensive experiments on FewRel and TACRED datasets show that our method significantly outperforms state-of-the-art baselines and yield strong robustness on the imbalanced dataset.","url_abs":"https://arxiv.org/abs/2203.02721v2","url_pdf":"https://arxiv.org/pdf/2203.02721v2.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":"consistent-representation-learning-for","repo_url":"https://github.com/thuiar/CRL","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"continual-relation-extraction","task_name":"Continual Relation Extraction"},{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"},{"task_slug":"knowledge-distillation","task_name":"Knowledge Distillation"},{"task_slug":null,"task_name":"Relation"},{"task_slug":"relation-extraction","task_name":"Relation Extraction"},{"task_slug":"representation-learning","task_name":"Representation Learning"}],"methods":[{"method_slug":"contrastive-learning","method_name":"Contrastive Learning"},{"method_slug":"knowledge-distillation","method_name":"Knowledge Distillation"},{"method_slug":"supervised-contrastive-loss","method_name":"Supervised Contrastive Loss"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2203.02721","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2203.02721"}},"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/thuiar/CRL","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/fd2014cl/RP-CRE","reach":null}],"summary":{"ran":4,"ran_honours":2,"ran_draft_wrong":1,"unverified":5},"by_repo_kind":{"official":{"samples":10,"ran":5,"repositories":1},"found_in_text":{"samples":2,"ran":2,"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":12,"samples":[{"code_sha256_prefix":"8a168b556cae88dc","entry":"Attention_Memory_Simplified","repo":"fd2014cl/RP-CRE","repo_kind":"found_in_text","path":"model/memory_network/attention_memory_simplified.py","file_url":"https://github.com/fd2014cl/RP-CRE/blob/HEAD/model/memory_network/attention_memory_simplified.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8a168b556cae88dc"}},{"code_sha256_prefix":"803f29e39d3fcc0d","entry":"Encoder","repo":"thuiar/CRL","repo_kind":"official","path":"methods/manager.py","file_url":"https://github.com/thuiar/CRL/blob/HEAD/methods/manager.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"803f29e39d3fcc0d"}},{"code_sha256_prefix":"e1833fd60f20049a","entry":"base_model","repo":"fd2014cl/RP-CRE","repo_kind":"found_in_text","path":"model/memory_network/attention_memory_simplified.py","file_url":"https://github.com/fd2014cl/RP-CRE/blob/HEAD/model/memory_network/attention_memory_simplified.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e1833fd60f20049a"}},{"code_sha256_prefix":"27ec67b2ade9f286","entry":"data_set","repo":"thuiar/CRL","repo_kind":"official","path":"methods/manager.py","file_url":"https://github.com/thuiar/CRL/blob/HEAD/methods/manager.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"27ec67b2ade9f286"}},{"code_sha256_prefix":"f7bfb113b24ce037","entry":"dot_dist","repo":"thuiar/CRL","repo_kind":"official","path":"methods/manager.py","file_url":"https://github.com/thuiar/CRL/blob/HEAD/methods/manager.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f7bfb113b24ce037"}},{"code_sha256_prefix":"137f6961fd6db94d","entry":"get_data_loader","repo":"thuiar/CRL","repo_kind":"official","path":"methods/manager.py","file_url":"https://github.com/thuiar/CRL/blob/HEAD/methods/manager.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"137f6961fd6db94d"}},{"code_sha256_prefix":"817364403367f730","entry":"osdist","repo":"thuiar/CRL","repo_kind":"official","path":"methods/manager.py","file_url":"https://github.com/thuiar/CRL/blob/HEAD/methods/manager.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"817364403367f730"}},{"code_sha256_prefix":"273fd3bad678fcf3","entry":"Bert_Encoder","repo":"thuiar/CRL","repo_kind":"official","path":"methods/manager.py","file_url":"https://github.com/thuiar/CRL/blob/HEAD/methods/manager.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"273fd3bad678fcf3"}},{"code_sha256_prefix":"237fe81052ab56f8","entry":"Manager","repo":"thuiar/CRL","repo_kind":"official","path":"methods/manager.py","file_url":"https://github.com/thuiar/CRL/blob/HEAD/methods/manager.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"237fe81052ab56f8"}},{"code_sha256_prefix":"d351c67cc90b1c0f","entry":"Moment","repo":"thuiar/CRL","repo_kind":"official","path":"methods/manager.py","file_url":"https://github.com/thuiar/CRL/blob/HEAD/methods/manager.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d351c67cc90b1c0f"}},{"code_sha256_prefix":"bfe20427b6312483","entry":"data_sampler","repo":"thuiar/CRL","repo_kind":"official","path":"methods/manager.py","file_url":"https://github.com/thuiar/CRL/blob/HEAD/methods/manager.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"bfe20427b6312483"}},{"code_sha256_prefix":"761ebbc2e39d4f59","entry":"get_tokenizer","repo":"thuiar/CRL","repo_kind":"official","path":"methods/manager.py","file_url":"https://github.com/thuiar/CRL/blob/HEAD/methods/manager.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"761ebbc2e39d4f59"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}