๐Ÿ’ฐ FinDAP: Demystifying Domain-adaptive Post-training for Financial LLMs

October 23, 2025 ยท View on GitHub

๐Ÿ’ฐ FinDAP: Demystifying Domain-adaptive Post-training for Financial LLMs

Paper Evaluation Data Training Data Model Code Conference Project Page Research Hub

EMNLP 2025 ๐Ÿ… Oral Presentation (Top 50% of accepted papers, ARR besst paper nomination)


  • ๐Ÿค– Oct 2025: Llama-Fin-8b model released on ๐Ÿค— Hugging Face - state-of-the-art financial LLM!
  • ๐Ÿ‹๏ธ Oct 2025: FinTrain training dataset released on ๐Ÿค— Hugging Face - comprehensive training data for financial LLMs!
  • ๐ŸŽ‰ Sep 2025: Check our Post-training Research Hub for comprehensive resources including FinDAP, tutorials, RAG, and continual pre-training!
  • ๐Ÿ”ง Sep 2025: FinRec training code is now available! Train your own domain-specific financial LLMs with our proven recipes.
  • ๐Ÿ“Š Jan 2025: FinEval benchmark released on ๐Ÿค— Hugging Face - comprehensive evaluation suite for financial LLMs!

๐Ÿ” Research Questions


Given a pre-trained LLM with strong general capabilities (e.g., Llama3-8b-instruct), how can we effectively adapt it to a target domain (e.g., finance) through post-training?

Key Questions We Address:

  • โ“ What criteria are desirable for successful adaptation?
  • โ“ What are the most effective training recipes with respect to data and model?
  • โ“ How do different post-training stages contribute to domain expertise?

โœจ What is FinDAP?


FinDAP is a comprehensive finance-specific post-training framework that includes:

  • ๐ŸŽฏ Systematic capability identification for financial LLMs
  • ๐Ÿ“Š State-of-the-art evaluation framework (FinEval)
  • ๐Ÿ”ง Advanced training recipes with novel preference alignment
  • ๐Ÿ† High-performance model checkpoints (Llama-Fin)

We use the finance domain as a case study to demonstrate effective domain-adaptive post-training on instruction-tuned LLMs.

๐ŸŽฏ Key Contributions


Comprehensive systematic approach to financial LLM domain adaptation

๐Ÿ’ก Contribution๐Ÿ“‹ Description
๐Ÿ“Š Comprehensive GuidanceComplete framework for finance-specific post-training including capability identification, evaluation, data and model recipe design
๐Ÿ”ฌ Systematic ExplorationIn-depth analysis of each post-training stage with emphasis on goals, challenges and effective approaches
๐Ÿ“ˆ Novel Preference AlignmentRevolutionary approach using on-policy trajectories guided by both outcome and process signals
๐Ÿ’ก State-of-the-art Financial LLMLlama-Fin model achieving SOTA performance at 8B parameter scale

๐Ÿ—๏ธ Framework Overview


Figure 1: FinDAP framework overview

Our framework consists of four key components:

ComponentDescriptionFocus
๐ŸŽฏ FinCapCore Capabilities FrameworkSystematic identification of financial LLM capabilities
๐Ÿ”ง FinRecTraining Recipe & MethodologyAdvanced training strategies and preference alignment
๐Ÿ“š FinTrainCurated Training DataSystematically curated datasets for optimal adaptation
๐Ÿ“Š FinEvalComprehensive Evaluation SuiteMulti-dimensional evaluation framework

๐ŸŽฏ FinCap: FinDAP Core Capabilities


We systematically identify the essential capabilities for domain-specific LLMs, focusing on four fundamental areas that enable effective financial domain adaptation:

๐Ÿ›๏ธ The Four Pillars of Financial LLM Capabilities

๐ŸŽฏ Capability๐Ÿ“‹ Description๐Ÿ’ก Example
๐Ÿ—๏ธ Domain ConceptsUnderstanding financial terminology and domain-specific knowledge'Bond' as a loan agreement between investor and borrower
๐Ÿ“ˆ Domain TasksExecuting finance-specific tasks and applicationsStock movement prediction, financial report analysis
๐Ÿง  ReasoningMathematical calculations and logical inference for complex problemsComputing market rates, earnings per share analysis
๐Ÿ’ฌ Instruction FollowingUnderstanding and executing financial task instructionsFollowing trading instructions, Q&A about financial concepts

