Views
No views yet
1from transformers import pipeline
2
3question = "What is dollar cost averaging?"
4generator = pipeline("text-generation", model="Mohammedmz4/llama-3.1-8b-finance-dora", device="cuda")
5output = generator([{"role": "user", "content": question}], max_new_tokens=256, return_full_text=False)[0]
6print(output["generated_text"])| Parameter | Value |
|---|---|
| Base model | unsloth/Meta-Llama-3.1-8B-Instruct |
| Method | DoRA (Weight-Decomposed Low-Rank Adaptation) |
| Precision | BF16 |
| Rank (r) | 32 |
| Alpha (α) | 64 |
| Target modules | q, k, v, o, gate, up, down (proj) |
| Adapter dropout | 0.05 |
| Trainable parameters | ~1–2% of total |
| Learning rate | 2×10⁻⁴ |
| Epochs | 1 |
| Effective batch size | 32 |
| Optimiser | Paged AdamW 8-bit |
| Gradient clipping | Max norm 0.3 |
| LR schedule | Cosine decay |
| Warmup steps | 100 |
| Weight decay | 0.01 |
| Saved | Adapter weights + tokeniser (~400–500 MB) |
| Metric | Baseline | DoRA |
|---|---|---|
| ROUGE-1 | 0.3379 | 0.4003 |
| ROUGE-2 | 0.1436 | 0.2000 |
| ROUGE-L | 0.2490 | 0.3236 |
| Perplexity ↓ | 7.699 | 6.322 |
| BERTScore F1 | 0.5636 | 0.6791 |
| ConvFinQA Accuracy | 0.0933 | 0.1240 |
1@misc{vonwerra2022trl,
2 title = {{TRL: Transformer Reinforcement Learning}},
3 author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallo{\'e}dec},
4 year = 2020,
5 journal = {GitHub repository},
6 publisher = {GitHub},
7 howpublished = {\url{https://github.com/huggingface/trl}}
8}
9
10@misc{liu2024dora,
11 title = {DoRA: Weight-Decomposed Low-Rank Adaptation},
12 author = {Shih-Yang Liu and Chien-Yi Wang and Hongxu Yin and Pavlo Molchanov and Yu-Chiang Frank Wang and Kwang-Ting Cheng and Min-Hung Chen},
13 year = {2024},
14 eprint = {2402.09353},
15 archivePrefix= {arXiv},
16 primaryClass = {cs.CL}
17}