devAnurag commited on
Commit
f0623ea
Β·
verified Β·
1 Parent(s): f63ac44
Files changed (1) hide show
  1. README.md +56 -57
README.md CHANGED
@@ -1,73 +1,72 @@
1
- # 🧠 Finance LLM β€” Fine-Tuned Phi-3 Mini (LoRA + Full Merge)
2
-
3
- This model is a **financial question-answering LLM**, fine-tuned on a curated dataset using:
4
-
5
- - **Base Model:** microsoft/phi-3-mini-4k-instruct
6
- - **Training Method:** LoRA (Rank=16, Alpha=32, Dropout=0.05)
7
- - **Merged Model:** Yes (LoRA + Base fully merged into one model)
8
-
9
  ---
10
-
11
- ## πŸš€ Capabilities
12
-
13
- - βœ“ Financial Q&A
14
- - βœ“ Balance sheet understanding
15
- - βœ“ Profit/Loss interpretation
16
- - βœ“ Ratios / EBITDA / EPS explanation
17
- - βœ“ Market news reasoning
18
- - βœ“ Risk assessment
19
- - βœ“ Investment style suggestions
20
- - βœ“ Banking & loan related Q&A
21
-
22
- This model is optimized for **Indian finance use cases**.
23
-
 
 
 
 
 
 
 
24
  ---
25
 
26
- ## πŸ“Š Training Details
27
 
28
- | Setting | Value |
29
- |--------|-------|
30
- | Epochs | 2 |
31
- | LoRA Rank | 16 |
32
- | Batch Size | 2 |
33
- | Learning Rate | 2e-4 |
34
- | Dataset | FinanceQA (custom cleaned) |
35
- | Hardware | A100 / T4 / Colab GPU |
36
 
37
- Purpose:
38
- To create a small lightweight but finance-aware LLM for **startups, fintech apps, compliance tools, and internal company use**.
39
 
40
- ---
41
-
42
- ## πŸ“ Dataset
43
-
44
- This model was trained on:
45
-
46
- - Financial questions & answers
47
- - Corporate filings
48
- - Stock-market explanations
49
- - Real-world financial reasoning examples
50
-
51
- Dataset used: **AfterQuery/FinanceQA** (public)
52
 
53
  ---
54
 
55
- ## 🧩 Model Architecture
56
-
57
- Based on Phi-3 mini (3.8B parameters) with LoRA applied to:
58
-
59
- - Self-attention QKV projections
60
- - Output projections
61
- - MLP up/down projections
62
-
63
- Merged model = pure FP16 weights β†’ **No LoRA needed at inference**.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
 
65
  ---
66
 
67
- ## πŸ’‘ Usage Example
68
 
69
  ```python
70
- from transformers import AutoModelForCausalLM, AutoTokenizer
71
  import torch
72
 
73
  model_id = "devAnurag/finance_llm_full"
@@ -75,7 +74,7 @@ model_id = "devAnurag/finance_llm_full"
75
  tokenizer = AutoTokenizer.from_pretrained(model_id)
76
  model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16)
77
 
78
- prompt = "Explain EBITDA in simple terms."
79
  inputs = tokenizer(prompt, return_tensors="pt")
80
 
81
  outputs = model.generate(**inputs, max_new_tokens=150)
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: mit
3
+ tags:
4
+ - finance
5
+ - financial-qa
6
+ - finetuned-llm
7
+ - phi3
8
+ - phi-3-mini
9
+ - fintech
10
+ - accounting
11
+ - banking
12
+ - investment
13
+ - risk-analysis
14
+ - lora
15
+ - merged-model
16
+ language:
17
+ - en
18
+ pipeline_tag: text-generation
19
+ base_model: microsoft/phi-3-mini-4k-instruct
20
+ model_name: finance_llm_full
21
+ model_creator: devAnurag
22
+ pretty_name: Finance LLM Full
23
  ---
24
 
25
+ # πŸ’Ž Finance LLM Full β€” Next-Gen Financial Intelligence Model
26
 
27
+ **Finance LLM Full** is a high-performance, fully merged financial Large Language Model (LLM)
28
+ designed to deliver **crystal-clear, accurate, and structured financial reasoning**.
 
 
 
 
 
 
29
 
30
+ It is trained using **LoRA fine-tuning** on top of **Phi-3 Mini 4K Instruct**, and later
31
+ **merged into a single standalone model** for seamless deployment.
32
 
33
+ This model specializes in **Finance, Accounting, Banking, Investment, Stock Markets, and Business Analysis** β€”
34
+ making it ideal for **FinTech products, AI advisors, investment copilots, and enterprise bots**.
 
 
 
 
 
 
 
 
 
 
35
 
36
  ---
37
 
38
+ # ⚑ Why Finance LLM Full is Special
39
+
40
+ ### πŸ”Ή 1. Purpose-Built For Finance
41
+ Unlike general LLMs, this model deeply understands:
42
+ - Balance Sheet Interpretation
43
+ - Profit & Loss Breakdown
44
+ - Cashflow Logic
45
+ - EBITDA / EPS / ROE / DCF
46
+ - Risk & Return Analysis
47
+ - Banking, Loans, Limits, Credit Rules
48
+ - Valuation Basics
49
+ - Investment & Portfolio Concepts
50
+
51
+ ### πŸ”Ή 2. Merged Model β†’ One File, Zero Hassle
52
+ βœ” No LoRA needed
53
+ βœ” No adapter loading
54
+ βœ” Direct plug-and-play
55
+ βœ” Works on CPU / GPU / Colab / Docker
56
+
57
+ ### πŸ”Ή 3. Small Model β†’ Big Capability
58
+ Powered by **Phi-3 Mini**, optimized for:
59
+ - Low latency
60
+ - Low VRAM/RAM usage
61
+ - Clean, structured answers
62
+ - High domain accuracy
63
 
64
  ---
65
 
66
+ # πŸ§ͺ Quick Start (Copy & Run)
67
 
68
  ```python
69
+ from transformers import AutoTokenizer, AutoModelForCausalLM
70
  import torch
71
 
72
  model_id = "devAnurag/finance_llm_full"
 
74
  tokenizer = AutoTokenizer.from_pretrained(model_id)
75
  model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16)
76
 
77
+ prompt = "Explain the difference between EBITDA and Net Profit."
78
  inputs = tokenizer(prompt, return_tensors="pt")
79
 
80
  outputs = model.generate(**inputs, max_new_tokens=150)