๐Ÿ” Detailed Capability Analysis

๐Ÿ—๏ธ Domain-Specific Concepts

Financial terminology and domain knowledge form the foundation of expertise.

Financial domains include specialized concepts that differ significantly from general usage. For example:

  • ๐Ÿ“Š Bond: A loan agreement between an investor and borrower
  • ๐Ÿ“ˆ Volatility: A statistical measure of price fluctuation dispersion
  • ๐Ÿ›๏ธ Derivatives: Financial contracts deriving value from underlying assets

Key Challenge: Adapt to domain-specific concepts while preserving general knowledge essential for both domain-specific and general tasks.

๐Ÿ“ˆ Domain-Specific Tasks

Specialized tasks unique to the financial domain.

While many NLP tasks span domains, finance has unique requirements:

  • ๐Ÿ”ฎ Stock Movement Detection: Predicting market trends
  • ๐Ÿ“Š Risk Assessment: Evaluating investment risks
  • ๐Ÿ’ฐ Portfolio Optimization: Strategic asset allocation

Key Challenge: Leverage domain concepts to solve tailored tasks effectively while maintaining broad task competency.

๐Ÿง  Advanced Reasoning

Mathematical and logical reasoning for complex financial analysis.

Financial tasks require sophisticated reasoning capabilities:

  • ๐Ÿงฎ Mathematical Reasoning: Computing financial ratios, valuations
  • ๐Ÿ” Analytical Thinking: Interpreting market trends, company performance
  • ๐Ÿ“ˆ Quantitative Analysis: Processing numerical data and metrics

Key Challenge: Perform complex mathematical reasoning while maintaining accuracy in financial calculations and interpretations.

๐Ÿ’ฌ Instruction Following & Communication

Core capability for both general and domain-specific interactions.

Essential for practical deployment:

  • ๐Ÿ“ Task Understanding: Interpreting financial instructions accurately
  • ๐Ÿ—ฃ๏ธ Conversational Interface: Natural dialogue about financial topics
  • ๐ŸŽฏ Goal-Oriented Response: Providing actionable financial insights

Key Challenge: Maintain natural conversation flow while providing accurate, domain-appropriate responses.

๐Ÿ“ Note: While domains may vary in sensitivity (e.g., medical vs. entertainment) and multi-modality requirements, we focus on these four core capabilities as the foundation for effective domain adaptation. Future work may explore additional aspects such as multi-modal integration and domain-specific ethical considerations.

๐Ÿ”ง FinRec: Training Recipe & Implementation


FinRec provides our complete training methodology for domain-adaptive post-training, featuring joint optimization of continual pre-training and instruction tuning, plus novel preference alignment techniques.

๐Ÿ—๏ธ Training Pipeline Overview

Our training recipe consists of three progressive stages:

๐ŸŽฏ Stage๐Ÿ“‹ Components๐Ÿ” Purpose
Stage 1Joint CPT + SFTSimultaneous domain knowledge acquisition and instruction following
Stage 2Curriculum LearningProgressive difficulty scaling with multiple curriculum groups
Stage 3Offline RLPreference alignment using outcome and process signals

๐Ÿš€ Quick Start Training Guide

Train your own financial LLM with FinRec in 3 steps!

Step 1: Environment Setup ๐Ÿ“ฆ

# Create and activate conda environment
conda create -n FinDAP python=3.10 && conda activate FinDAP

# Install dependencies
pip install -r requirements.txt

Step 2: Joint CPT + SFT Training โš™๏ธ

Joint Continual Pre-training and Supervised Fine-tuning with curriculum learning:

๐Ÿฅ‡ Curriculum Group 1: Foundation Training

Starting from base model (e.g., Llama3-8B-Instruct):

# Foundation curriculum - basic financial concepts and tasks
./scripts/cpt_sft/mix_cpt_mix_sft_extend_book_exercise_downsample_from_base.sh

