Results
Table with columns: Metric, Value| Metric | Value |
|---|
| Eval loss (200 held-out rows) | 1.2073 |
Trained on 20,000 rows for 2,000 steps (~1.6 epochs). The earlier version used 2,000 rows for 200 steps, under-trained on 4% of the available data.
Caveat on the metric. Eval loss measures token prediction, not instruction-following quality.
Usage
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = "Qwen/Qwen2.5-0.5B-Instruct"
tokenizer = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(base, torch_dtype="bfloat16", device_map="auto")
model = PeftModel.from_pretrained(model, "HIMANSHUKUMARJHA/autotune-qwen-lora")
messages = [{'role': 'user', 'content': 'Give three tips for staying healthy.'}]
inputs = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, return_tensors="pt", return_dict=True
).to(model.device)
inputs.pop("token_type_ids", None)
out = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Requires transformers>=4.51.
Training
Table | |
|---|
| Base model | Qwen/Qwen2.5-0.5B-Instruct |
| Dataset | yahma/alpaca-cleaned |
| Training rows | 20,000 |
| Steps | 2,000 (~1.6 epochs at effective batch 16) |
| LoRA rank / alpha | 32 / 64 |
| Target modules | attention + MLP projections |
| LR schedule | 0.0002 cosine, 3% warmup |
| Precision | bfloat16 |
| Hardware |
Reproduced with AutoTune:
modal run finetune.py --profile alpaca
Data handling
The dataset is shuffled with a fixed seed, then a 200-row holdout is taken
before training. Rows the formatter cannot parse are dropped and exact duplicates
removed, because these datasets contain repeats that would otherwise leak holdout
examples into training.
Limitations
This is a 0.5B parameter model. It is useful for general instruction following at small scale and for on-device
or cost-sensitive settings, but it will not match a large general model. Outputs
should be validated before use. The adapter inherits any bias present in the
training dataset.