{"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/scoi-syntax-augmented-coverage-based-in","title":"SCOI: Syntax-augmented Coverage-based In-context Example Selection for Machine Translation","arxiv_id":"2408.04872","date":"2024-08-09","proceeding":null,"authors":["Chenming Tang","Zhixiang Wang","Yunfang Wu"],"abstract":"In-context learning (ICL) greatly improves the performance of large language models (LLMs) on various down-stream tasks, where the improvement highly depends on the quality of demonstrations. In this work, we introduce syntactic knowledge to select better in-context examples for machine translation (MT). We propose a new strategy, namely Syntax-augmented COverage-based In-context example selection (SCOI), leveraging the deep syntactic structure beyond conventional word matching. Specifically, we measure the set-level syntactic coverage by computing the coverage of polynomial terms with the help of a simplified tree-to-polynomial algorithm, and lexical coverage using word overlap. Furthermore, we devise an alternate selection approach to combine both coverage measures, taking advantage of syntactic and lexical information. We conduct experiments with two multi-lingual LLMs on six translation directions. Empirical results show that our proposed SCOI obtains the highest average COMET score among all learning-free methods, indicating that combining syntactic and lexical coverage successfully helps to select better in-context examples for MT. Our code is available at https://github.com/JamyDon/SCOI.","url_abs":"https://arxiv.org/abs/2408.04872v2","url_pdf":"https://arxiv.org/pdf/2408.04872v2.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":"scoi-syntax-augmented-coverage-based-in","repo_url":"https://github.com/jamydon/scoi","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":null}],"tasks":[{"task_slug":"in-context-learning","task_name":"In-Context Learning"},{"task_slug":"machine-translation","task_name":"Machine Translation"},{"task_slug":"translation","task_name":"Translation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2408.04872","atlas_url":"https://app.syntology.ai/?focus=2408.04872","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2408.04872"}},"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":"deterministic:regex_extraction","url":"https://github.com/hplt-project/sacremoses","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":7,"unverified":2},"by_repo_kind":{"found_in_text":{"samples":9,"ran":7,"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":"9570b2dda6ffa32f","entry":"check","repo":"hplt-project/sacremoses","repo_kind":"found_in_text","path":"audit/attacks.py","file_url":"https://github.com/hplt-project/sacremoses/blob/HEAD/audit/attacks.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9570b2dda6ffa32f"}},{"code_sha256_prefix":"f5a406f30bca0411","entry":"convert_chinese","repo":"hplt-project/sacremoses","repo_kind":"found_in_text","path":"sacremoses/chinese.py","file_url":"https://github.com/hplt-project/sacremoses/blob/HEAD/sacremoses/chinese.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f5a406f30bca0411"}},{"code_sha256_prefix":"2df024e31bf66764","entry":"expected_detok_change","repo":"hplt-project/sacremoses","repo_kind":"found_in_text","path":"audit/differential.py","file_url":"https://github.com/hplt-project/sacremoses/blob/HEAD/audit/differential.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2df024e31bf66764"}},{"code_sha256_prefix":"282cf8e4c7b77fb0","entry":"is_cjk","repo":"hplt-project/sacremoses","repo_kind":"found_in_text","path":"sacremoses/util.py","file_url":"https://github.com/hplt-project/sacremoses/blob/HEAD/sacremoses/util.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"282cf8e4c7b77fb0"}},{"code_sha256_prefix":"053cc6cfb4e44a51","entry":"run","repo":"hplt-project/sacremoses","repo_kind":"found_in_text","path":"audit/attacks.py","file_url":"https://github.com/hplt-project/sacremoses/blob/HEAD/audit/attacks.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"053cc6cfb4e44a51"}},{"code_sha256_prefix":"4ca27c4d1e1cb3da","entry":"xml_escape","repo":"hplt-project/sacremoses","repo_kind":"found_in_text","path":"sacremoses/util.py","file_url":"https://github.com/hplt-project/sacremoses/blob/HEAD/sacremoses/util.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4ca27c4d1e1cb3da"}},{"code_sha256_prefix":"5d5f7123a9021668","entry":"xml_unescape","repo":"hplt-project/sacremoses","repo_kind":"found_in_text","path":"sacremoses/util.py","file_url":"https://github.com/hplt-project/sacremoses/blob/HEAD/sacremoses/util.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5d5f7123a9021668"}},{"code_sha256_prefix":"c6fe46bed16bd015","entry":"main","repo":"hplt-project/sacremoses","repo_kind":"found_in_text","path":"audit/differential.py","file_url":"https://github.com/hplt-project/sacremoses/blob/HEAD/audit/differential.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":"c6fe46bed16bd015"}},{"code_sha256_prefix":"df92c0a0afc56ab2","entry":"run_tree","repo":"hplt-project/sacremoses","repo_kind":"found_in_text","path":"audit/differential.py","file_url":"https://github.com/hplt-project/sacremoses/blob/HEAD/audit/differential.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":"df92c0a0afc56ab2"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}