Key Features:

  • ๐Ÿ“š Mixed CPT: Financial texts + general domain retention
  • ๐ŸŽฏ Mixed SFT: Basic instruction following + domain tasks
  • ๐Ÿ“– Extended Books: Financial literature and educational content
  • ๐Ÿ”„ Downsampling: Balanced data distribution
๐Ÿฅˆ Curriculum Group 2: Advanced Training

Building on Group 1 results:

# Advanced curriculum - complex reasoning and specialized tasks
./scripts/cpt_sft/mix_cpt_mix_sft_extend_book_exercise_downsample_from_v1.sh

Key Features:

  • ๐Ÿง  Advanced Reasoning: Complex financial calculations and analysis
  • ๐Ÿ’ผ Specialized Tasks: Professional-level financial applications
  • ๐Ÿ”— Sequential Learning: Builds upon previous stage knowledge
  • โšก Optimized Data Mix: Refined data proportions for advanced capabilities

Step 3: Preference Alignment with Offline RL ๐ŸŽฏ

Revolutionary preference learning using both outcome and process signals:

# Offline RL with final answer preference and stepwise corrective preference
./scripts/offline_rl/rpo_cfa_stepwise.sh

Novel Features:

  • ๐ŸŽฏ Dual Signal Learning: Outcome-based + process-based preference optimization
  • ๐Ÿ”„ Stepwise Correction: Fine-grained error correction during reasoning
  • ๐Ÿค– Generative Reward Model: On-policy trajectory construction
  • ๐Ÿ“ˆ RPO Algorithm: Robust Policy Optimization for financial domain

๐Ÿ† Key Training Innovations

๐Ÿ’ก Innovation๐Ÿ“‹ Description๐ŸŽฏ Benefit
Joint CPT+SFTSimultaneous knowledge and instruction optimizationPrevents catastrophic forgetting
Curriculum DesignProgressive complexity scalingImproved learning stability
Dual PreferenceOutcome + process signal alignmentEnhanced reasoning accuracy
Stepwise CorrectionGranular error identification and fixingBetter mathematical reasoning

๐Ÿ† Llama-Fin: Our High-Performance Financial LLM


The culmination of our FinDAP framework is Llama-Fin, a state-of-the-art financial LLM that achieves exceptional performance across diverse financial tasks.

๐ŸŽฏ Model Highlights

  • ๐Ÿฅ‡ State-of-the-art Performance: Leading results on financial benchmarks
  • ๐ŸŽฏ 8B Parameter Efficiency: Optimal balance of performance and computational efficiency
  • ๐Ÿง  Multi-capability Excellence: Strong performance across concepts, tasks, reasoning, and instruction following
  • ๐Ÿ“ˆ Novel Contributions: Demonstrates effectiveness of dual preference learning and joint CPT+SFT training

๐Ÿ“Š Performance Note: Detailed results and comparisons available in our paper and evaluation using FinEval.


๐Ÿ“Š FinEval: Comprehensive Evaluation Suite


Dataset

Our evaluation framework provides a comprehensive assessment of the four core capabilities through carefully curated development and held-out evaluation sets.

Figure 2: FinEval evaluation framework โ€ข Comprehensive assessment across multiple dimensions and task types
New datasets released with FinDAP are highlighted

๐Ÿ“ˆ Evaluation Dimensions

Our evaluation framework assesses models across multiple orthogonal dimensions:

๐ŸŽฏ Dimension๐Ÿ“‹ Categories๐Ÿ” Purpose
๐Ÿ”„ Task TypesSimilar (seen) โ€ข Novel (unseen)Assess generalization to new task categories
๐ŸŽฏ Task CategoriesGeneral โ€ข Domain-Specific โ€ข ReasoningEvaluate different skill requirements
๐Ÿ“ Evaluation MethodsDirect Answer โ€ข Chain-of-ThoughtTest reasoning transparency and accuracy

๐Ÿ† Key Features

  • โœ… Multi-dimensional Assessment: Orthogonal evaluation across task types, categories, and methods
  • โœ… Development & Held-out Sets: Proper train/test split for reliable evaluation
  • โœ… Novel Task Generalization: Assessment on completely unseen task categories
  • โœ… Reasoning Evaluation: Both direct answers and step-by-step reasoning assessment
  • โœ… Comprehensive Coverage: Aligned with FinCap capabilities framework

