AIToday

Liquid AI releases fast CPU-ready encoders for document-scale tasks

Hugging Face Blog3h agoSend on LINE
Liquid AI releases fast CPU-ready encoders for document-scale tasks

Key takeaway

Liquid AI released LFM2.5-Encoder-230M and LFM2.5-Encoder-350M, two open-weight text encoders designed for fast CPU inference on long documents up to 8,192 tokens. The models match or exceed larger encoders on standard benchmarks while running about 3.7× faster than ModernBERT-base on CPU, enabling developers to run classification, routing, and detection tasks on laptops without cloud services.

Summaries like this, in your inbox every morning.

Sign up free →

3 Key Points

  • What happened

    Liquid AI released two encoder models—LFM2.5-Encoder-230M and LFM2.5-Encoder-350M—on Hugging Face. Both support 8,192-token context and are optimized for CPU inference. LFM2.5-Encoder-350M ranks fourth among 14 models on GLUE, SuperGLUE, and multilingual benchmarks; LFM2.5-Encoder-230M beats ModernBERT-base and every EuroBERT model while being smaller than most.

  • Why it matters

    The models enable businesses to run text classification, intent routing, PII detection, and document analysis on existing CPU hardware without cloud inference costs. At 8,192 tokens, LFM2.5-Encoder-230M is about 3.7× faster than ModernBERT-base on CPU (28 seconds versus over a minute and a half per forward pass), making it practical to scan a full contract or transcript on a laptop.

  • What to watch

    Both models are open-weight and available now on Hugging Face. Live demos (prompt routing, policy linting, spell checking, PII detection) run in CPU-only spaces with no setup required. A fine-tuning tutorial covers adaptation to custom tasks on long legal documents at 8,192-token context.

In Depth

Liquid AI released LFM2.5-Encoder-230M and LFM2.5-Encoder-350M as open-weight models on Hugging Face, extending the LFM2 family beyond retrieval into general-purpose text encoding. The encoders initialize from LFM2 decoder backbones and convert them to bidirectional models by applying a bidirectional attention mask so each token sees both left and right context, using non-causal short convolutions padded symmetrically to mix in neighboring tokens, and training with 30% token masking. Pretraining occurs in two stages: first, general language competence using masked-language modeling on a large web corpus at 1,024-token context; second, long-context adaptation extending to 8,192 tokens on the full data mix to strengthen factual, legal, and multilingual performance.

Benchmark results across GLUE, SuperGLUE, and multilingual classification tasks place LFM2.5-Encoder-350M fourth among 14 models tested, with only three larger models scoring higher—notably a 3.5B model nearly 10 times its size. LFM2.5-Encoder-230M beats ModernBERT-base and every EuroBERT model tested while remaining smaller than most. On CPU inference, the speed advantage is substantial: at 8,192 tokens, LFM2.5-Encoder-230M completes a forward pass in about 28 seconds, compared to over a minute and a half for ModernBERT-base—about 3.7× faster. LFM2.5-Encoder-230M is also fastest on CPU at every sequence length, even outpacing ModernBERT-base on short inputs. On GPU, LFM2.5-Encoder-350M and LFM2.5-Encoder-230M lead from about 2K tokens onward, whereas ModernBERT-base performs better below ~1K tokens on Apple GPU.

The article provides five live demos running in CPU-only Hugging Face spaces: zero-shot prompt routing (score prompts against custom routing lanes), zero-shot policy linting (score text against company rules), spell checking (token-level correction), PII detection (identifying and removing 40 kinds of personal information across 16 languages), and masked-diffusion text generation (an encoder-based chatbot that generates text by iteratively unmasking). For deployment, developers should choose LFM2.5-Encoder-350M when accuracy is paramount, or LFM2.5-Encoder-230M for tighter hardware constraints or higher throughput. Both models are available immediately on Hugging Face and can be loaded and run with the transformers library in a few lines of Python; they can also be attached to custom heads for fine-tuning on classification, token classification, regression, or retrieval tasks, with a tutorial provided for fine-tuning on long legal documents at 8,192-token context.

Context & Analysis

Liquid AI's new encoders address a persistent production-NLP need: running high-volume understanding tasks cheaply and fast on CPU. The company released LFM2.5-Retrievers for multilingual search last month; these encoders extend that family with a broader mandate, using masked-language pretraining instead of retrieval objectives so they can be fine-tuned for classification, token-level tasks, and search alike. The models inherit the fast-inference architecture of the LFM2 decoder backbone but flip it to bidirectional: each token sees neighbors on both sides, and short convolutions are padded symmetrically. Training happens in two stages—general language competence at 1,024 tokens on web text, then long-context adaptation extending to 8,192 tokens on a mixed corpus to strengthen factual, legal, and multilingual performance.

The benchmark results show LFM2.5-Encoder-350M ranks fourth among 14 models tested, with only three larger models ahead (including a 3.5B model nearly 10 times its size). LFM2.5-Encoder-230M outperforms ModernBERT-base on GLUE, SuperGLUE, and multilingual tasks despite being smaller. The speed advantage on CPU is dramatic: at 8,192 tokens, LFM2.5-Encoder-230M is about 3.7× faster than ModernBERT-base. On GPU, a similar pattern holds with a narrower margin—ModernBERT-base leads below ~1K tokens on Apple GPU, but LFM2.5-Encoders take the lead from about 2K tokens onward. For developers, this means scanning or classifying full documents (contracts, transcripts, long support threads) in under 30 seconds on a laptop CPU—a practical shift for always-on NLP applications.

FAQ

How fast is LFM2.5-Encoder-230M compared to ModernBERT-base on CPU?
At 8,192 tokens, LFM2.5-Encoder-230M processes a forward pass in about 28 seconds, versus over a minute and a half for ModernBERT-base—about 3.7× faster.
What tasks can I use these encoders for?
You can fine-tune them for classification, routing, extraction, scoring, token-level tasks like PII detection and spell checking, and search. The article includes working demos for prompt routing, policy linting, spell checking, and PII detection across 40 types and 16 languages.
How do I choose between the two encoder sizes?
LFM2.5-Encoder-350M is recommended when accuracy matters most; LFM2.5-Encoder-230M is better for tighter hardware or higher throughput.

Get AI news like this every morning

AI-summarized, only the topics you pick — one digest a day via Email, Slack, or Discord.

Free · takes 30 seconds · unsubscribe anytime

Discussion

No discussion yet for this article

Stay ahead with AI news

Get curated AI news from 200+ sources delivered daily to your inbox. Free to use.

Get Started Free

Free · takes 30 seconds · unsubscribe anytime