{"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/neural-machine-translation-with-monolingual","title":"Neural Machine Translation with Monolingual Translation Memory","arxiv_id":"2105.11269","date":"2021-05-24","proceeding":"ACL 2021 5","authors":["Deng Cai","Yan Wang","Huayang Li","Wai Lam","Lemao Liu"],"abstract":"Prior work has proved that Translation memory (TM) can boost the performance of Neural Machine Translation (NMT). In contrast to existing work that uses bilingual corpus as TM and employs source-side similarity search for memory retrieval, we propose a new framework that uses monolingual memory and performs learnable memory retrieval in a cross-lingual manner. Our framework has unique advantages. First, the cross-lingual memory retriever allows abundant monolingual data to be TM. Second, the memory retriever and NMT model can be jointly optimized for the ultimate translation goal. Experiments show that the proposed method obtains substantial improvements. Remarkably, it even outperforms strong TM-augmented NMT baselines using bilingual TM. Owning to the ability to leverage monolingual data, our model also demonstrates effectiveness in low-resource and domain adaptation scenarios.","url_abs":"https://arxiv.org/abs/2105.11269v2","url_pdf":"https://arxiv.org/pdf/2105.11269v2.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":"neural-machine-translation-with-monolingual","repo_url":"https://github.com/jcyk/copyisallyouneed","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"domain-adaptation","task_name":"Domain Adaptation"},{"task_slug":"machine-translation","task_name":"Machine Translation"},{"task_slug":"nmt","task_name":"NMT"},{"task_slug":"retrieval","task_name":"Retrieval"},{"task_slug":"translation","task_name":"Translation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2105.11269","atlas_url":"https://app.syntology.ai/?focus=2105.11269","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2105.11269"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/jcyk/copyisallyouneed","reach":null}],"summary":{"ran":5,"ran_draft_wrong":2,"ran_honours":1,"unverified":7},"by_repo_kind":{"official":{"samples":15,"ran":8,"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":15,"samples":[{"code_sha256_prefix":"3f5788b4374477b9","entry":"Beam","repo":"jcyk/copyisallyouneed","repo_kind":"official","path":"generator.py","file_url":"https://github.com/jcyk/copyisallyouneed/blob/HEAD/generator.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":"3f5788b4374477b9"}},{"code_sha256_prefix":"0ef15a4cb09384ad","entry":"Embedding","repo":"jcyk/copyisallyouneed","repo_kind":"official","path":"generator.py","file_url":"https://github.com/jcyk/copyisallyouneed/blob/HEAD/generator.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":"0ef15a4cb09384ad"}},{"code_sha256_prefix":"81315fc2046ebf4e","entry":"FeedForwardLayer","repo":"jcyk/copyisallyouneed","repo_kind":"official","path":"generator.py","file_url":"https://github.com/jcyk/copyisallyouneed/blob/HEAD/generator.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":"81315fc2046ebf4e"}},{"code_sha256_prefix":"32cff5955ac4b107","entry":"Hypothesis","repo":"jcyk/copyisallyouneed","repo_kind":"official","path":"generator.py","file_url":"https://github.com/jcyk/copyisallyouneed/blob/HEAD/generator.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":"32cff5955ac4b107"}},{"code_sha256_prefix":"3c3c613a192ad4fc","entry":"ListsToTensor","repo":"jcyk/copyisallyouneed","repo_kind":"official","path":"generator.py","file_url":"https://github.com/jcyk/copyisallyouneed/blob/HEAD/generator.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3c3c613a192ad4fc"}},{"code_sha256_prefix":"962b518e75b8b7af","entry":"SelfAttentionMask","repo":"jcyk/copyisallyouneed","repo_kind":"official","path":"generator.py","file_url":"https://github.com/jcyk/copyisallyouneed/blob/HEAD/generator.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"962b518e75b8b7af"}},{"code_sha256_prefix":"a4966f0ea189dad1","entry":"SinusoidalPositionalEmbedding","repo":"jcyk/copyisallyouneed","repo_kind":"official","path":"generator.py","file_url":"https://github.com/jcyk/copyisallyouneed/blob/HEAD/generator.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a4966f0ea189dad1"}},{"code_sha256_prefix":"6ee29e1e1f56a934","entry":"label_smoothed_nll_loss","repo":"jcyk/copyisallyouneed","repo_kind":"official","path":"generator.py","file_url":"https://github.com/jcyk/copyisallyouneed/blob/HEAD/generator.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6ee29e1e1f56a934"}},{"code_sha256_prefix":"82d2e8b2f862e956","entry":"CopyTokenDecoder","repo":"jcyk/copyisallyouneed","repo_kind":"official","path":"generator.py","file_url":"https://github.com/jcyk/copyisallyouneed/blob/HEAD/generator.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":"82d2e8b2f862e956"}},{"code_sha256_prefix":"3b3dd55b12f74bcc","entry":"MemGenerator","repo":"jcyk/copyisallyouneed","repo_kind":"official","path":"generator.py","file_url":"https://github.com/jcyk/copyisallyouneed/blob/HEAD/generator.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":"3b3dd55b12f74bcc"}},{"code_sha256_prefix":"b81b5853503a7e75","entry":"MonoEncoder","repo":"jcyk/copyisallyouneed","repo_kind":"official","path":"generator.py","file_url":"https://github.com/jcyk/copyisallyouneed/blob/HEAD/generator.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":"b81b5853503a7e75"}},{"code_sha256_prefix":"869a715ba18c9742","entry":"MultiheadAttention","repo":"jcyk/copyisallyouneed","repo_kind":"official","path":"generator.py","file_url":"https://github.com/jcyk/copyisallyouneed/blob/HEAD/generator.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":"869a715ba18c9742"}},{"code_sha256_prefix":"5a11477d2ae58a9a","entry":"Transformer","repo":"jcyk/copyisallyouneed","repo_kind":"official","path":"generator.py","file_url":"https://github.com/jcyk/copyisallyouneed/blob/HEAD/generator.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":"5a11477d2ae58a9a"}},{"code_sha256_prefix":"c30426c3b9c4f48a","entry":"TransformerLayer","repo":"jcyk/copyisallyouneed","repo_kind":"official","path":"generator.py","file_url":"https://github.com/jcyk/copyisallyouneed/blob/HEAD/generator.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":"c30426c3b9c4f48a"}},{"code_sha256_prefix":"97f8fbbb799fe57a","entry":"search_by_batch","repo":"jcyk/copyisallyouneed","repo_kind":"official","path":"generator.py","file_url":"https://github.com/jcyk/copyisallyouneed/blob/HEAD/generator.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":"97f8fbbb799fe57a"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}