๐Ÿš€ Quick Start Guide

Get started with FinEval in 3 easy steps!

FinEval integrates seamlessly with standard evaluation frameworks. We recommend using LLM Evaluation Harness for effortless dataset loading and evaluation.

Step 1: Environment Setup ๐Ÿ“ฆ

# Use existing FinDAP environment or create new one
conda create -n FinDAP python=3.10 && conda activate FinDAP

# Clone the evaluation harness
git clone --depth 1 https://github.com/EleutherAI/lm-evaluation-harness
cd lm-evaluation-harness
pip install -e .

# Install additional evaluation dependencies
pip install datasets transformers vllm

Step 2: Configuration โš™๏ธ

Create a task configuration file (example: cfa-challenge.yaml):

task: cfa-challenge
dataset_path: Salesforce/FinEval
dataset_name: CFA-Challenge
output_type: generate_until
test_split: test
doc_to_text: query
doc_to_target: answer
should_decontaminate: true
doc_to_decontamination_query: query
generation_kwargs:
  until:
    - "</s>"
    - "<|im_end|>"
    - "<|eot_id|>"
    - "<|end_of_text|>"
    - "<|end|>"
    - "<|endoftext|>"
  do_sample: false
  temperature: 0.0
  max_gen_toks: 8000
metric_list:
  - metric: exact_match
    aggregation: mean
    higher_is_better: true
    ignore_case: true
    ignore_punctuation: true
metadata:
  version: 1.0

Step 3: Evaluation ๐ŸŽฏ

# Login to Hugging Face
huggingface-cli login --token {YOUR_HF_TOKEN}

# Set environment variables
export HF_DATASETS_CACHE={YOUR_CACHE_LOC}
export TRANSFORMERS_CACHE={YOUR_CACHE_LOC}
export TRUST_REMOTE_CODE=1

# Configure evaluation
system_prompt="Please act as a CFA exam taker and evaluate the given scenario to choose the most appropriate answer from options A, B, and C. Start by offering a brief explanation of your thought process and reasoning, up to 100 words. After the explanation, select your answer using the format: 'Selection: [[A]]' (e.g., 'Explanation: (your explanation)\nSelection: [[A]]'). If you find no answer is correct, directly mention it"

model="Salesforce/Llama-Fin-8b"

# Run evaluation
lm_eval --apply_chat_template --model vllm --log_samples --write_out \
  --model_args pretrained=${model},max_length=8000,dtype=bfloat16,trust_remote_code=True,tensor_parallel_size={YOUR_NUM_GPU},gpu_memory_utilization=0.6 \
  --system_instruction "$system_prompt" \
  --tasks cfa-challenge \
  --device cuda \
  --output_path {YOUR_OUTPUT_LOC} \
  --batch_size auto \
  --num_fewshot 0

โš–๏ธ Ethical Considerations


๐Ÿ”ฌ Research Purpose Only: This release supports academic research as described in our EMNLP 2025 paper.

This release is for research purposes only in support of an academic paper. Our datasets and code are not specifically designed or evaluated for all downstream purposes. We strongly recommend users evaluate and address potential concerns related to accuracy, safety, and fairness before model deployment. We encourage users to consider the common limitations of AI, comply with applicable laws, and leverage best practices when selecting use cases, particularly for high-risk scenarios where errors or misuse could significantly impact peopleโ€™s lives, rights, or safety. For further guidance on use cases, refer to our Salesforce AUP and AI AUP

๐Ÿ“ Citation


If you find our project helpful, please consider citing our paper ๐Ÿ˜Š

Citation

@misc{ke2025demystifyingdomainadaptiveposttrainingfinancial,
      title={Demystifying Domain-adaptive Post-training for Financial LLMs}, 
      author={Zixuan Ke and Yifei Ming and Xuan-Phi Nguyen and Caiming Xiong and Shafiq Joty},
      year={2025},
      eprint={2501.04961},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2501.04961}, 
}

Built with โค๏ธ by the Salesforce AI Research team

Feel free to contact Zixuan Ke via email: zixuan.ke@salesforce.com