anaksor-ocr
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…
A RoBERTa Base sentiment classifier whose attention is swapped for a sparse AdaSplash version, which zeroes out 40% of attention weights to cut time and memory. For developers testing efficient attention.
roberta-base-adasplash is a kit in the Developer category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page, a zip of its files. Nothing in it runs by itself.
pip install -U huggingface_hub hf download Hooshaai/roberta-base-adasplash
This is RoBERTa Base, fine-tuned on the GLUE SST-2 sentiment task, with its attention layers replaced by AdaSplash attention from the neuralops library. AdaSplash uses a sparse projection that sets a share of attention weights to exactly zero.
The card reports 40% zero attention weights in all 12 encoder blocks. It adds about 0.94% more parameters through small LoRA adapters, bringing the model to roughly 125.8 million parameters.
Developers and researchers who want to see how sparse attention changes speed, memory and accuracy in a familiar English text classifier. It is an experiment more than a drop-in upgrade.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Research | ML researchers | Study sparse attention in an encoder model | Comparing sparse and dense attention on one task |
| Software | Inference engineers | Test memory and latency savings | Measuring peak memory for a classifier |
| Education | Students | Learn how entmax attention differs from softmax | Reading the architecture notes and running the sample |
| Product teams | NLP developers | Try an efficient sentiment classifier | Scoring short English reviews as positive or negative |
Anyone who needs the highest sentiment accuracy can skip it. The card shows the dense baseline scoring higher on its test.
| Use case | Who | What they get back |
|---|---|---|
| Sentiment classification | Developers | A positive or negative prediction for English text |
| Efficiency testing | Engineers | Lower attention time and memory than the dense model |
| Attention swapping | Researchers | An existing RoBERTa converted to AdaSplash in one call |
You need Python and a few libraries.
pip install -U huggingface_hub hf download Hooshaai/roberta-base-adasplash
Load the tokenizer and the model, tokenize a sentence, and take the highest logit as the prediction. You can also convert any RoBERTa to AdaSplash in one call.
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
from neuralops import replace_attention
# 1. Load tokenizer and model from Hugging Face Hub
tokenizer = AutoTokenizer.from_pretrained("roberta-base")
model = AutoModelForSequenceClassification.from_pretrained("Hooshaai/roberta-base-adasplash")
# 2. Or surgically inject AdaSplash into any RoBERTa in 1 line
base_model = AutoModelForSequenceClassification.from_pretrained("roberta-base")
adasplash_model = replace_attention(base_model, "adasplash_attention")
# 3. Predict sentiment
inputs = tokenizer("The sparse entmax projection preserves salient features with extreme precision!", return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits
prediction = logits.argmax(-1).item()| Tool | What it does |
|---|---|
| AutoTokenizer | Turns a sentence into model inputs |
| AutoModelForSequenceClassification | Loads the classifier and returns logits |
| replace_attention | Swaps a model's attention for AdaSplash attention |
Give the model a short English sentence that expresses an opinion, as the sample does. It returns logits, and the index of the largest one is the predicted sentiment class.
If you are new, a sentiment classifier reads a sentence and says whether it sounds positive or negative. Run the quickstart on one sentence first. The rest of the card is about how its attention was made more efficient.
For experts, the model uses Tsallis 1.5-entmax in place of softmax, so attention weights can be exactly zero. The query, key, value and output projections are rank-16 LoRA adapters over frozen pretrained weights. The card reports 94.38% accuracy for the dense baseline, 75.46% for zero-shot AdaSplash and 82.10% after distillation.
The points below cover limits and costs.
A RoBERTa Base sentiment classifier whose attention is swapped for a sparse AdaSplash version, which zeroes out 40% of attention weights to cut time and memory. For developers testing efficient attention.
Made by Hooshaai on Hugging Face. These notes are Mindket's, written from its model page and model card; the model's own files and license are on Hugging Face.
What it is: This is RoBERTa Base, fine-tuned on the GLUE SST-2 sentiment task, with its attention layers replaced by AdaSplash attention from the neuralops library. AdaSplash uses a sparse projection that sets a share of attention weights to exactly zero.
The card reports 40% zero attention weights in all 12 encoder blocks. It adds about 0.94% more parameters through small LoRA adapters, bringing the model to roughly 125.8 million parameters.
Who it suits: Developers and researchers who want to see how sparse attention changes speed, memory and accuracy in a familiar English text classifier. It is an experiment more than a drop-in upgrade.
Industry | Who uses it | How they use it | Example
Research | ML researchers | Study sparse attention in an encoder model | Comparing sparse and dense attention on one task
Software | Inference engineers | Test memory and latency savings | Measuring peak memory for a classifier
Education | Students | Learn how entmax attention differs from softmax | Reading the architecture notes and running the sample
Product teams | NLP developers | Try an efficient sentiment classifier | Scoring short English reviews as positive or negative
Anyone who needs the highest sentiment accuracy can skip it. The card shows the dense baseline scoring higher on its test.
Where to use it:
Use case | Who | What they get back
Sentiment classification | Developers | A positive or negative prediction for English text
Efficiency testing | Engineers | Lower attention time and memory than the dense model
Attention swapping | Researchers | An existing RoBERTa converted to AdaSplash in one call
How to set it up: You need Python and a few libraries.
pip install -U huggingface_hub
hf download Hooshaai/roberta-base-adasplash
How to use it: Load the tokenizer and the model, tokenize a sentence, and take the highest logit as the prediction. You can also convert any RoBERTa to AdaSplash in one call.
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
from neuralops import replace_attention
# 1. Load tokenizer and model from Hugging Face Hub
tokenizer = AutoTokenizer.from_pretrained("roberta-base")
model = AutoModelForSequenceClassification.from_pretrained("Hooshaai/roberta-base-adasplash")
# 2. Or surgically inject AdaSplash into any RoBERTa in 1 line
base_model = AutoModelForSequenceClassification.from_pretrained("roberta-base")
adasplash_model = replace_attention(base_model, "adasplash_attention")
# 3. Predict sentiment
inputs = tokenizer("The sparse entmax projection preserves salient features with extreme precision!", return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits
prediction = logits.argmax(-1).item()
Tool | What it does
AutoTokenizer | Turns a sentence into model inputs
AutoModelForSequenceClassification | Loads the classifier and returns logits
replace_attention | Swaps a model's attention for AdaSplash attention
Example: Give the model a short English sentence that expresses an opinion, as the sample does. It returns logits, and the index of the largest one is the predicted sentiment class.
For newcomers and experts: If you are new, a sentiment classifier reads a sentence and says whether it sounds positive or negative. Run the quickstart on one sentence first. The rest of the card is about how its attention was made more efficient.
For experts, the model uses Tsallis 1.5-entmax in place of softmax, so attention weights can be exactly zero. The query, key, value and output projections are rank-16 LoRA adapters over frozen pretrained weights. The card reports 94.38% accuracy for the dense baseline, 75.46% for zero-shot AdaSplash and 82.10% after distillation.
Start from RoBERTa Base fine-tuned on SST-2
Swap in AdaSplash attention with entmax
Add rank-16 LoRA adapters
Distill to recover accuracy
Classify text with 40% sparse attention
Title: SST-2 accuracy from the card
Dense baseline: 94.38%
Zero-shot AdaSplash: 75.46%
After distillation: 82.10%
Good to know: The points below cover limits and costs.
Download its files with Hugging Face's command line:
pip install -U huggingface_hub
hf download Hooshaai/roberta-base-adasplash
Then follow the usage in its model card. Nothing in this kit runs by itself.
README.md 6 KB
Listed Hugging Face models in the same category that share the most tags with this one.
| Product | Downloads, last 30 days | Likes | Parameters | License | Last change |
|---|---|---|---|---|---|
| roberta-base-adasplash This page | 0 | 2 | — | mit | |
| svd-linear-attention-roberta-base-adasplashShares adasplash · entmax · sparse-attention | 36 | 2 | — | mit | |
| roberta-base-fwsvd-rank32Shares roberta · neuralops · sst2 | 0 | 2 | — | mit | |
| distilbert-sst2-rpcShares neuralops · sst2 · subquadratic-attention | 0 | 2 | — | mit | |
| bge-reranker-v2-m3Shares text-classification · transformers | 14,685,230 | 1,301 | 568M | apache-2.0 | |
| deberta-v3-base-prompt-injection-v2Shares text-classification · transformers | 476,298 | 129 | 184M | apache-2.0 |
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…
Qwen · Kit
Qwen2.5-7B-Instruct as GGUF files in eight quantization sizes, to chat with locally through llama.cpp. For people who want a capable 7.6B model on their own co…
ACE-Step · Kit
Generates music from text with a 4B diffusion decoder, 50 steps and guidance control, aiming for higher audio quality than the base. For creators with a GPU of…
alirezarezvani · Skill
Adds 411 ready-made skills for Claude Code and other coding agents, grouped by role from engineering and product to marketing, finance and compliance. Installs…
block · Kit
Self-hostable workspace where people and AI agents share the same rooms, built on a Nostr relay that logs every action as a signed event. For teams that want t…
backnotprop · Kit
Opens your AI coding agent's plans, specs and code changes in a browser so you can annotate or comment on them and send the feedback straight back to the agent.