CoolFace
Modelpublic

RehmanKhalid/Qwen3.5-0.8B-CommonsenseQA-LoRA

sourceHugging Faceapache-2.0updated 1mo agoView on Hugging Face
1likes8downloads
Model Card

Qwen3.5-0.8B CommonsenseQA LoRA

LoRA adapter fine-tuned on CommonsenseQA on top of `Qwen/Qwen3.5-0.8B`.

This repository contains adapter weights only. Load them on the official base model.

Intended use

Multiple-choice commonsense question answering (A–E letter answers), following the CommonsenseQA format.

Training summary

ItemValue
Base model`Qwen/Qwen3.5-0.8B`
Dataset`tau/commonsense_qa`
MethodQLoRA (4-bit NF4) + SFT
ObjectiveCompletion-only loss on the assistant answer letter
LoRA rank (r)16
LoRA alpha32
LoRA dropout0.05
Target modulesq_proj, v_proj
Train splitCommonsenseQA train
Eval protocolCommonsenseQA validation (official public labels)

How to use

python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

base_id = "Qwen/Qwen3.5-0.8B"
adapter_id = "RehmanKhalid/Qwen3.5-0.8B-CommonsenseQA-LoRA"

tokenizer = AutoTokenizer.from_pretrained(base_id)
model = AutoModelForCausalLM.from_pretrained(
    base_id,
    torch_dtype="auto",
    device_map="auto",
)
model = PeftModel.from_pretrained(model, adapter_id)
model.eval()

messages = [
    {
        "role": "system",
        "content": "You are a helpful assistant. Answer with only the letter (A, B, C, D, or E).",
    },
    {
        "role": "user",
        "content": (
            "Question: A revolving door is convenient for two direction travel, "
            "but it also serves as a security measure at a what?\n"
            "A) bank\n"
            "B) library\n"
            "C) department store\n"
            "D) mall\n"
            "E) new york\n"
            "Answer:"
        ),
    },
]

prompt = tokenizer.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)

with torch.no_grad():
    outputs = model.generate(**inputs, max_new_tokens=4, do_sample=False)

print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))

Evaluation notes

  • —Report accuracy on the CommonsenseQA validation split.
  • —The CommonsenseQA test split does not include public labels.
  • —Do not mix scores from other benchmarks (OpenBookQA, ARC, GSM8K) into the CommonsenseQA result.

Framework versions

  • —PEFT 0.19.1
  • —TRL 1.8.0
  • —Transformers 5.13.0
  • —PyTorch 2.13.0
  • —Datasets 5.0.0
  • —Tokenizers 0.22.2

License

Adapter weights follow the base model license: Apache 2.0. Dataset terms for CommonsenseQA apply separately.