Fine-tuned_NLP_Qwen_0.5B (LoRA Adapter)

This repository provides a LoRA adapter fine-tuned from Qwen/Qwen2.5-0.5B-Instruct on the allenai/qasper dataset.

Model Details

  • Adapter repo: AGNDM/Fine-tuned_NLP_Qwen_0.5B
  • Base model: Qwen/Qwen2.5-0.5B-Instruct
  • Task: Scientific paper question answering
  • Training method: PEFT LoRA (with 4-bit loading during training)

Dataset

  • allenai/qasper
  • Domain: NLP/scientific paper reading comprehension and QA

How to Use

1) Install dependencies

pip install -U transformers peft accelerate torch

2) Load base model + LoRA adapter

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

base_model_id = "Qwen/Qwen2.5-0.5B-Instruct"
adapter_id = "AGNDM/Fine-tuned_NLP_Qwen_0.5B"

tokenizer = AutoTokenizer.from_pretrained(base_model_id, trust_remote_code=True)
base_model = AutoModelForCausalLM.from_pretrained(
    base_model_id,
    torch_dtype=torch.float16,
    device_map="auto"
)
model = PeftModel.from_pretrained(base_model, adapter_id)

prompt = (
    "You are a helpful scientific QA assistant. "
    "Answer the question based only on the provided paper content.\n\n"
    "### Paper Context\n"
    "<paper context here>\n\n"
    "### Question\n"
    "What is the main contribution?\n\n"
    "### Answer\n"
)

inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
    outputs = model.generate(**inputs, max_new_tokens=128, do_sample=False)

print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Training Setup (Summary)

  • Base model: Qwen/Qwen2.5-0.5B-Instruct
  • LoRA: r=16, alpha=32, dropout=0.05
  • Effective batch size: 1 x gradient_accumulation_steps(16) = 16
  • Max sequence length: 2048
  • Dataset preprocessing: QASPER paper context + question → answer format

Limitations

  • Model outputs may be incorrect or incomplete.
  • Performance depends heavily on context quality and length.
  • This adapter is tuned for QASPER-style scientific QA prompts.

Intended Use

  • Research/demo for scientific document QA
  • Educational use and experimentation with PEFT/LoRA

Citation

If you use this model, please cite QASPER and the base model:

@inproceedings{Dasigi2021ADO,
  title={A Dataset of Information-Seeking Questions and Answers Anchored in Research Papers},
  author={Pradeep Dasigi and Kyle Lo and Iz Beltagy and Arman Cohan and Noah A. Smith and Matt Gardner},
  year={2021}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for AGNDM/Fine-tuned_NLP_Qwen_0.5B

Adapter
(710)
this model