agentlans/think-at-length
Viewer โข Updated โข 125k โข 48
How to use agentlans/ettin-17m-thinking-ruler with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="agentlans/ettin-17m-thinking-ruler") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("agentlans/ettin-17m-thinking-ruler")
model = AutoModelForSequenceClassification.from_pretrained("agentlans/ettin-17m-thinking-ruler", device_map="auto")ettin-17m-thinking-ruler is a lightweight 17M-parameter encoder model that estimates how much chain-of-thought (CoT) reasoning a language model is likely to need for a given prompt.
It is fine-tuned from jhu-clsp/ettin-encoder-17m on agentlans/think-at-length, a dataset of long reasoning traces across frontier and leading-edge models. For detailed validation analysis, see report.md.
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model_id = "agentlans/ettin-17m-thinking-ruler"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
model.eval()
prompts = [
"What is the capital of Canada?",
"Prove that there are infinitely many primes and discuss edge cases in formal proofs.",
]
inputs = tokenizer(prompts, padding=True, truncation=True, return_tensors="pt")
with torch.no_grad():
scores = model(**inputs).logits.squeeze(-1)
for prompt, score in zip(prompts, scores.tolist()):
print(f"Score: {score:.4f} | Prompt: {prompt}")
# Clearly see the difference in the amount of reasoning required to answer these prompts.
# Score: -0.8227 | Prompt: What is the capital of Canada?
# Score: 0.5654 | Prompt: Prove that there are infinitely many primes and discuss edge cases in formal proofs.
jhu-clsp/ettin-encoder-17magentlans/think-at-length5e-588torch_fused, beta_1 = 0.9, beta_2 = 0.999, epsilon = 1E-8, no extra optimizer args)3.042Best validation MSE was reached at epoch 2.0 (0.3825), with slight overfitting by epoch 3.0.
| Epoch | Step | Training Loss | Validation Loss | MSE |
|---|---|---|---|---|
| 1.0 | 12,500 | 0.3960 | 0.4078 | 0.4078 |
| 2.0 | 25,000 | 0.3509 | 0.3825 | 0.3825 |
| 3.0 | 37,500 | 0.2588 | 0.3847 | 0.3847 |
5.17.02.9.1+cu1284.4.10.23.2MIT License like the base model
Base model
jhu-clsp/ettin-encoder-17m