Downloads · 30 days
0
xinyuema/llm-course-hw3-tinyllama-qlora-model
llm-course-hw3-tinyllama-qlora-model is a machine learning model from xinyuema. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as mit.
The 4-bit of the base model TinyLlama/TinyLlama-1.1B-Chat-v1.0 was fine-tuned on a tweet sentiment dataset cardiffnlp/tweeteval in order to determine tweets tonality by positive, neutral or negative.
Downloads · 30 days
0
Access
Public
Updated Apr 7, 2025
Repo size
3.3 MB
Likes
0
Public
Click a slice to open those files.
.safetensors3.3 MB · 100%
From the Hugging Face model README
The 4-bit of the base model TinyLlama/TinyLlama-1.1B-Chat-v1.0 was fine-tuned on a tweet sentiment dataset cardiffnlp/tweet_eval in order to determine tweets tonality by positive, neutral or negative.
We used a system prompt to instruct the model:
SYSTEM PROMPT:
You are a tweet sentiment classifier. For each tweet input, analyze its sentiment and output exactly one word: "negative", "neutral", or "positive". Do not include any extra text.
But the model is not trained to return only the sentiment name.
The PEFT method applied was QLoRA, the optimizer parameters be offloaded to CPU, when GPU memory is limited but could slow down the learning.
The peft framework was applied to the model, k_proj and v_proj layers whas modified with LoRA linear layer rank=8, alpha=16.
This model was trained with SFTTrainer of trl, batch_size=12, gradient_accumulation_steps=128, learning_rate=5e-4, lr_scheduler_type="linear"
The model achieved 0.19 macro f1-score on the test dataset(initial model 0.03)