QLoRA Llama 3.1 price predictor
QLoRA fine-tune of a 4-bit Llama 3.1 8B that predicts product prices from descriptions.
What it does
The curated product-price dataset is pulled from the Hugging Face Hub and Llama 3.1 8B is loaded in 4-bit NF4 with double quantisation. LoRA adapters are trained with TRL's SFTTrainer in Google Colab, with rank, alpha, target modules, learning rate and gradient accumulation set explicitly. Training is monitored in Weights & Biases, the adapter is saved to the Hub, and the model is scored against frontier models on the same price tester.
What was built
- 01
Base model chosen by comparing Hugging Face leaderboard entries and Llama and Qwen tokenizers.
- 02
Llama 3.1 8B is loaded in 4-bit NF4 with double quantisation.
- 03
SFTTrainer runs QLoRA with configured r, alpha, target modules, epochs, batch size and learning rate.
- 04
Weights & Biases tracks loss and learning rate; the trained adapter is saved to the Hugging Face Hub.
- 05
Fine-tuned model is scored on the shared price tester against GPT-4o and earlier baselines.
The pipeline, layer by layer
Five layers, one pipeline.
L1Data
- HF Hub price dataset
L2Base model
- Llama 3.1 8B
- 4-bit NF4 quantisation
L3Training
- QLoRA SFTTrainer run
- W&B monitoring
L4Output
- LoRA adapter on HF Hub
L5Evaluation
- Price tester vs frontier