Downloads · 30 days
8
9% of all-time downloads
Mervecaliskan/llama3.2-3b-dolly-qlora
llama3.2-3b-dolly-qlora is a machine learning model from Mervecaliskan. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as llama3.2.
Fine-tuned version of meta-llama/Llama-3.2-3B-Instruct using QLoRA (4-bit NF4 quantization + LoRA adapters) on a 500-example subset of the Databricks Dolly-15K dataset.
Downloads · 30 days
8
9% of all-time downloads
All-time downloads
92
Public
Repo size
212 MB
Likes
0
Public
Click a slice to open those files.
.safetensors97.3 MB · 85%
From the Hugging Face model README
Fine-tuned version of meta-llama/Llama-3.2-3B-Instruct using QLoRA
(4-bit NF4 quantization + LoRA adapters) on a 500-example subset of
the Databricks Dolly-15K dataset.
📎 Training code: github.com/Mervecaliskann/llama3-qlora-finetuning
| Parameter | Value |
|---|---|
| Base model | meta-llama/Llama-3.2-3B-Instruct |
| Fine-tuning method | QLoRA (4-bit NF4 + LoRA) |
| LoRA rank (r) | 16 |
| LoRA alpha | 16 |
| Target modules | q, k, v, o, gate, up, down proj |
| Trainable parameters | 24.3M / 3.237B (1.30%) |
| Training framework | Unsloth + HuggingFace TRL (SFTTrainer) |
| Experiment tracking | MLflow (step-level loss, GPU memory, hyperparameters) |
| Hardware | Google Colab T4 GPU (16GB) |
| Developed by | Merve Caliskan |
| Field | Value |
|---|---|
| Dataset | databricks/databricks-dolly-15k |
| Subset | 500 examples (shuffled, seed=42) |
| Train / Val split | 450 / 50 (90/10) |
| Prompt format | Llama-3 instruct (system / user / assistant) |
| Categories | open_qa, closed_qa, classification, summarization, brainstorming, information_extraction, creative_writing, general_qa |
| Parameter | Value |
|---|---|
| Learning rate | 2e-4 |
| LR scheduler | Cosine |
| Optimizer | adamw_8bit |
| Batch size (effective) | 8 (2 × 4 grad accumulation) |
| Max steps | 120 (~3 epochs) |
| Warmup steps | 10 |
| Weight decay | 0.01 |
| Max sequence length | 1024 |
| Quantization | 4-bit NF4 (bitsandbytes) |
| Training time | ~6.3 minutes |
| GPU peak memory | 7.95 GB |
| Step | Train Loss | Val Loss | Status |
|---|---|---|---|
| 30 | 1.8728 | 1.7720 | warming up |
| 60 | 1.7791 | 1.5834 | ✅ |
| 90 | 1.7449 | 1.5770 | ✅ |
| 120 | 1.4911 | 1.5746 | ✅ best |
Train loss: 1.87 → 1.49 | Val loss: 1.77 → 1.57 | No overfitting
Val loss consistently decreases alongside train loss — healthy convergence for a 500-example fine-tuning run.
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
base_model = "meta-llama/Llama-3.2-3B-Instruct"
adapter = "Mervecaliskan/llama3.2-3b-dolly-qlora"
tokenizer = AutoTokenizer.from_pretrained(base_model)
model = AutoModelForCausalLM.from_pretrained(
base_model,
load_in_4bit=True,
device_map="auto"
)
model = PeftModel.from_pretrained(model, adapter)
prompt = """<|begin_of_text|><|start_header_id|>system<|end_header_id|>
You are a helpful assistant.<|eot_id|>
<|start_header_id|>user<|end_header_id|>
What causes flight delays?<|eot_id|>
<|start_header_id|>assistant<|end_header_id|>
"""
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=200, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
open_qa — What causes the Northern Lights?
The Northern Lights are caused by charged particles from the sun interacting with Earth's magnetic field and atmosphere near the poles. ✅
classification — Is "I absolutely loved the movie!" positive or negative?
Positive ✅
summarization — Summarize the French Revolution in one sentence.
The French Revolution (1789–1799) transformed France's political structure and led to the rise of Napoleon Bonaparte. ⚠️ (followed instruction partially)
brainstorming — Give 3 creative names for a coffee shop.
Brew (repeated) ❌ (instruction following weak on small dataset — expected)
Experiment: llama3-dolly-finetuning
Run: qlora-r16-lr2e4-dolly500
Tracked: step-level train/val loss, GPU peak memory, all hyperparameters, environment tags
Fine-tuned as part of an AI engineering portfolio project.
Training notebook: github.com/Mervecaliskann/llama3-qlora-finetuning