This model is part of the Ettin suite - the first collection of paired encoder-only and decoder-only models trained with identical data, architecture, and training recipes. Ettin enables fair comparisons between encoder and decoder architectures across multiple scales, providing state-of-the-art performance for open-data models in their respective size categories.
GLUE Average
: 88.9 vs 88.4 (Base), 90.8 vs 90.4 (Large)
MTEB v2 English Retrieval
: 45.7 vs 43.9 (Base), 48.4 vs 47.0 (Large)
Code Search and Long Context
: Superior performance on CodeSearchNet and MLDR
Decoder Tasks (vs. SmolLM2 & Llama 3.2)
Average Score
: 46.2 vs 45.2 (SmolLM2-135M)
1B Model
: 59.0 vs 56.6 (Llama 3.2-1B)
Generative Tasks
: Competitive across all model sizes
Key Finding
Architecture-specific advantages persist
: A 400M encoder outperforms a 1B decoder on classification tasks, while a 400M decoder outperforms a 1B encoder on generation tasks.
🚀 Quick Start
Installation
pip install torch>=1.9.0 transformers>=4.21.0
30-Second Examples
Encoder for Classification/Embeddings:
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("jhu-clsp/ettin-encoder-150m")
model = AutoModel.from_pretrained("jhu-clsp/ettin-encoder-150m")
Decoder for Text Generation:
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("jhu-clsp/ettin-decoder-150m")
model = AutoModelForCausalLM.from_pretrained("jhu-clsp/ettin-decoder-150m")
Model Description
Ettin models are designed to provide a foundation for comparing encoder-only and decoder-only architectures. Unlike previous comparisons that were limited by different training data, architectures, and recipes, Ettin models use:
Identical training data
- Same high-quality mixture across all models
Open Training Data
- Data is available now with batch-level training data for each of the 250+ checkpoints
Matched architectures
- Only differing in attention patterns (bidirectional vs causal) and training objectives (MLM vs CLM)
Consistent training recipe
- Three-phase training with 2T tokens
Multiple scales
- From 17M to 1B parameters
This approach allows for true apples-to-apples comparisons between encoder and decoder models, revealing the inherent strengths of each architecture.
Training Data
The training data is publicly available and split across different phases:
These models demonstrate what happens when you continue training encoders as decoders (and vice versa).
Important
: Load these models using the architecture they were
converted to
, not their original architecture.
Encoders Trained from Decoders (Decoder → MLM)
Load as encoders
using
AutoModel
or
AutoModelForMaskedLM
:
# Encoder-from-decoder: Load as encoderfrom transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("jhu-clsp/ettin-encoder-from-decoder-150m")
model = AutoModel.from_pretrained("jhu-clsp/ettin-encoder-from-decoder-150m")
# Decoder-from-encoder: Load as decoder from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("jhu-clsp/ettin-decoder-from-encoder-150m")
model = AutoModelForCausalLM.from_pretrained("jhu-clsp/ettin-decoder-from-encoder-150m")
Accessing Training Checkpoints
Beyond the final models listed above, we provide access to intermediate training checkpoints for research and analysis purposes. These checkpoints allow you to study model behavior and performance throughout the training process. You can get the checkpoints either in HF format or raw for continued pre-training (e.g. Composer format).
from transformers import AutoTokenizer, AutoModelForCausalLM
# Load a specific pretraining checkpoint
model = AutoModelForCausalLM.from_pretrained(
"jhu-clsp/ettin-decoder-400m",
revision="step590532"# Specific checkpoint tag
)
# Load an extension phase checkpoint
model = AutoModelForCausalLM.from_pretrained(
"jhu-clsp/ettin-decoder-400m",
revision="ext1000"
)
# Load a decay phase checkpoint
model = AutoModelForCausalLM.from_pretrained(
"jhu-clsp/ettin-decoder-400m",
revision="decay100"
)
This checkpoint availability enables detailed analysis of training dynamics, loss curves, and capability emergence across the complete 2T token training process.
Usage Examples
Encoder: Masked Language Modeling
Click to expand
encoder
usage examples
from transformers import AutoTokenizer, AutoModelForMaskedLM
import torch
# Load MLM model
tokenizer = AutoTokenizer.from_pretrained("jhu-clsp/ettin-encoder-150m")
model = AutoModelForMaskedLM.from_pretrained("jhu-clsp/ettin-encoder-150m")
defpredict_masked_token(text):
inputs = tokenizer(text, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
# Get predictions for [MASK] tokens
mask_indices = torch.where(inputs["input_ids"] == tokenizer.mask_token_id)
predictions = outputs.logits[mask_indices]
# Get top 5 predictions
top_tokens = torch.topk(predictions, 5, dim=-1)
return [tokenizer.decode(token) for token in top_tokens.indices[0]]
# Example
masked_text = "The capital of France is [MASK]."
predictions = predict_masked_token(masked_text)
print(f"Predictions: {predictions}")
Decoder: Text Generation
Click to expand
decoder text generation
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("jhu-clsp/ettin-decoder-150m")
model = AutoModelForCausalLM.from_pretrained("jhu-clsp/ettin-decoder-150m")
# Set pad token if neededif tokenizer.pad_token isNone:
tokenizer.pad_token = tokenizer.eos_token
defgenerate_text(prompt, max_length=100, temperature=0.7):
inputs = tokenizer(prompt, return_tensors="pt")
with torch.no_grad():
outputs = model.generate(
inputs.input_ids,
max_length=max_length,
temperature=temperature,
do_sample=True,
pad_token_id=tokenizer.eos_token_id,
num_return_sequences=1
)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
# Example usage
prompt = "The future of artificial intelligence is"
generated = generate_text(prompt)
print(generated)
🔬 Research Applications
What Makes Ettin Unique
Ettin provides the first
controlled comparison
of encoder vs. decoder architectures:
Identical Training Data
: Same 2T token mixture across all models
Matched Architectures
: Only attention patterns and objectives differ
Open Everything
: Training data, model weights, and batch-level training order
Multiple Scales
: Fair comparison from 17M to 1B parameters
250+ Checkpoints
: Complete training trajectory analysis
Key Research Findings
Architecture Specialization Persists
:
Encoders excel at classification/retrieval even vs. larger decoders
Decoders excel at generation even vs. larger encoders
A 400M encoder beats a 1B decoder on MNLI (89.2 vs 88.2)
Cross-Training Limitations
:
Converting decoder→encoder or encoder→decoder underperforms
50B tokens of continued training insufficient to close gaps
Native training objective remains superior
Scaling Insights
:
Performance gaps between architectures widen with size
Architecture Studies
: Compare encoder vs decoder capabilities fairly
Training Dynamics
: Analyze 250+ checkpoints with batch-level data ordering
Scaling Laws
: Study how architectural advantages change with scale
Transfer Learning
: Investigate cross-objective training effectiveness
Replication Studies
: First open replication of ModernBERT training recipe
Reproducibility
All training artifacts are publicly available:
Training data with exact batch ordering
Model checkpoints every 8.5B tokens
Complete hyperparameter configurations
Training code and evaluation scripts
Training Details
Data:
High-quality mixture including DCLM, Dolma v1.7, scientific papers, code, and curated sources totaling 2T+ tokens
Architecture:
Transformer with RoPE, GLU activations, and prenorm layers
Training Phases:
Pre-training
: 1.7T tokens with diverse data mixture
Mid-training
: 250B tokens with higher-quality filtered data and context extension to 8K
Decay phase
: 100B tokens with premium data sources
Key Features:
Context length: Up to 8K tokens
Vocabulary: 50,368 tokens (ModernBERT tokenizer)
Deep but efficient architectures following MobileLLM principles
Model Architecture
Parameter
17M
32M
68M
150M
400M
1B
Layers
7
10
19
22
28
28
Hidden Size
256
384
512
768
1024
1792
Intermediate Size
384
576
768
1152
2624
3840
Attention Heads
4
6
8
12
16
28
Citation
If you use Ettin models in your research, please cite our work:
@misc{weller2025seqvsseq,
title={Seq vs Seq: An Open Suite of Paired Encoders and Decoders},
author={Orion Weller and Kathryn Ricci and Marc Marone and Antoine Chaffin and Dawn Lawrie and Benjamin Van Durme},
year={2025},
note={Paper coming soon},
url={https://github.com/jhu-clsp/ettin-encoder-vs-decoder},
}
Runs of jhu-clsp ettin-encoder-17m on huggingface.co
23.8K
Total runs
4.8K
24-hour runs
5.0K
3-day runs
5.5K
7-day runs
16.9K
30-day runs
More Information About ettin-encoder-17m huggingface.co Model
ettin-encoder-17m huggingface.co is an AI model on huggingface.co that provides ettin-encoder-17m's model effect (), which can be used instantly with this jhu-clsp ettin-encoder-17m model. huggingface.co supports a free trial of the ettin-encoder-17m model, and also provides paid use of the ettin-encoder-17m. Support call ettin-encoder-17m model through api, including Node.js, Python, http.
ettin-encoder-17m huggingface.co is an online trial and call api platform, which integrates ettin-encoder-17m's modeling effects, including api services, and provides a free online trial of ettin-encoder-17m, you can try ettin-encoder-17m online for free by clicking the link below.
jhu-clsp ettin-encoder-17m online free url in huggingface.co:
ettin-encoder-17m is an open source model from GitHub that offers a free installation service, and any user can find ettin-encoder-17m on GitHub to install. At the same time, huggingface.co provides the effect of ettin-encoder-17m install, users can directly use ettin-encoder-17m installed effect in huggingface.co for debugging and trial. It also supports api for free installation.