Ettin Suite: SoTA Paired Encoders and Decoders
Ettin is a suite of paired encoder-only and decoder-only models (17M–1B parameters) trained on identical open data (2T tokens), architecture and three-phase recipe derived from ModernBERT, differing only in attention pattern and objective (MLM vs CLM). The encoders beat ModernBERT and the decoders match or beat Llama 3.2 1B and SmolLM2. The controlled comparison shows encoders dominate classification and retrieval (a 150M encoder beats a 400M decoder on MNLI) while decoders win at generation. Continued training with the opposite objective for 50B tokens fails to close the gap, so architecture choice matters beyond the objective. Usage and fine-tuning code for Sentence Transformers and PyLate ColBERT embeddings is included.
Related posts
- Introducing the Ettin Reranker Family
Hugging Face mediumAdeptSix Sentence Transformers CrossEncoder rerankers (17M to 1B parameters) built on the Ettin ModernBERT encoders are released with their data and full training recipe. They were distilled with pointwise MSE on mxbai-rerank-large-v2 scores. On MTEB(eng, v2) Retrieval, top-100 reranked across six embedders, the 1B model matches its 1.54B teacher (0.6114 vs 0.6115 NDCG@10). The 17M beats the legacy ms-marco-MiniLM-L12-v2 by +0.051, and the 150M edges out Qwen3-Reranker-0.6B. The architecture uses a plain AutoModel with CLS pooling, which ablations found beat mean pooling, plus a small dense head, enabling unpadded Flash Attention 2 for 1.7x-8.3x speedups over fp32+SDPA with 8K context.
- Finally, a Replacement for BERT: Introducing ModernBERT
Hugging Face mediumAdeptModernBERT is a family of encoder-only models (149M base, 395M large) that ports recent LLM architecture and training advances back to the BERT style, raising context length to 8,192 tokens and including large amounts of code in pretraining. It is the first base-size model to beat DeBERTaV3 on GLUE while using under 1/5th of its memory, and it runs 2-4x faster, especially on mixed-length inputs. It also leads long-context ColBERT retrieval and code retrieval tasks such as StackOverflow-QA. It works as a drop-in BERT replacement in transformers, without token type IDs and with Flash Attention 2 recommended, and must be fine-tuned for downstream tasks.
- Train a Sentence Embedding Model with 1B Training Pairs
Hugging Face hardMasterSentence embedding models trained with a contrastive multiple-negatives ranking loss (InfoNCE) on up to 1 billion sentence pairs, using in-batch negatives, a scaled similarity (C≈20), and cosine vs. dot-product tradeoffs for clustering and ANN search. Batch composition drives quality: larger batches, hard negatives, and batches drawn mostly from one dataset but mixing at least two to learn both local and global topic structure. Training ran on TPU v3-8s with JAX/Flax and produced 20 general-purpose Sentence Transformers models (MiniLM, RoBERTa, DistilBERT, MPNet) reported as state of the art on sentence similarity tasks, plus 8 datasets and a Spaces demo.
- tokenizers v1: encode, decode and scaling, measured
Hugging Face mediumAdepttokenizers v1 encodes text 3 to 30 times faster than v0.23 single-threaded on an Apple M4 Max and scales at 76% of linear across eight cores, while producing identical token IDs and keeping the same API. The gains come from replacing regex pre-tokenization with SIMD bitstream operations (bitcannon) for common BPE patterns, a thread-local word cache for repeated pre-tokens, an allocation-free merge loop using an intrusive linked list in a scratch buffer with ranks packed into 64-bit integers, batched model calls, and per-thread sub-pools for parallel encoding. The benchmark methodology separates load time, verifies output by hashing IDs, pins to physical cores, and warns that 'warm' benchmarks on repeated versus distinct documents measure very different workloads.
- Assisted Generation: a new direction toward low-latency text generation
Hugging Face mediumAdeptAssisted generation cuts autoregressive LLM latency by letting a much smaller assistant model with the same tokenizer greedily draft candidate tokens, then verifying them all in a single forward pass of the large model. The large model keeps matching tokens plus the first divergent one. The draft length adapts: it grows by 2 when every candidate matches and shrinks by 1 otherwise. The approach exploits the fact that forward passes are memory-bandwidth bound. In 🤗 Transformers it is exposed through an `assistant_model` argument to `generate` (batch size 1 only) and yields up to 2x speedups, 3x with INT8, and up to 10x when the model relies on memory offloading. It works best on input-grounded tasks like ASR and summarization, and with sampling only at low temperatures.