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 DistilBERT text classifier fine-tuned on GLUE SST-2 that swaps in a compressed random-projection attention to halve the scoring work. An experiment for researchers studying faster attention.
distilbert-sst2-rpc 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/distilbert-sst2-rpc
distilbert-sst2-rpc is a DistilBERT text classifier fine-tuned on GLUE SST-2, with its attention replaced by a compressed version called RPC attention. Queries and keys are projected from 64 to 32 dimensions with a fixed random matrix, which the card says cuts scoring FLOPs by 50%. Values stay full size and the model keeps 66.4M parameters.
Researchers and engineers who study efficient attention, kernel speed or ways to compress transformers.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Research | Efficient-attention researchers | Study random-projection attention on a small model | Compare accuracy before and after the recovery steps |
| Hardware | Kernel engineers | Measure Triton kernel speed for sketched attention | Reproduce the timing of 3.82 ms against 1.58 ms |
| Software | NLP engineers | Test a lighter classifier for latency-sensitive uses | Run the model on SST-2 validation data |
Anyone who needs the best accuracy can skip it, since the dense baseline scores higher on the card's own test.
It is a research model, used in Python on a machine that can run Triton kernels.
| Use case | Who | What they get back |
|---|---|---|
| Attention research | Researchers | Accuracy and F1 for the dense, zero-shot and recovered variants |
| Latency testing | Kernel engineers | Timings for sketched attention against dense attention |
| Text classification | NLP engineers | A predicted class for each input text |
Getting the files is quick, and the card leaves the loading code to you.
pip install -U huggingface_hub hf download Hooshaai/distilbert-sst2-rpc
The card shows no inference code, so day-to-day use means loading the files and sending text in for classification. The card's own work is a benchmark on the SST-2 validation split, with sequence length 128 and batch size 32.
| Tool | What it does |
|---|---|
| rpc_attention | The compressed attention mechanism this model uses |
| neuralops | The framework the card names for the model |
| Triton kernel | The kernel whose latency the card times in its benchmark |
A researcher downloads the files and compares the three variants on the SST-2 validation split. The card reports 90.71% accuracy for the dense baseline, 80.20% for zero-shot RPC attention and 88.88% after 50 recovery steps.
Normally a classifier compares every pair of words at full detail. This one first shrinks that comparison to half the size with a fixed random projection, so it does less math. The first small thing to try is downloading the files and reading the benchmark numbers.
RPC attention relies on the Johnson-Lindenstrauss lemma. A fixed, non-trainable, head-wise random projection takes Q and K from 64 to 32 dimensions. The logits are computed there and scaled by the square root of 32, and the values keep full size. The card says the inner product estimate is unbiased with variance on the order of one over the projected size.
Every number below is the author's own result, from a test on one GPU.
A DistilBERT text classifier fine-tuned on GLUE SST-2 that swaps in a compressed random-projection attention to halve the scoring work. An experiment for researchers studying faster 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: distilbert-sst2-rpc is a DistilBERT text classifier fine-tuned on GLUE SST-2, with its attention replaced by a compressed version called RPC attention. Queries and keys are projected from 64 to 32 dimensions with a fixed random matrix, which the card says cuts scoring FLOPs by 50%. Values stay full size and the model keeps 66.4M parameters.
Who it suits: Researchers and engineers who study efficient attention, kernel speed or ways to compress transformers.
Industry | Who uses it | How they use it | Example
Research | Efficient-attention researchers | Study random-projection attention on a small model | Compare accuracy before and after the recovery steps
Hardware | Kernel engineers | Measure Triton kernel speed for sketched attention | Reproduce the timing of 3.82 ms against 1.58 ms
Software | NLP engineers | Test a lighter classifier for latency-sensitive uses | Run the model on SST-2 validation data
Anyone who needs the best accuracy can skip it, since the dense baseline scores higher on the card's own test.
Where to use it: It is a research model, used in Python on a machine that can run Triton kernels.
Use case | Who | What they get back
Attention research | Researchers | Accuracy and F1 for the dense, zero-shot and recovered variants
Latency testing | Kernel engineers | Timings for sketched attention against dense attention
Text classification | NLP engineers | A predicted class for each input text
How to set it up: Getting the files is quick, and the card leaves the loading code to you.
pip install -U huggingface_hub
hf download Hooshaai/distilbert-sst2-rpc
How to use it: The card shows no inference code, so day-to-day use means loading the files and sending text in for classification. The card's own work is a benchmark on the SST-2 validation split, with sequence length 128 and batch size 32.
Tool | What it does
rpc_attention | The compressed attention mechanism this model uses
neuralops | The framework the card names for the model
Triton kernel | The kernel whose latency the card times in its benchmark
Example: A researcher downloads the files and compares the three variants on the SST-2 validation split. The card reports 90.71% accuracy for the dense baseline, 80.20% for zero-shot RPC attention and 88.88% after 50 recovery steps.
For newcomers and experts: Normally a classifier compares every pair of words at full detail. This one first shrinks that comparison to half the size with a fixed random projection, so it does less math. The first small thing to try is downloading the files and reading the benchmark numbers.
RPC attention relies on the Johnson-Lindenstrauss lemma. A fixed, non-trainable, head-wise random projection takes Q and K from 64 to 32 dimensions. The logits are computed there and scaled by the square root of 32, and the values keep full size. The card says the inner product estimate is unbiased with variance on the order of one over the projected size.
Project Q and K down to 32 dimensions
Compute the sketched attention logits
Apply softmax to the logits
Aggregate the full-size values
Project the output back to 768
Good to know: Every number below is the author's own result, from a test on one GPU.
Title: SST-2 accuracy by variant
Dense baseline: 90.71%
Zero-shot RPC attention: 80.20%
After 50 recovery steps: 88.88%
Download its files with Hugging Face's command line:
pip install -U huggingface_hub
hf download Hooshaai/distilbert-sst2-rpc
Then follow the usage in its model card. Nothing in this kit runs by itself.
README.md 5 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 |
|---|---|---|---|---|---|
| distilbert-sst2-rpc This page | 0 | 2 | — | mit | |
| svd-linear-attention-roberta-base-adasplashShares neuralops · sst2 · subquadratic-attention | 36 | 2 | — | mit | |
| roberta-base-fwsvd-rank32Shares neuralops · sst2 · subquadratic-attention | 0 | 2 | — | mit | |
| roberta-base-adasplashShares neuralops · sst2 · subquadratic-attention | 0 | 2 | — | mit | |
| DistilBERT base uncasedShares distilbert · transformers | 5,452,853 | 1,148 | 67M | apache-2.0 | |
| bge-reranker-v2-m3Shares text-classification · transformers | 14,685,230 | 1,301 | 568M | 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.