Downloads · 30 days
14
32% of all-time downloads
KevinDavidHayes/regressor-entropy
regressor-entropy is a machine learning model from KevinDavidHayes. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Predicts the attention entropy of a text sample - how spread out vs focused the attention patterns are.
Downloads · 30 days
14
32% of all-time downloads
All-time downloads
44
Public
Parameters
150M
5.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt3.6 GB · 60%
From the Hugging Face model README
Predicts the attention entropy of a text sample - how spread out vs focused the attention patterns are.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model = AutoModelForSequenceClassification.from_pretrained("KevinDavidHayes/regressor-entropy")
tokenizer = AutoTokenizer.from_pretrained("KevinDavidHayes/regressor-entropy")
text = "Your text here..."
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=8192)
with torch.no_grad():
score = model(**inputs).logits.item()
# Higher score = more spread attention (uses more context)
Part of research on attention-based data filtering for long-context pretraining.