Downloads · 30 days
7
32% of all-time downloads
rounak26/lora-slm-adapter
lora-slm-adapter is a text generation model from rounak26. Use it when you need the model to write or continue text. It is set up for peft.
This repository contains a Low-Rank Adaptation (LoRA) adapter trained on top of the Qwen/Qwen2.5-0.5B-Instruct base Small Language Model (SLM). The model was trained as part of an SLM research project.
Downloads · 30 days
7
32% of all-time downloads
All-time downloads
22
Public
Repo size
15.8 MB
Likes
0
Public
Click a slice to open those files.
.json11.4 MB · 72%
From the Hugging Face model README
This repository contains a Low-Rank Adaptation (LoRA) adapter trained on top of the Qwen/Qwen2.5-0.5B-Instruct base Small Language Model (SLM). The model was trained as part of an SLM research project.
This model is a parameter-efficient adapter module designed to modify the text-generation behaviour of Qwen's 0.5B parameter instruction-tuned model. By targeting internal attention blocks, the adapter allows for specialized downstream capability while preserving the vast linguistic footprint of the base model.
This adapter cannot be initialized standalone. It must be explicitly injected into the base Qwen/Qwen2.5-0.5B-Instruct model weights at runtime using the peft library.
It is tailored for resource-constrained edge deployments, CPU inference configurations, or low-latency conversational agent environments leveraging Small Language Models (SLMs).
This model should not be deployed in high-risk autonomous operational pipelines or medical triage frameworks without rigorous safety wrappers. It is explicitly not designed to operate outside the bounded parameters of its targeted text-generation tasks.
Given its small size (0.5 Billion parameters), this architecture is highly prone to structural hallucinations when prompted with complex logical constraints or out-of-distribution math. It also inherits any downstream data biases present in the core Qwen2.5 pretraining mix.
Users are strongly encouraged to employ strict output verification pipelines, log alignment checking, and temperature scaling down to low variations (e.g., 0.2 or 0.1) during generations to maintain contextual consistency.
Use the code snippet below to initialize the base architecture and merge your custom LoRA weights:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model_id = "Qwen/Qwen2.5-0.5B-Instruct"
adapter_id = "rounak26/lora-slm-adapter"
# Load base model tokenizer and model weights
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype=torch.float16,
device_map="auto"
)
# Inject the LoRA adapter layers
model = PeftModel.from_pretrained(model, adapter_id)
The model was optimized using specific contextual fine-tuning datasets formatted into Qwen’s native ChatML structure to ensure stable dialogue tracking.
q_proj, v_proj, k_proj, o_proj (Attention layers)noneCarbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
Causal Language Modeling (CAUSAL_LM) objective utilizing low-rank weight updates directly inserted adjacent to the Query, Key, Value, and Output projection matrices of the base Transformer block.
BibTeX:
@article{lacoste2019quantifying,
title={Quantifying the Carbon Emissions of Machine Learning},
author={Lacoste, Alexandre and Luccioni, Alexandra and Schmidt, Victor and Dandres, Thomas},
journal={arXiv preprint arXiv:1910.09700},
year={2019}
}
For questions regarding this research run, reach out via the Hugging Face Community hub at rounak26.