{"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/g-dig-towards-gradient-based-diverse-and-high","title":"G-DIG: Towards Gradient-based Diverse and High-quality Instruction Data Selection for Machine Translation","arxiv_id":"2405.12915","date":"2024-05-21","proceeding":null,"authors":["Xingyuan Pan","Luyang Huang","Liyan Kang","Zhicheng Liu","Yu Lu","Shanbo Cheng"],"abstract":"Large Language Models (LLMs) have demonstrated remarkable abilities in general scenarios. Instruction finetuning empowers them to align with humans in various tasks. Nevertheless, the Diversity and Quality of the instruction data remain two main challenges for instruction finetuning. With regard to this, in this paper, we propose a novel gradient-based method to automatically select high-quality and diverse instruction finetuning data for machine translation. Our key innovation centers around analyzing how individual training examples influence the model during training. Specifically, we select training examples that exert beneficial influences on the model as high-quality ones by means of Influence Function plus a small high-quality seed dataset. Moreover, to enhance the diversity of the training data we maximize the variety of influences they have on the model by clustering on their gradients and resampling. Extensive experiments on WMT22 and FLORES translation tasks demonstrate the superiority of our methods, and in-depth analysis further validates their effectiveness and generalization.","url_abs":"https://arxiv.org/abs/2405.12915v2","url_pdf":"https://arxiv.org/pdf/2405.12915v2.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":"g-dig-towards-gradient-based-diverse-and-high","repo_url":"https://github.com/xypan0/G-DIG","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"diversity","task_name":"Diversity"},{"task_slug":"machine-translation","task_name":"Machine Translation"},{"task_slug":"translation","task_name":"Translation"}],"methods":[{"method_slug":"align","method_name":"ALIGN"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2405.12915","atlas_url":"https://app.syntology.ai/?focus=2405.12915","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.12915"}},"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/xypan0/G-DIG","reach":{"status":"ok"}}],"summary":{"ran":2,"unverified":7},"by_repo_kind":{"official":{"samples":9,"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":9,"samples":[{"code_sha256_prefix":"cdc59dd6fe0dbb68","entry":"generate_and_tokenize_prompt","repo":"xypan0/G-DIG","repo_kind":"official","path":"dataset/utils.py","file_url":"https://github.com/xypan0/G-DIG/blob/HEAD/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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cdc59dd6fe0dbb68"}},{"code_sha256_prefix":"ab5571ae1e8a8115","entry":"to_device","repo":"xypan0/G-DIG","repo_kind":"official","path":"kfac_launcher.py","file_url":"https://github.com/xypan0/G-DIG/blob/HEAD/kfac_launcher.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":"ab5571ae1e8a8115"}},{"code_sha256_prefix":"c014368b984b2b9d","entry":"FIM","repo":"xypan0/G-DIG","repo_kind":"official","path":"nngeometry/lm_metrics.py","file_url":"https://github.com/xypan0/G-DIG/blob/HEAD/nngeometry/lm_metrics.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":"c014368b984b2b9d"}},{"code_sha256_prefix":"414a4faedd78e894","entry":"FIM","repo":"xypan0/G-DIG","repo_kind":"official","path":"nngeometry/lm_metrics_para.py","file_url":"https://github.com/xypan0/G-DIG/blob/HEAD/nngeometry/lm_metrics_para.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":"414a4faedd78e894"}},{"code_sha256_prefix":"0e696f0733ddd4a0","entry":"FIM","repo":"xypan0/G-DIG","repo_kind":"official","path":"nngeometry/metrics.py","file_url":"https://github.com/xypan0/G-DIG/blob/HEAD/nngeometry/metrics.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":"0e696f0733ddd4a0"}},{"code_sha256_prefix":"0945bf43d2c78e66","entry":"FIM_MonteCarlo","repo":"xypan0/G-DIG","repo_kind":"official","path":"nngeometry/lm_metrics.py","file_url":"https://github.com/xypan0/G-DIG/blob/HEAD/nngeometry/lm_metrics.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":"0945bf43d2c78e66"}},{"code_sha256_prefix":"78dde2f177397247","entry":"FIM_MonteCarlo","repo":"xypan0/G-DIG","repo_kind":"official","path":"nngeometry/lm_metrics_para.py","file_url":"https://github.com/xypan0/G-DIG/blob/HEAD/nngeometry/lm_metrics_para.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":"78dde2f177397247"}},{"code_sha256_prefix":"ecc80fe17400e3d6","entry":"FIM_MonteCarlo","repo":"xypan0/G-DIG","repo_kind":"official","path":"nngeometry/metrics.py","file_url":"https://github.com/xypan0/G-DIG/blob/HEAD/nngeometry/metrics.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":"ecc80fe17400e3d6"}},{"code_sha256_prefix":"e3cf12a7afd9f489","entry":"to_device","repo":"xypan0/G-DIG","repo_kind":"official","path":"query_loss_mapper.py","file_url":"https://github.com/xypan0/G-DIG/blob/HEAD/query_loss_mapper.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":"e3cf12a7afd9f489"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}