|
|
---
|
|
|
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>
|
|
|
|