Downloads · 30 days
0
glen-louis/finreason-qwen2.5-7b-dpo
finreason-qwen2.5-7b-dpo is a machine learning model from glen-louis. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Financial reasoning LLM fine-tuned on FinQA (SEC earnings reports). SFT + DPO alignment pipeline on top of Qwen/Qwen2.5-7B-Instruct.
Downloads · 30 days
0
Access
Public
Updated Aug 7, 2026
Repo size
334 MB
Likes
0
Public
Click a slice to open those files.
.safetensors162 MB · 93%
From the Hugging Face model README
Financial reasoning LLM fine-tuned on FinQA (SEC earnings reports).
SFT + DPO alignment pipeline on top of Qwen/Qwen2.5-7B-Instruct.
| Stage | Accuracy | Perplexity |
|---|---|---|
| Base | 52.2% | 6.6 |
| SFT | 58.0% | 2.9 |
| DPO | 59.2% | 2.9 |
DPO win rate vs SFT: 63.0% (contested pairs only; the sample is small, so treat the DPO delta as directional rather than significant)
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-7B-Instruct")
model = PeftModel.from_pretrained(base, "glen-louis/finreason-qwen2.5-7b-dpo")
tokenizer = AutoTokenizer.from_pretrained("glen-louis/finreason-qwen2.5-7b-dpo")
messages = [
{"role": "system", "content": "You are a financial analyst. Reason step-by-step and provide the final numeric answer."},
{"role": "user", "content": "Table:\nYear | Revenue\n2019 | 12.4B\n2018 | 11.2B\n\nQuestion: What was the % change in revenue?"},
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt")
output = model.generate(**inputs, max_new_tokens=256, do_sample=False)
print(tokenizer.decode(output[0], skip_special_tokens=True))