File size: 1,456 Bytes
2fa50ad
4d6f0c3
 
 
 
2fa50ad
4d6f0c3
 
2fa50ad
4d6f0c3
 
2fa50ad
 
4d6f0c3
2fa50ad
4d6f0c3
2fa50ad
4d6f0c3
2fa50ad
4d6f0c3
 
 
 
 
 
2fa50ad
4d6f0c3
2fa50ad
4d6f0c3
 
 
 
 
 
 
 
 
2fa50ad
4d6f0c3
2fa50ad
4d6f0c3
 
2fa50ad
4d6f0c3
 
 
 
2fa50ad
4d6f0c3
 
 
 
 
 
 
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
---
base_model: google/gemma-4-E4B-it
license: gemma
language:
- en
tags:
- quantitative-finance
- lora
- unsloth
- gemma4
pipeline_tag: text-generation
---

# 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](https://huggingface.co/datasets/mo35/quant-finance-dataset) |
| Epochs | 10 |
| Loss finale | 2.5583 |

## Utilisation rapide

```python
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))
```