SMOKE TEST. This adapter was trained on a handful of examples only to verify the training / push / inference pipeline. Do not use it for real predictions.
LoRA adapter fine-tuned from CohereLabs/tiny-aya-global on
Amharic_Stance_Sentiment_Normalized_Stratified for Amharic multi-task stance + sentiment
classification. The model reads a tweet and generates one line: Stance: <label> | Sentiment: <label>.
| Model | Stance Acc | Stance F1 | Sentiment Acc | Sentiment F1 | Avg Macro-F1 | Valid format |
|---|---|---|---|---|---|---|
| Zero-shot base model (adapter off) | 0.2500 | 0.1000 | 0.3333 | 0.1667 | 0.1333 | 1.000 |
| LoRA fine-tuned | 0.2500 | 0.1000 | 0.3333 | 0.1667 | 0.1333 | 1.000 |
"Valid format" is the share of generations that exactly match Stance: <label> | Sentiment: <label> before any
fallback parsing. Per-class scores are in test_metrics.json; every prediction is in test_predictions.csv.
Best validation macro-F1: 0.5619 (epoch 3)
| Epoch | Step | Train Loss (epoch avg) | Val Loss | Stance Acc | Stance F1 | Sentiment Acc | Sentiment F1 | Macro F1 |
|---|---|---|---|---|---|---|---|---|
| 1 | 3 | 1.2911 | 0.2398 | 0.2500 | 0.3409 | 0.6667 | 0.6794 | 0.5101 |
| 2 | 6 | 0.2128 | 0.2014 | 0.5833 | 0.1842 | 0.7500 | 0.7556 | 0.4699 |
| 3 | 9 | 0.1904 | 0.1955 | 0.6667 | 0.4444 | 0.6667 | 0.6794 | 0.5619 |
probe_predictions_by_epoch.csv lists the model's raw output for 12 fixed validation tweets at epoch 0
(before training) and after every epoch. training_log_history.json is the raw Trainer log.
tadiecool29/Amharic_Stance_Sentiment_Normalized_Stratified train / validation / test: 12 / 12 / 12 examples.
The model's chat template is used: a user turn containing the instruction and Text: <tweet>, followed by an
assistant turn Stance: <label> | Sentiment: <label>. Only the assistant tokens
contribute to the loss (prompt tokens are masked with -100). Sequences are limited to 256 tokens by
shortening the tweet, never the target (12 training tweets were shortened).
| Parameter | Value |
|---|---|
| Precision | bf16 |
| 4-bit quantization | True |
| LoRA rank (r) | 16 |
| LoRA alpha | 32 |
| LoRA dropout | 0.05 |
| LoRA target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Trainable params | 30,228,480 / 3,379,456,000 (0.894%) |
| Max epochs | 3 (early stopping patience 2) |
| Per-device batch size | 4 |
| Gradient accumulation | 1 |
| Effective batch size | 4 |
| Learning rate | 0.0002 |
| Optimizer / scheduler | AdamW (torch) / linear, no warmup, weight decay 0 |
| Max sequence length | 256 |
| Prompt format | model chat template |
| Model selection metric | validation macro_f1 |
| Seed | 42 |
| Training samples used | 12 |
Machine-readable: training_hyperparameters.json and training_arguments.json.
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = AutoModelForCausalLM.from_pretrained("CohereLabs/tiny-aya-global", torch_dtype=torch.bfloat16, device_map="auto")
tok = AutoTokenizer.from_pretrained("tadiecool29/Tiny-Aya-Global-Amharic-Stance-Sentiment-LoRA-FT-smoke-test")
model = PeftModel.from_pretrained(base, "tadiecool29/Tiny-Aya-Global-Amharic-Stance-Sentiment-LoRA-FT-smoke-test").eval()
SYSTEM_PROMPT = '''You are an expert annotator of Amharic social media text.
Output EXACTLY one line and nothing else in this format:
Stance: <Against|Neutral|Support|Unrelated> | Sentiment: <Negative|Neutral|Positive>
Do not write any extra text, explanation, or continuation after the line.'''
text = "<Amharic tweet here>"
messages = [{"role": "user", "content": f"{SYSTEM_PROMPT}\n\nText: {text}"}]
prompt = tok.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
inputs = tok(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)
out = model.generate(**inputs, max_new_tokens=25, do_sample=False)
print(tok.decode(out[0, inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
# -> Stance: <label> | Sentiment: <label>
Intended for research on Amharic social-media stance and sentiment analysis. Social media text can contain offensive or politically sensitive content, and dataset or annotator biases carry over into the model. Performance on out-of-domain text, other dialects or other languages is not validated; do not use for high-stakes decisions without human review.
CohereLabs/tiny-aya-global