ettin-17m-thinking-ruler

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.

  • Input: A text prompt.
  • Output: A continuous reasoning-length score, where higher values indicate longer expected thinking traces.

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.

Usage

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.

Limitations & Caveats

  • Model and sampler sensitivity: Actual reasoning length depends heavily on the target generator model, system prompt, temperature/sampling settings, and stop/budget configurations.
  • Relative signal, not an exact token count: Treat the output as a relative difficulty/length estimate rather than a direct token counter unless you fit a calibration mapping on your specific target model and evaluation set.

Training Details

Training Hyperparameters

  • Base model: jhu-clsp/ettin-encoder-17m
  • Dataset: agentlans/think-at-length
  • Learning rate: 5e-5
  • Train batch size: 8
  • Eval batch size: 8
  • Optimizer: AdamW (torch_fused, beta_1 = 0.9, beta_2 = 0.999, epsilon = 1E-8, no extra optimizer args)
  • LR scheduler: Linear
  • Epochs: 3.0
  • Additional features: bfloat16, NEFTunes alpha = 5
  • Seed: 42

Training Results

Best 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

Framework Versions

  • Transformers: 5.17.0
  • PyTorch: 2.9.1+cu128
  • Datasets: 4.4.1
  • Tokenizers: 0.23.2

Licence

MIT License like the base model

Downloads last month
37
Safetensors
Model size
16.9M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for agentlans/ettin-17m-thinking-ruler

Finetuned
(61)
this model

Dataset used to train agentlans/ettin-17m-thinking-ruler

Evaluation results