CoolFace
Modelpublic

AnirbanSaha/llama32-3b-tlink-full-finetune

sourceHugging Faceapache-2.0updated 6mo agoView on Hugging Face
0likes21downloads
Model Card

LLaMA 3.2 3B Fine-Tuned for TLINK Classification

๐Ÿง  Overview

This model is a fully fine-tuned version of meta-llama/Llama-3.2-3B-Instruct for temporal relation classification (TLINK task).

It predicts the temporal relationship between events in text.

Labels:

  • โ€”BEFORE
  • โ€”AFTER
  • โ€”OTHER
  • โ€”NONE ---

๐Ÿ“Š Task

Temporal Relation Classification Given a sentence, the model predicts the temporal relationship between events.


๐Ÿ“š Dataset

  • โ€”Name: fahmidiqbal/tlink-classification
  • โ€”Format: JSONL (text + label)
  • โ€”Labels: BEFORE, AFTER, OTHER, NONE
  • โ€”Distribution: Balanced (50 samples per class in test set)

โš™๏ธ Training Details

  • โ€”Model: meta-llama/Llama-3.2-3B-Instruct
  • โ€”Fine-tuning: Full fine-tuning (all parameters updated)
  • โ€”Epochs: 3
  • โ€”Learning Rate: 2e-5
  • โ€”Batch Size: 1 (with gradient accumulation)
  • โ€”Optimizer: AdamW
  • โ€”Precision: bfloat16
  • โ€”Tracking: Weights & Biases (wandb)

๐Ÿ“ˆ Evaluation

Validation Performance

MetricScore
Accuracy0.8480
Macro-F10.8285
Precision0.8327
Recall0.8246

Test Performance

MetricScore
Accuracy0.7950
Macro-F10.7973
Precision0.8100
Recall0.7950

Per-Class Performance (Test Set)

ClassPrecisionRecallF1-score
BEFORE0.78260.72000.7500
AFTER0.66130.82000.7321
OTHER0.84620.88000.8627
NONE0.95000.76000.8444

๐Ÿ”ฌ Analysis

  • โ€”The model achieves strong overall performance with a Macro-F1 of ~0.80 on the test set.
  • โ€”OTHER and NONE classes show the highest performance.
  • โ€”The AFTER class has lower precision but strong recall, indicating some over-prediction.
  • โ€”The drop from validation (0.83 F1) to test (0.79 F1) suggests a mild generalization gap, but overall stable performance.
  • โ€”Errors are mainly observed in:
  • โ€”BEFORE vs AFTER confusion
  • โ€”NONE vs OTHER boundary ambiguity

๐Ÿš€ Usage

python
from transformers import AutoTokenizer, AutoModelForSequenceClassification

model_id = "AnirbanSaha/llama32-3b-tlink-full-finetune"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)

text = "The patient developed fever before taking the medication."

inputs = tokenizer(text, return_tensors="pt", truncation=True)

outputs = model(**inputs)
pred = outputs.logits.argmax(dim=-1).item()

labels = ["BEFORE", "AFTER", "OTHER", "NONE"]
print(labels[pred])

โš ๏ธ Important Notice (LLaMA License)

This model is based on:

๐Ÿ‘‰ meta-llama/Llama-3.2-3B-Instruct

You must request access and accept the license:

https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct

Otherwise, loading this model will fail.


๐Ÿ“Š Training Logs

Weights & Biases run: ๐Ÿ‘‰ https://wandb.ai/anirbansaha002-univeristy-of-north-texas/llama32-3b-full-finetune/runs/mrdwp04g


๐Ÿงฉ Limitations

  • โ€”Performance depends on dataset distribution
  • โ€”May not generalize well to unseen domains
  • โ€”Sensitive to long input truncation
  • โ€”Some confusion between temporally similar classes (BEFORE vs AFTER)

๐Ÿ”ฌ Research Context

This model was developed as part of research on:

  • โ€”Temporal reasoning in NLP
  • โ€”Relation classification using large language models

๐Ÿ“ฌ Contact

Author: Anirban Saha Anik Affiliation: University of North Texas


โญ Citation

If you use this model in your research, please cite appropriately.