Downloads · 30 days
9
9% of all-time downloads
snoels/FinGEITje-7B-dpo
FinGEITje-7B-dpo is a text generation model from snoels. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as cc-by-nc-4.0.
<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="200" height="32"/
Downloads · 30 days
9
9% of all-time downloads
All-time downloads
100
Public
Repo size
5.4 GB
Likes
2
Public
Click a slice to open those files.
.safetensors671 MB · 99%
From the Hugging Face model README
This model is a fine-tuned version of snoels/FinGEITje-7B-sft on the BramVanroy/ultra_feedback_dutch dataset.
FinGEITje-7B-dpo is a large open Dutch financial language model with 7 billion parameters, based on Mistral 7B. It has been further trained using Direct Preference Optimization (DPO) on AI-generated preference data, aligning the model's responses with human-like preferences in the Dutch language. This alignment process enhances the model's ability to generate more helpful, coherent, and user-aligned responses in financial contexts.
FinGEITje-7B-dpo was fine-tuned on the BramVanroy/ultra_feedback_dutch dataset, which consists of synthetic preference data in Dutch. This dataset includes prompts along with preferred and less preferred responses, allowing the model to learn to generate more aligned responses through DPO.
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Rewards/chosen | Rewards/rejected | Rewards/accuracies | Rewards/margins | Logps/rejected | Logps/chosen | Logits/rejected | Logits/chosen |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 0.1029 | 0.1327 | 100 | 0.1099 | -1.8067 | -5.3683 | 0.9679 | 3.5616 | -892.3373 | -579.9115 | -2.4775 | -2.3705 |
| 0.042 | 0.2654 | 200 | 0.0430 | -3.5129 | -10.6778 | 0.9828 | 7.1649 | -1423.2883 | -750.5289 | -1.9744 | -1.9895 |
| 0.0278 | 0.3981 | 300 | 0.0344 | -3.7335 | -13.5153 | 0.9828 | 9.7818 | -1707.0360 | -772.5893 | -1.7454 | -1.8191 |
| 0.0223 | 0.5308 | 400 | 0.0308 | -3.6554 | -13.7712 | 0.9858 | 10.1158 | -1732.6289 | -764.7831 | -1.8020 | -1.9184 |
| 0.0378 | 0.6635 | 500 | 0.0297 | -4.0018 | -16.3285 | 0.9851 | 12.3266 | -1988.3542 | -799.4221 | -1.6924 | -1.8650 |
| 0.0352 | 0.7962 | 600 | 0.0278 | -3.8104 | -15.6430 | 0.9836 | 11.8327 | -1919.8119 | -780.2752 | -1.7437 | -1.8978 |
| 0.0238 | 0.9289 | 700 | 0.0279 | -3.8974 | -15.9642 | 0.9828 | 12.0668 | -1951.9310 | -788.9780 | -1.7371 | -1.8937 |
FinGEITje-7B-dpo can be utilized using the Hugging Face Transformers library along with PEFT to load the adapters efficiently.
Ensure you have the necessary libraries installed:
pip install torch transformers peft accelerate
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
# Load the tokenizer
tokenizer = AutoTokenizer.from_pretrained("BramVanroy/GEITje-7B-ultra", use_fast=False)
# Load the base model
base_model = AutoModelForCausalLM.from_pretrained("BramVanroy/GEITje-7B-ultra", device_map='auto')
# Load the FinGEITje-7B-dpo model with PEFT adapters
model = PeftModel.from_pretrained(base_model, "snoels/FinGEITje-7B-dpo", device_map='auto')
# Prepare the input
input_text = "Wat zijn de laatste trends in de Nederlandse banksector?"
input_ids = tokenizer.encode(input_text, return_tensors='pt').to(model.device)
# Generate a response
outputs = model.generate(input_ids, max_length=200, num_return_sequences=1)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
We would like to thank:
Link to the paper Link to the arXiv
If you use FinGEITje-7B-dpo in your work, please cite:
@inproceedings{10.1145/3677052.3698628,
author = {Noels, Sander and De Blaere, Jorne and De Bie, Tijl},
title = {A Dutch Financial Large Language Model},
year = {2024},
isbn = {9798400710810},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3677052.3698628},
doi = {10.1145/3677052.3698628},
abstract = {This paper presents FinGEITje, the first Dutch financial Large Language Model (LLM) specifically designed and optimized for various financial tasks. Together with the model, we release a specialized Dutch financial instruction tuning dataset with over 140,000 samples, constructed employing an automated translation and data processing method. The open-source data construction method is provided, facilitating the creation of financial instruction datasets in different languages. To evaluate model performance, the study introduces the first Dutch financial evaluation benchmark, along with an automated evaluation method that utilizes an LLM as an independent evaluator, reducing manual intervention in performance evaluation. The experimental results highlight the superior performance of FinGEITje across five critical Dutch and English financial tasks.},
booktitle = {Proceedings of the 5th ACM International Conference on AI in Finance},
pages = {283–291},
numpages = {9},
keywords = {Financial Large Language Model, Instruction Tuning., Natural Language Processing},
location = {Brooklyn, NY, USA},
series = {ICAIF '24}
}
This model is licensed under the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) license.
For any inquiries or questions, please contact Sander Noels.