{"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/demystifying-domain-adaptive-post-training","title":"Demystifying Domain-adaptive Post-training for Financial LLMs","arxiv_id":"2501.04961","date":"2025-01-09","proceeding":null,"authors":["Zixuan Ke","Yifei Ming","Xuan-Phi Nguyen","Caiming Xiong","Shafiq Joty"],"abstract":"Domain-adaptive post-training of large language models (LLMs) has emerged as a promising approach for specialized domains such as medicine and finance. However, significant challenges remain in identifying optimal adaptation criteria and training strategies across varying data and model configurations. To address these challenges, we introduce FINDAP, a systematic and fine-grained investigation into domain adaptive post-training of LLMs for the finance domain. Our approach consists of four key components: FinCap, which defines the core capabilities required for the target domain; FinRec, an effective training recipe that jointly optimizes continual pre-training and instruction-following, along with a novel preference data distillation method leveraging process signals from a generative reward model; FinTrain, a curated set of training datasets supporting FinRec; and FinEval, a comprehensive evaluation suite aligned with FinCap. The resulting model, Llama-Fin, achieves state-of-the-art performance across a wide range of financial tasks. Our analysis also highlights how each post-training stage contributes to distinct capabilities, uncovering specific challenges and effective solutions, providing valuable insights for domain adaptation of LLMs.","url_abs":"https://arxiv.org/abs/2501.04961v2","url_pdf":"https://arxiv.org/pdf/2501.04961v2.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":"demystifying-domain-adaptive-post-training","repo_url":"https://github.com/salesforceairesearch/findap","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"continual-pretraining","task_name":"Continual Pretraining"},{"task_slug":"domain-adaptation","task_name":"Domain Adaptation"},{"task_slug":"instruction-following","task_name":"Instruction Following"}],"methods":[{"method_slug":"set","method_name":"SET"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2501.04961","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2501.04961"}},"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/salesforceairesearch/findap","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":2,"ran_draft_wrong":2,"unverified":9},"by_repo_kind":{"official":{"samples":13,"ran":4,"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":13,"samples":[{"code_sha256_prefix":"d4a53ff33a6fcd12","entry":"get_max_seqlen_in_batch","repo":"salesforceairesearch/findap","repo_kind":"official","path":"FinDAP/utils/packing/monkey_patch_packing.py","file_url":"https://github.com/salesforceairesearch/findap/blob/HEAD/FinDAP/utils/packing/monkey_patch_packing.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"d4a53ff33a6fcd12"}},{"code_sha256_prefix":"ebd151f2b9fc07af","entry":"get_model","repo":"salesforceairesearch/findap","repo_kind":"official","path":"FinDAP/utils/model.py","file_url":"https://github.com/salesforceairesearch/findap/blob/HEAD/FinDAP/utils/model.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"ebd151f2b9fc07af"}},{"code_sha256_prefix":"6167fdcdd4d5d961","entry":"get_unpad_data","repo":"salesforceairesearch/findap","repo_kind":"official","path":"FinDAP/utils/packing/monkey_patch_packing.py","file_url":"https://github.com/salesforceairesearch/findap/blob/HEAD/FinDAP/utils/packing/monkey_patch_packing.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"6167fdcdd4d5d961"}},{"code_sha256_prefix":"eb4492b8e8e4c8a7","entry":"human_format","repo":"salesforceairesearch/findap","repo_kind":"official","path":"FinDAP/utils/model.py","file_url":"https://github.com/salesforceairesearch/findap/blob/HEAD/FinDAP/utils/model.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":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"eb4492b8e8e4c8a7"}},{"code_sha256_prefix":"84ea29bd52a389a1","entry":"compute_loss_for_model_class","repo":"salesforceairesearch/findap","repo_kind":"official","path":"FinDAP/utils/packing/assert_packing_loss.py","file_url":"https://github.com/salesforceairesearch/findap/blob/HEAD/FinDAP/utils/packing/assert_packing_loss.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"84ea29bd52a389a1"}},{"code_sha256_prefix":"697041871781fa2d","entry":"compute_loss_of_model","repo":"salesforceairesearch/findap","repo_kind":"official","path":"FinDAP/utils/packing/assert_packing_loss.py","file_url":"https://github.com/salesforceairesearch/findap/blob/HEAD/FinDAP/utils/packing/assert_packing_loss.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"697041871781fa2d"}},{"code_sha256_prefix":"171a7c31640892cd","entry":"convert_token_type_ids_to_labels","repo":"salesforceairesearch/findap","repo_kind":"official","path":"FinDAP/utils/data.py","file_url":"https://github.com/salesforceairesearch/findap/blob/HEAD/FinDAP/utils/data.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"171a7c31640892cd"}},{"code_sha256_prefix":"f1cc5b38196d54be","entry":"create_labels_from_input_ids","repo":"salesforceairesearch/findap","repo_kind":"official","path":"FinDAP/utils/packing/assert_packing_loss.py","file_url":"https://github.com/salesforceairesearch/findap/blob/HEAD/FinDAP/utils/packing/assert_packing_loss.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"f1cc5b38196d54be"}},{"code_sha256_prefix":"d27d234a55d8361e","entry":"get_handler","repo":"salesforceairesearch/findap","repo_kind":"official","path":"FinDAP/utils/common.py","file_url":"https://github.com/salesforceairesearch/findap/blob/HEAD/FinDAP/utils/common.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"d27d234a55d8361e"}},{"code_sha256_prefix":"9b01a85d9a4d9dd3","entry":"get_warmup_steps","repo":"salesforceairesearch/findap","repo_kind":"official","path":"FinDAP/utils/optimize.py","file_url":"https://github.com/salesforceairesearch/findap/blob/HEAD/FinDAP/utils/optimize.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"9b01a85d9a4d9dd3"}},{"code_sha256_prefix":"ecadd5acaff4db07","entry":"load_balancing_loss_func","repo":"salesforceairesearch/findap","repo_kind":"official","path":"FinDAP/utils/packing/monkey_patch_packing.py","file_url":"https://github.com/salesforceairesearch/findap/blob/HEAD/FinDAP/utils/packing/monkey_patch_packing.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"ecadd5acaff4db07"}},{"code_sha256_prefix":"d3c83499bcaf3c6b","entry":"print_model_report","repo":"salesforceairesearch/findap","repo_kind":"official","path":"FinDAP/utils/model.py","file_url":"https://github.com/salesforceairesearch/findap/blob/HEAD/FinDAP/utils/model.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"d3c83499bcaf3c6b"}},{"code_sha256_prefix":"7175b3832014a105","entry":"share_argument","repo":"salesforceairesearch/findap","repo_kind":"official","path":"FinDAP/config.py","file_url":"https://github.com/salesforceairesearch/findap/blob/HEAD/FinDAP/config.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":false,"mcp_get_code":{"code_sha256":"7175b3832014a105"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}