Views
No views yet
distilbert-base-uncased student distilled from the
textattack/bert-base-uncased-SST-2 teacher on GLUE SST-2 sentiment
classification. Training combines temperature-scaled KL divergence against the
teacher's soft labels with the task cross-entropy, using a linear alpha
curriculum (0.9 -> 0.1) that starts distillation-heavy and anneals toward the
true labels.| metric | value |
|---|---|
| teacher accuracy | 0.9340 |
| student accuracy | 0.8600 |
| accuracy retained (student / teacher) | 0.9208 (92.1%) |
| student speedup over teacher | 2.12x |
| param compression (teacher / student) | 1.64x |
| student params | 66,955,010 |
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4name = "narinzar/teacher-student-distillation-pipeline"
5tok = AutoTokenizer.from_pretrained(name)
6model = AutoModelForSequenceClassification.from_pretrained(name)
7
8inputs = tok("a thoughtful, moving film", return_tensors="pt")
9with torch.no_grad():
10 logits = model(**inputs).logits
11print(logits.argmax(-1).item()) # 0 = negative, 1 = positive