Back to News Hub
🤗Hugging Face
July 28, 2026
Tech

LFM2.5-Encoders for Fast Long-Context Inference on CPU

Overview

A Blog post by Liquid AI on Hugging Face Back to Articles a]:hidden"> LFM2. 5-Encoders for Fast Long-Context Inference on CPU Team Article Published July 28, 2026 Upvote 28 +22 Fernando Fernandes Neto fernandofernandes Follow LiquidAI Edoardo Mosca EdoardoMosca Follow LiquidAI Maxime Labonne mlabonne Follow LiquidAI Leonie Monigatti iamleonie Follow LiquidAI Today, we release two new encoder models on Hugging Face: LFM2. They match the quality of larger models but stay fast as inputs get longer.

Key Takeaways

  • This means you can run document-scale jobs on the hardware you already have, even on CPU.

    Here's what you get: Strong for their size: match or beat larger encoders on GLUE, SuperGLUE, and multilingual tasks.

  • Search is just one thing an encoder enables.

    That's why we built a general-purpose model instead of reusing the retrievers.

  • Masked language modeling: we mask 30% of the tokens during training.

    We train both models in two stages: General language competence : a short-context masked-language objective on a large web corpus at a 1,024-token context.

  • 5B model nearly 10 times its size.

    5-Encoder-230M beats ModernBERT-base and every EuroBERT model, while being smaller than most of them.

  • At 8,192 tokens, ModernBERT-base takes over a minute and a half per forward pass versus about 28s for LFM2.

Stats & Key Facts

  • #5-Encoders for Fast Long-Context Inference on CPU Team Article Published July 28, 2026 Upvote 28 +22 Fernando Fernandes Neto fernandofernandes Follow LiquidAI Edoardo Mosca EdoardoMosca Follow LiquidAI Maxime Labonne mlabonne Follow LiquidAI Leonie Monigatti iamleonie Follow LiquidAI Today, we release two new encoder models on Hugging Face: LFM2.
  • #8,192-token context with latency that grows slowly as inputs get longer.
  • #Masked language modeling: we mask 30% of the tokens during training.
  • #We train both models in two stages: General language competence : a short-context masked-language objective on a large web corpus at a 1,024-token context.

This means you can run document-scale jobs on the hardware you already have, even on CPU. Here's what you get: Strong for their size: match or beat larger encoders on GLUE, SuperGLUE, and multilingual tasks. 8,192-token context with latency that grows slowly as inputs get longer.

7× faster than ModernBERT-base at long context. With these, you can build intent routers, policy linters, PII detectors, and text classifiers that run cheaply, all day. Why we built a general-purpose encoder Last month we released LFM2.

5-Retrievers , built for multilingual search. 5-Encoders come from the same family but serve a broader purpose. They're pre-trained with a masked-language objective, so you can fine-tune them for classification, token-level tasks, and search alike.

For more details please read the original article at Hugging Face.

Continue Learning

Originally published by Hugging Face
Read the original

Comments

Sign in to join the conversation