Gemma 4 E4B — Quantitative Finance (LoRA)
Fine-tuné sur 24 exemples Q&A de finance quantitative via QLoRA (rank=32).
Erreurs du modèle de base corrigées
| Erreur |
Correction |
| SABR attribué à HJM |
Hagan, Kumar, Lesniewski & Woodward (2002) |
| SABR vol avec mean-reversion |
GBM log-normal sans drift |
| Bergomi = CIR/Heston |
Forward variance curve ξᵗᵤ |
| Formule SABR inventée |
Formule exacte avec z, χ(z) |
Entraînement
| Paramètre |
Valeur |
| GPU |
RTX PRO 4500 (31.9 GB VRAM) |
| Méthode |
QLoRA 4-bit |
| LoRA rank |
32 |
| LoRA alpha |
64 |
| Dataset |
mo35/quant-finance-dataset |
| Epochs |
10 |
| Loss finale |
2.5583 |
Utilisation rapide
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
"mo35/gemma4-quantfin-lora", max_seq_length=4096, load_in_4bit=True
)
FastModel.for_inference(model)
inputs = tokenizer.apply_chat_template(
[{"role": "user", "content": "Derive the SABR implied volatility formula."}],
return_tensors="pt", add_generation_prompt=True
).to("cuda")
print(tokenizer.decode(model.generate(inputs, max_new_tokens=1024)[0][inputs.shape[-1]:],
skip_special_tokens=True))