File size: 4,060 Bytes
2dc7acf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
---

license: mit
tags:
- finance
- nlp
- sentiment-analysis
- large-language-models
- fintech
- robo-advisor
- technical-analysis
- prompt-engineering
- chatgpt
- fingpt
pipeline_tag: text-generation
---


# FinGPT: Open-Source Financial Large Language Models

<div align="center">
<img src="https://github.com/AI4Finance-Foundation/FinGPT/assets/31713746/e0371951-1ce1-488e-aa25-0992dafcc139" width="30%">
</div>

## Model Description

FinGPT is an open-source financial large language model that revolutionizes the financial industry by providing accessible, lightweight, and cost-effective solutions for financial tasks. Unlike proprietary models like BloombergGPT, FinGPT democratizes financial AI by offering:

- **Lightweight Adaptation**: Fine-tuning costs less than $300 vs $3M for BloombergGPT
- **Real-time Updates**: Monthly/weekly model updates through automatic data curation
- **RLHF Integration**: Reinforcement Learning from Human Feedback for personalized preferences
- **Multi-language Support**: English and Chinese market data processing

## Key Features

### State-of-the-Art Performance
- **FinGPT v3.3**: Best trainable and inferable model for sentiment analysis on single RTX 3090
- **Superior to GPT-4**: Outperforms GPT-4 and ChatGPT fine-tuning in financial tasks
- **Cost-Effective**: 17.25 hours training on RTX 3090 for $17.25

### Comprehensive Benchmark Results
| Model | FPB | FiQA-SA | TFNS | NWGI | Device | Time | Cost |
|-------|-----|---------|------|------|--------|------|------|
| FinGPT v3.3 | **0.882** | 0.874 | **0.903** | **0.643** | RTX 3090 | 17.25h | $17.25 |
| GPT-4 | 0.833 | 0.630 | 0.808 | - | - | - | - |
| BloombergGPT | 0.511 | 0.751 | - | - | 512×A100 | 53 days | $2.67M |

### Multi-Task Capabilities
- Financial Sentiment Analysis
- Financial Relation Extraction  
- Financial Headline Classification
- Financial Named Entity Recognition
- Financial Q&A
- Robo-Advisor Services

## Model Architecture

FinGPT embraces a full-stack framework with five layers:

1. **Data Source Layer**: Comprehensive market coverage with real-time information
2. **Data Engineering Layer**: Real-time NLP data processing
3. **LLMs Layer**: Fine-tuning methodologies (LoRA, QLoRA)
4. **Task Layer**: Fundamental financial tasks and benchmarks
5. **Application Layer**: Practical applications and demos

## Available Models

### Multi-Task Models
- `fingpt-mt_llama2-7b_lora`: Fine-tuned Llama2-7b with LoRA
- `fingpt-mt_falcon-7b_lora`: Fine-tuned Falcon-7b with LoRA
- `fingpt-mt_chatglm2-6b_lora`: Fine-tuned ChatGLM2-6b with LoRA

### Specialized Models
- `fingpt-sentiment_llama2-13b_lora`: Financial sentiment analysis
- `fingpt-forecaster_dow30_llama2-7b_lora`: Stock price forecasting

## Quick Start

### Installation
```bash

pip install fingpt

```

### Basic Usage
```python

from fingpt import FinGPT



# Initialize model

model = FinGPT.from_pretrained("FinGPT/fingpt-sentiment_llama2-13b_lora")



# Financial sentiment analysis

text = "Apple Inc. reported strong quarterly earnings, beating analyst expectations."

result = model.analyze_sentiment(text)

print(result)  # Output: positive

```

## Citation

```bibtex

@article{yang2023fingpt,

  title={FinGPT: Open-Source Financial Large Language Models},

  author={Yang, Hongyang and Liu, Xiao-Yang and Wang, Christina Dan},

  journal={FinLLM Symposium at IJCAI 2023},

  year={2023}

}

```

## License

MIT License

## Disclaimer

This model is for academic and research purposes only. Nothing herein is financial advice, and NOT a recommendation to trade real money. Please use common sense and always consult a professional before trading or investing.

## Community

- [GitHub Repository](https://github.com/AI4Finance-Foundation/FinGPT)
- [Discord Community](https://discord.gg/trsr8SXpW5)
- [AI4Finance Website](https://ai4finance.org)

---

<div align="center">
<strong>FinGPT: Democratizing Financial AI for Everyone</strong>
</div>