Model Release

Liquid AI’s LFM2.5 Encoders Hit 8K Context on CPU Without a GPU

Liquid AI releases LFM2.5-Encoder-230M and LFM2.5-Encoder-350M: open-weight bidirectional encoders with 8,192-token context that run on CPU. Benchmarks, use cases, and how to load them.

LUMIEN5 min read
Liquid AI’s LFM2.5 Encoders Hit 8K Context on CPU Without a GPU

Liquid AI has released two open-weight bidirectional encoders, LFM2.5-Encoder-230M and LFM2.5-Encoder-350M, both built on the LFM2 hybrid backbone and carrying an 8,192-token context window. They are designed for classification, intent routing, safety filtering, and PII detection on CPU, without a GPU in the loop. The 350M ranks fourth out of 14 models on a 17-task benchmark mean of 81.02, beaten only by models at least 395M parameters in size. The 230M completes a single forward pass at 8K tokens in roughly 28 seconds on CPU, compared to over 90 seconds for ModernBERT-base.

What happened

Detail Value
Models released LFM2.5-Encoder-230M and LFM2.5-Encoder-350M
Context window 8,192 tokens (approx. 13-15 pages)
Vocabulary size 65,536 tokens
Hidden size 1,024
Languages supported 15
350M benchmark rank 4th of 14 models, mean 81.02 (±1.00)
230M CPU latency at 8K tokens ~28 seconds per forward pass
License LFM Open License v1.0

Liquid AI converted its existing LFM2.5-230M and LFM2.5-350M decoder models into encoders using three modifications. First, the causal attention mask (which only lets a token look backward) was replaced with a bidirectional one, so every token can attend to all surrounding tokens. Second, the short convolution layers were made non-causal with symmetric center padding, mixing in context from both directions. Third, the models were trained with masked language modeling (MLM) at a 30% mask rate, which is double BERT’s original 15%, a density Liquid AI says helps at this scale.

Training ran in two stages. Stage one used a short-context MLM objective at 1,024 tokens on a large web corpus to build general language competence. Stage two extended context to 8,192 tokens on a fuller data mix to strengthen factual, legal, and multilingual understanding.

How do these compare to ModernBERT and XLM-R?

Liquid AI benchmarked 14 encoder models across 17 tasks drawn from GLUE, SuperGLUE, and multilingual classification. Every model was fully fine-tuned per task. Here is how the top results stack up:

Model Parameters 17-task mean Rank
XLM-R XL 3.5B 83.06 1st
ModernBERT-large 395M 81.68 2nd
XLM-R large 560M 81.34 3rd
LFM2.5-Encoder-350M 350M 81.02 4th
LFM2.5-Encoder-230M 230M 79.29 6th
ModernBERT-base ~150M 78.19 below 6th
EuroBERT-610M 610M 75.87 below 6th
EuroBERT-2.1B 2.1B 72.19 below 6th

The methodology is reproducible and open-sourced under Apache-2.0. All models were loaded with fp32 master weights and bf16 autocast, which means number format differences cannot skew the comparison. Learning rates were selected across 10 rates and 3 seeds, then final scores were reported as a mean over 5 fresh seeds that never touched the selection process. The Transformers library was pinned to version 4.56.2 to prevent dependency drift from becoming a hidden variable.

Why it matters

Encoders are the unsung workhorses of production AI. Classifiers, safety filters, intent routers, and PII detectors all rely on them, and they run continuously, often without access to a GPU. The problem with older encoders like BERT is that their compute cost grows fast as inputs get longer. Liquid AI’s claim is that the LFM2 architecture scales more slowly with sequence length, making an 8K context feasible on CPU hardware.

Three deployment scenarios are the stated target. Edge and embedded devices, like a car’s onboard controller, have no spare GPU and cannot send data to the cloud. Regulated environments in finance, healthcare, and legal need long documents processed on-premise. High-volume pipelines can use a small, cheap encoder as a first-pass filter before routing work to a larger, more expensive model. Teams building those kinds of pipelines might also want to look at AI integration patterns that avoid unnecessary cloud calls.

An 8,192-token context window covering a full contract in one forward pass is a practical threshold, not just a benchmark number. Most legal and financial documents fall under that ceiling.

Our take

The benchmark result is credible because the methodology is unusually clean. Pinning library versions, separating selection seeds from reporting seeds, and using the same optimizer recipe across all 14 models removes most of the usual room for cherry-picking. The 350M ranking fourth behind three larger models is an honest result, not a selective leaderboard claim.

The CPU latency story is the more commercially interesting angle. At roughly 28 seconds per 8K-token forward pass on CPU, the 230M is usable for batch classification jobs in regulated environments where sending data to an API is not an option. For anything near real-time, you still want GPU or a much shorter input.

The catch is that these are base encoders. You must fine-tune before you get task outputs. That is normal for this class of model, but it adds a step that teams sometimes underestimate. Liquid AI ships a fine-tuning tutorial focused on long legal documents at 8K context, which is a good starting point. If you are evaluating encoder options for a classification or routing layer, this is worth a test run alongside ModernBERT-large given the size-to-accuracy ratio. For teams curious about how we approach these decisions for clients, our client project writeups show how encoder-based classification fits into real production stacks.

We have also covered the broader trend of routing cheaper models to cut costs, and the LFM2.5-Encoder-230M fits that pattern well as a lightweight gatekeeper in front of heavier models.

What to do about it

  1. Check your classification or routing workload: if you process documents longer than 512 tokens on CPU, benchmark this against your current encoder.
  2. Load the model via Hugging Face Transformers using trust_remote_code=True; the class names are Lfm2BidirectionalModel and Lfm2BidirectionalForMaskedLM.
  3. Follow Liquid AI’s fine-tuning tutorial, especially the 8K context configuration if your documents are long.
  4. Start with the 350M for accuracy-sensitive tasks and the 230M for tighter hardware or higher throughput, per Liquid AI’s own guidance.
  5. Run the five CPU-only Hugging Face Space demos before committing to integration to validate the PII detector’s 40-type, 16-language coverage against your actual data.

If your pipeline routes or classifies long documents on-premise, these encoders are worth a benchmark run this week.

Source: Marktechpost

Frequently asked questions

What is the context window for Liquid AI's new encoders?

Both LFM2.5-Encoder-230M and LFM2.5-Encoder-350M support 8,192 tokens, which Liquid AI describes as roughly 13 to 15 pages. One forward pass can cover a full contract or a complete patient record.

How fast are the LFM2.5 encoders on CPU at 8K context?

According to Liquid AI's benchmarks, the 230M model completes one forward pass at 8,192 tokens in roughly 28 seconds on CPU, compared to over 90 seconds for ModernBERT-base at the same length.

How does LFM2.5-Encoder-350M compare to ModernBERT-large?

On a 17-task benchmark mean across GLUE, SuperGLUE, and multilingual classification tasks, LFM2.5-Encoder-350M scores 81.02 and ranks 4th, while ModernBERT-large scores 81.68 and ranks 2nd. Both are fully fine-tuned results.

Do the Liquid AI encoders need fine-tuning before use?

Yes. The released checkpoints are base encoders that produce general-purpose representations. Fine-tuning on your specific task is required before you get useful classification or routing outputs. Liquid AI provides a fine-tuning tutorial focused on long legal documents at 8K context.

More from AI