Downloads · 30 days
3
18% of all-time downloads
ab2720/distilbert-sst2-rSVD-r8
distilbert-sst2-rSVD-r8 is a machine learning model from ab2720. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This model fine-tunes DistilBERT on the SST-2 sentiment classification task using Randomized SVD (rSVD) to factorize the Q/K/V projection matrices in every transformer attention layer.
Downloads · 30 days
3
18% of all-time downloads
All-time downloads
17
Public
Parameters
56.6M
226 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors226 MB · 100%
From the Hugging Face model README
This model fine-tunes DistilBERT on the SST-2 sentiment classification task using Randomized SVD (rSVD) to factorize the Q/K/V projection matrices in every transformer attention layer.
The goal is to measure memory savings, FLOPs reductions, and accuracy retention as the rank is varied.
distilbert-base-uncased| Setting | Value |
|---|---|
| Rank | 8 |
| Learning Rate | 0.0002 |
| Num Epochs | 1 |
| Batch Size | 32 |
| Dataset | GLUE SST-2 |
| Optimizer | AdamW |
| Scheduler | Constant LR |
| Metric | Value |
|---|---|
| FLOPs per training step | 768,945,524,736 |
| FLOPs per epoch | 1,618,630,329,569,280 |
| Peak GPU Memory (bytes) | 1482686464 |
| Validation Accuracy | 0.8279816513761468 |
(Metrics are computed automatically during training and profiling.)
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model_id = "AmitBal/distilbert-sst2-rSVD-r8"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
text = "This movie was absolutely fantastic!"
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
print(outputs.logits)