Views
No views yet
🧠 Base Model: DeBERTa-v3-base (student model)
👨🏫 Teacher Model: CardiffNLP/twitter-roberta-base-sentiment-latest
⚙️ Custom Components:
Hidden state projection layers (12 transformer layers)
Attention matrix alignment module
Class-weighted focal lossLogit Distillation: KL divergence loss between student/teacher predictions
Full-Layer Alignment: Layer-wise hidden state projection with cosine similarity
Attention Transfer: Last 4 layers' attention pattern matchingNeutral class upweighting (10x multiplier)
Gradient checkpointing + FP16 optimization
Combined focal loss (γ=3) + distillationfrom transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("Gillone06/Distilled_Unified_Model_Cardiff_Deberta")
model = AutoModelForSequenceClassification.from_pretrained("Gillone06/Distilled_Unified_Model_Cardiff_Deberta")
text = "Product was great but delivery took weeks!"
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
outputs = model(**inputs)
prediction = ["negative", "neutral", "positive"][outputs.logits.argmax().item()] Medical/legal document analysis
Sarcasm detection
Multi-label classificationSocial Media: tweet_eval, sentiment140
Reviews: IMDB, Yelp, Amazon Customer Reviews
Multi-Domain: Custom parsed reviews (balanced subset)Negative: 38.2%
Neutral: 12.1%
Positive: 49.7%Parameter:
-Learning Rate 5e-6
-Batch Size 20 (effective)
-Gradient Accumulation 4 steps
-Warmup Ratio 10%
-Max Seq Length 512
-Dropout 0.4
-Epochs 1+ (early stop)
-Optimizer AdamW
-LR Scheduler Cosine w/ restarts15% relative improvement on neutral class vs baseline
3.2% higher cross-domain accuracy than teacher modelHidden States: Layer-wise projection + LN normalization
Attention: Last 4 layers with GELU-projection
Temperature: Annealed from 2.0 → 0.5 during trainingPerformance degrades on texts with mixed sentiments
Requires ≥5 words for reliable classification
English-only limitation