{"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/context-gates-for-neural-machine-translation","title":"Context Gates for Neural Machine Translation","arxiv_id":"1608.06043","date":"2016-08-22","proceeding":"TACL 2017 1","authors":["Zhaopeng Tu","Yang Liu","Zhengdong Lu","Xiaohua Liu","Hang Li"],"abstract":"In neural machine translation (NMT), generation of a target word depends on\nboth source and target contexts. We find that source contexts have a direct\nimpact on the adequacy of a translation while target contexts affect the\nfluency. Intuitively, generation of a content word should rely more on the\nsource context and generation of a functional word should rely more on the\ntarget context. Due to the lack of effective control over the influence from\nsource and target contexts, conventional NMT tends to yield fluent but\ninadequate translations. To address this problem, we propose context gates\nwhich dynamically control the ratios at which source and target contexts\ncontribute to the generation of target words. In this way, we can enhance both\nthe adequacy and fluency of NMT with more careful control of the information\nflow from contexts. Experiments show that our approach significantly improves\nupon a standard attention-based NMT system by +2.3 BLEU points.","url_abs":"http://arxiv.org/abs/1608.06043v3","url_pdf":"http://arxiv.org/pdf/1608.06043v3.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":"context-gates-for-neural-machine-translation","repo_url":"https://github.com/tuzhaopeng/nmt","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"context-gates-for-neural-machine-translation","repo_url":"https://github.com/ZhenYangIACAS/NMT","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"BSD-3-Clause"}}],"tasks":[{"task_slug":"machine-translation","task_name":"Machine Translation"},{"task_slug":"nmt","task_name":"NMT"},{"task_slug":"translation","task_name":"Translation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=1608.06043","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1608.06043"}},"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/ZhenYangIACAS/NMT","reach":{"status":"ok","spdx":"BSD-3-Clause"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/tuzhaopeng/nmt","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":1,"unverified":3},"by_repo_kind":{"listed":{"samples":4,"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":"89ae4a11d172225e","entry":"split_seg","repo":"ZhenYangIACAS/NMT","repo_kind":"listed","path":"experiments/nmt/eval/plain2sgm.py","file_url":"https://github.com/ZhenYangIACAS/NMT/blob/HEAD/experiments/nmt/eval/plain2sgm.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"89ae4a11d172225e"}},{"code_sha256_prefix":"fb5eb383f3e60371","entry":"create_padded_batch","repo":"ZhenYangIACAS/NMT","repo_kind":"listed","path":"experiments/nmt/encdec.py","file_url":"https://github.com/ZhenYangIACAS/NMT/blob/HEAD/experiments/nmt/encdec.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"fb5eb383f3e60371"}},{"code_sha256_prefix":"6ce77b37ad288326","entry":"extract","repo":"ZhenYangIACAS/NMT","repo_kind":"listed","path":"experiments/nmt/eval/sgm2plain.py","file_url":"https://github.com/ZhenYangIACAS/NMT/blob/HEAD/experiments/nmt/eval/sgm2plain.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"6ce77b37ad288326"}},{"code_sha256_prefix":"dbca8e467000bb31","entry":"none_if_zero","repo":"ZhenYangIACAS/NMT","repo_kind":"listed","path":"experiments/nmt/encdec.py","file_url":"https://github.com/ZhenYangIACAS/NMT/blob/HEAD/experiments/nmt/encdec.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"dbca8e467000bb31"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}