AG News β qlora
Part of lora-methods-comparison β a rigorous, apples-to-apples comparison of Full fine-tuning, LoRA, LoRA-FA, QLoRA, and TinyLoRA, trained on the same task (AG News topic classification), same base model (Qwen/Qwen2.5-0.5B-Instruct), same GPU, same evaluation harness.
This checkpoint
QLoRA β LoRA adapters on top of a 4-bit NF4-quantized frozen base model.
Trainable parameters: 8,798,208 Test accuracy: 85.5% Peak GPU memory during training: 3.320809472 GB Training wall-clock time: 204.7774896621704s
How to load
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
bnb_config = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16)
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct", quantization_config=bnb_config)
model = PeftModel.from_pretrained(base, "swathikchhuggingface/ag-news-qlora")
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct")
See the repo README for the full comparison across all 5 methods, including methodology and the complete results table.
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support