{"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/learning-kernel-smoothed-machine-translation","title":"Learning Kernel-Smoothed Machine Translation with Retrieved Examples","arxiv_id":"2109.09991","date":"2021-09-21","proceeding":"EMNLP 2021 11","authors":["Qingnan Jiang","Mingxuan Wang","Jun Cao","Shanbo Cheng","ShuJian Huang","Lei LI"],"abstract":"How to effectively adapt neural machine translation (NMT) models according to emerging cases without retraining? Despite the great success of neural machine translation, updating the deployed models online remains a challenge. Existing non-parametric approaches that retrieve similar examples from a database to guide the translation process are promising but are prone to overfit the retrieved examples. In this work, we propose to learn Kernel-Smoothed Translation with Example Retrieval (KSTER), an effective approach to adapt neural machine translation models online. Experiments on domain adaptation and multi-domain machine translation datasets show that even without expensive retraining, KSTER is able to achieve improvement of 1.1 to 1.5 BLEU scores over the best existing online adaptation methods. The code and trained models are released at https://github.com/jiangqn/KSTER.","url_abs":"https://arxiv.org/abs/2109.09991v2","url_pdf":"https://arxiv.org/pdf/2109.09991v2.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":"learning-kernel-smoothed-machine-translation","repo_url":"https://github.com/jiangqn/kster","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"learning-kernel-smoothed-machine-translation","repo_url":"https://github.com/cordercorder/knn-models","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"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":{"atlas_url":"https://app.syntology.ai/?focus=2109.09991","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2109.09991"}},"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/jiangqn/kster","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/cordercorder/knn-models","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/jiangqn/KSTER","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":2,"unverified":8},"by_repo_kind":{"official":{"samples":10,"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":0,"samples":[{"code_sha256_prefix":"2c10660b4d784c0d","entry":"FaissIndex","repo":"jiangqn/KSTER","repo_kind":"official","path":"joeynmt/combiners.py","file_url":"https://github.com/jiangqn/KSTER/blob/HEAD/joeynmt/combiners.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2c10660b4d784c0d"}},{"code_sha256_prefix":"9cd13fd04403e663","entry":"GaussianKernel","repo":"jiangqn/KSTER","repo_kind":"official","path":"joeynmt/combiners.py","file_url":"https://github.com/jiangqn/KSTER/blob/HEAD/joeynmt/combiners.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9cd13fd04403e663"}},{"code_sha256_prefix":"2519fc0edb3124c4","entry":"Combiner","repo":"jiangqn/KSTER","repo_kind":"official","path":"joeynmt/combiners.py","file_url":"https://github.com/jiangqn/KSTER/blob/HEAD/joeynmt/combiners.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2519fc0edb3124c4"}},{"code_sha256_prefix":"604e698c3ad33407","entry":"Database","repo":"jiangqn/KSTER","repo_kind":"official","path":"joeynmt/combiners.py","file_url":"https://github.com/jiangqn/KSTER/blob/HEAD/joeynmt/combiners.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"604e698c3ad33407"}},{"code_sha256_prefix":"12081610491cba7c","entry":"DynamicCombiner","repo":"jiangqn/KSTER","repo_kind":"official","path":"joeynmt/combiners.py","file_url":"https://github.com/jiangqn/KSTER/blob/HEAD/joeynmt/combiners.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"12081610491cba7c"}},{"code_sha256_prefix":"922f84b50145339d","entry":"EnhancedDatabase","repo":"jiangqn/KSTER","repo_kind":"official","path":"joeynmt/combiners.py","file_url":"https://github.com/jiangqn/KSTER/blob/HEAD/joeynmt/combiners.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"922f84b50145339d"}},{"code_sha256_prefix":"85f94e4c607f3908","entry":"Kernel","repo":"jiangqn/KSTER","repo_kind":"official","path":"joeynmt/combiners.py","file_url":"https://github.com/jiangqn/KSTER/blob/HEAD/joeynmt/combiners.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"85f94e4c607f3908"}},{"code_sha256_prefix":"ecf1add161d46a9b","entry":"build_scheduler","repo":"jiangqn/kster","repo_kind":"official","path":"joeynmt/builders.py","file_url":"https://github.com/jiangqn/kster/blob/HEAD/joeynmt/builders.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ecf1add161d46a9b"}},{"code_sha256_prefix":"2b08b87924c54731","entry":"generate_id","repo":"jiangqn/kster","repo_kind":"official","path":"joeynmt/build_database.py","file_url":"https://github.com/jiangqn/kster/blob/HEAD/joeynmt/build_database.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2b08b87924c54731"}},{"code_sha256_prefix":"cb329af957271d21","entry":"token_batch_size_fn","repo":"jiangqn/kster","repo_kind":"official","path":"joeynmt/data.py","file_url":"https://github.com/jiangqn/kster/blob/HEAD/joeynmt/data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"cb329af957271d21"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}