🧠 BERT-Base (asvd_attention) β€” Distilled on SST-2

This model is an authoritative pretrained variant of bert-base-uncased where all 12 standard Multi-Head Attention blocks have been replaced with the asvd_attention mechanism from the NeuralOps Library.

The model was distilled on GLUE SST-2 using the NeuralOps 2-Stage Cached Representation Distillation Protocol (Zero Teacher VRAM, offline representation caching) on an NVIDIA RTX 3090.


πŸ“Š Empirical Evaluation & Distillation Benchmark

Evaluated on the GLUE SST-2 validation split (872 samples):

Metric Teacher Baseline Pre-KD Student Post-KD Distilled Model Delta vs Pre-KD
SST-2 Accuracy 91.63% 82.80% 91.28% +8.49%
Validation Loss 0.2428 N/A 0.3088 Optimal

Hardware & Training Telemetry

  • Distillation Hardware: NVIDIA GeForce RTX 3090 24GB (Sharif HPC Cluster)
  • Training Duration: 50.2s
  • Distillation Steps: 200 steps
  • Throughput: 32633.1 tokens/sec
  • Peak GPU VRAM: 8487 MB
  • Distillation Curriculum: Stage 1 (Hidden Alignment Cosine + Subspace MSE) $\rightarrow$ Stage 2 (Sequence Logit KL + Task CE)

πŸš€ Quick Start & One-Liner Usage

1. Standard Hugging Face Transformers (One-Liner)

from transformers import AutoModelForSequenceClassification, AutoTokenizer

# Instant download and execution directly from Hugging Face Hub
model = AutoModelForSequenceClassification.from_pretrained("tahamajs/bert-asvd-attention-sst2", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("tahamajs/bert-asvd-attention-sst2")

inputs = tokenizer("NeuralOps accelerates transformer architectures seamlessly.", return_tensors="pt")
outputs = model(**inputs)
predicted_sentiment = outputs.logits.argmax(dim=-1).item()
print("Prediction (0=Negative, 1=Positive):", predicted_sentiment)

2. Using NeuralOps Clean High-Level API

from neuralops.hub.bert_zoo import load_pretrained_bert

# Instant load via NeuralOps Zoo API
model, tokenizer = load_pretrained_bert(
    attention_type="asvd_attention",
    task="sequence-classification",
    hf_org="tahamajs",
)

πŸ“œ Citation

@software{neuralops2026bertzoo,
  title   = {NeuralOps: Pretrained BERT-131 Subquadratic Attention Zoo},
  author  = {Majlesi, Taha},
  year    = {2026},
  url     = {https://github.com/tahamajs/NeuralOps}
}

Quick Start (Universal NeuralOps Hub API)

import torch
from neuralops.hub import load_surgeried_model

# Load model and tokenizer/processor in one line directly from Hugging Face Hub
model, tokenizer = load_surgeried_model("tahamajs/bert-asvd-attention-sst2")
model.eval()
print(f"Successfully loaded tahamajs/bert-asvd-attention-sst2 with NeuralOps modular surgical weights!")
Downloads last month
92
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for Hooshaai/bert-asvd-attention-sst2

Finetuned
(7,264)
this model

Datasets used to train Hooshaai/bert-asvd-attention-sst2