jayalexander/items_prompts_full
Viewer β’ Updated β’ 820k β’ 82 β’ 1
How to use jayalexander/price-2026-11-17_08.04.09 with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.2-3B")
model = PeftModel.from_pretrained(base_model, "jayalexander/price-2026-11-17_08.04.09")A parameter-efficient fine-tuned (QLoRA) adapter for meta-llama/Llama-3.2-3B trained on 800,000 e-commerce product descriptions (jayalexander/items_prompts_full) to predict retail product prices directly from unstructured item specifications.
meta-llama/Llama-3.2-3B (4-bit NormalFloat nf4 quantization with bfloat16 compute)r = 256, lora_alpha = 512) targeting all 7 Attention + MLP projection layers (q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj)revision="1390048"): Validation loss reached its optimal minimum of 1.1195 (with 77.13% mean token accuracy) at Step 6,200 (end of Epoch 2 across ~163.6M tokens). At Step 6,400 (start of Epoch 3), training loss dropped sharply (1.0268 -> 0.8371) while validation loss rose (1.1195 -> 1.2578) alongside an entropy drop (4.985 -> 4.042), signaling the onset of training-set memorization. Always pass revision="1390048" when loading this adapter.Because this repository stores lightweight PEFT / QLoRA adapter weights, load the quantized meta-llama/Llama-3.2-3B base model first and attach checkpoint 1390048:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
BASE_MODEL = "meta-llama/Llama-3.2-3B"
FINETUNED_MODEL = "jayalexander/price-2026-11-17_08.04.09"
PEAK_REVISION = "1390048" # Step 6,200 (Best Validation Loss: 1.1195)
quant_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_use_double_quant=True,
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_quant_type="nf4",
)
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
tokenizer.pad_token = tokenizer.eos_token
base_model = AutoModelForCausalLM.from_pretrained(
BASE_MODEL,
quantization_config=quant_config,
device_map="auto",
)
model = PeftModel.from_pretrained(
base_model,
FINETUNED_MODEL,
revision=PEAK_REVISION,
)
prompt = """How much does this cost to the nearest dollar?
Title: Sony WH-1000XM5 Wireless Noise Canceling Headphones
Description: Industry-leading noise cancellation with 8 microphones and Auto NC Optimizer, up to 30-hour battery life, crystal clear hands-free calling, multipoint Bluetooth connection.
Category: Electronics
Price is $"""
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=6, pad_token_id=tokenizer.eos_token_id)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Trained for ~18 hours on an NVIDIA A100-SXM4-40GB GPU using Hugging Face trl (SFTTrainer):
| Parameter | Value |
|---|---|
| Training Dataset | jayalexander/items_prompts_full (800,000 train / 1,000 val) |
| Quantization | 4-bit nf4 (double_quant=True, compute_dtype=bfloat16) |
LoRA Rank (r) / Alpha |
256 / 512 (lora_dropout=0.1) |
| Target Modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Micro-Batch Size | 16 |
| Gradient Accumulation Steps | 16 (Effective Batch Size = 256 rows/step) |
| Sequence Length | 128 tokens |
| Optimizer | paged_adamw_32bit (weight_decay=0.001, max_grad_norm=0.3) |
| Learning Rate & Schedule | 1e-4 with Cosine decay (warmup_ratio=0.01) |
| Step | Epoch | Training Loss | Validation Loss | Entropy | Mean Token Accuracy | Notes |
|---|---|---|---|---|---|---|
| 200 | 0.06 | 1.2408 | 1.2616 | 3.3458 | 76.00% | Initial baseline |
| 1,000 | 0.32 | 1.2027 | 1.2050 | 4.9638 | 76.28% | Warmup complete |
| 2,000 | 0.64 | 1.1804 | 1.1768 | 5.4511 | 76.43% | Steady generalization |
| 3,000 | 0.96 | 1.1432 | 1.1537 | 5.1845 | 77.00% | End of Epoch 1 |
| 4,200 | 1.34 | 1.0590 | 1.1340 | 5.0496 | 77.00% | Mid-Epoch 2 |
| 5,800 | 1.86 | 1.0368 | 1.1224 | 5.0309 | 77.23% | Peak token accuracy |
| 6,200 | 1.98 | 1.0268 | 1.1195 | 4.9854 | 77.13% | Peak Checkpoint (1390048) |
| 6,400 | 2.05 | 0.8371 | 1.2578 | 4.0420 | 77.08% | Epoch 3 memorization onset |
Base model
meta-llama/Llama-3.2-3B