{"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/llms-are-few-shot-in-context-low-resource","title":"LLMs Are Few-Shot In-Context Low-Resource Language Learners","arxiv_id":"2403.16512","date":"2024-03-25","proceeding":null,"authors":["Samuel Cahyawijaya","Holy Lovenia","Pascale Fung"],"abstract":"In-context learning (ICL) empowers large language models (LLMs) to perform diverse tasks in underrepresented languages using only short in-context information, offering a crucial avenue for narrowing the gap between high-resource and low-resource languages. Nonetheless, there is only a handful of works explored ICL for low-resource languages with most of them focusing on relatively high-resource languages, such as French and Spanish. In this work, we extensively study ICL and its cross-lingual variation (X-ICL) on 25 low-resource and 7 relatively higher-resource languages. Our study not only assesses the effectiveness of ICL with LLMs in low-resource languages but also identifies the shortcomings of in-context label alignment, and introduces a more effective alternative: query alignment. Moreover, we provide valuable insights into various facets of ICL for low-resource languages. Our study concludes the significance of few-shot in-context information on enhancing the low-resource understanding quality of LLMs through semantically relevant information by closing the language gap in the target language and aligning the semantics between the targeted low-resource and the high-resource language that the model is proficient in. Our work highlights the importance of advancing ICL research, particularly for low-resource languages. Our code is publicly released at https://github.com/SamuelCahyawijaya/in-context-alignment","url_abs":"https://arxiv.org/abs/2403.16512v5","url_pdf":"https://arxiv.org/pdf/2403.16512v5.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":"llms-are-few-shot-in-context-low-resource","repo_url":"https://github.com/samuelcahyawijaya/in-context-alignment","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"in-context-learning","task_name":"In-Context Learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2403.16512","atlas_url":"https://app.syntology.ai/?focus=2403.16512","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2403.16512"}},"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/samuelcahyawijaya/in-context-alignment","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":3,"unverified":3},"by_repo_kind":{"official":{"samples":6,"ran":3,"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":"ac815abb550453ca","entry":"dict_list_to_list_dict","repo":"samuelcahyawijaya/in-context-alignment","repo_kind":"official","path":"src/prompter/icl_prompter.py","file_url":"https://github.com/samuelcahyawijaya/in-context-alignment/blob/HEAD/src/prompter/icl_prompter.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":"ac815abb550453ca"}},{"code_sha256_prefix":"1d679089a879169f","entry":"generate_input_label","repo":"samuelcahyawijaya/in-context-alignment","repo_kind":"official","path":"icl_sample_preview.py","file_url":"https://github.com/samuelcahyawijaya/in-context-alignment/blob/HEAD/icl_sample_preview.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":"1d679089a879169f"}},{"code_sha256_prefix":"0ed0c49b6d7441b5","entry":"load_dataset","repo":"samuelcahyawijaya/in-context-alignment","repo_kind":"official","path":"src/dataset_utils.py","file_url":"https://github.com/samuelcahyawijaya/in-context-alignment/blob/HEAD/src/dataset_utils.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":"0ed0c49b6d7441b5"}},{"code_sha256_prefix":"c632da6c2e7ea811","entry":"get_logprobs","repo":"samuelcahyawijaya/in-context-alignment","repo_kind":"official","path":"src/classifier.py","file_url":"https://github.com/samuelcahyawijaya/in-context-alignment/blob/HEAD/src/classifier.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":"c632da6c2e7ea811"}},{"code_sha256_prefix":"edb1a675d6d9b7e1","entry":"get_logprobs_batch","repo":"samuelcahyawijaya/in-context-alignment","repo_kind":"official","path":"src/classifier.py","file_url":"https://github.com/samuelcahyawijaya/in-context-alignment/blob/HEAD/src/classifier.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":"edb1a675d6d9b7e1"}},{"code_sha256_prefix":"25ebd0d47fc576a2","entry":"predict_classification","repo":"samuelcahyawijaya/in-context-alignment","repo_kind":"official","path":"src/classifier.py","file_url":"https://github.com/samuelcahyawijaya/in-context-alignment/blob/HEAD/src/classifier.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":"25ebd0d47fc576a2"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}