Hugging Face Gets New LFM2.5 Encoders, Putting Long-Context CPU Inference Against ModernBERT
- Sophie Larsen

- 9 hours ago
- 10 min read
Hugging Face added two Liquid AI encoder models that process 8,192-token inputs while challenging ModernBERT on long-context CPU speed. The release puts a specific claim under scrutiny: document-scale language processing does not always need a GPU or a generative model.
Liquid AI says its 230-million-parameter encoder completes an 8,192-token forward pass on a tested CPU in about 28 seconds. ModernBERT-base required more than 90 seconds in the company’s comparison. That reported gap makes LFM2.5 vs ModernBERT a contest over deployment economics, not only benchmark accuracy.
The result matters because encoders quietly handle persistent workloads such as classification, routing, extraction, moderation, and personal-information detection. These systems often inspect every incoming document or message. A slower model can therefore consume substantial infrastructure even when each individual task appears modest.
Liquid AI has published its model weights, evaluation harness, model cards, and CPU-only demonstrations. However, the headline performance remains a vendor-run result. Important deployment details, including processor configuration and optimized runtime support, still need broader independent testing.
Hugging Face Adds Two Open-Weight LFM2.5 Encoders
The release turns Liquid AI’s decoder architecture into two task-focused encoders built for long documents and ordinary computing hardware.
Liquid AI released LFM2.5-Encoder-230M and LFM2.5-Encoder-350M on Hugging Face on July 28, 2026. Both support contexts of up to 8,192 tokens and use the company’s LFM2 hybrid architecture.
An encoder reads an input and produces contextual representations for classification, retrieval, extraction, or token-level decisions. Unlike a causal language model, it does not primarily generate the next token from left to right.
The distinction shapes both cost and behavior. A support-ticket router needs to select a destination, not compose a response. A privacy filter needs to locate sensitive spans, not produce a fluent paragraph.
Liquid AI adapted its existing 230M and 350M decoder backbones for those narrower jobs. It replaced the causal attention mask with bidirectional attention, allowing each token to consider text on both sides. The company also made the architecture’s short convolutions non-causal through symmetric padding.
Training used masked language modeling, where selected tokens are hidden and the model predicts them from surrounding context. Liquid AI says it masked 30 percent of tokens during training.
The company used a two-stage schedule. Initial training covered 1,024-token sequences on a large web corpus. A second stage extended the context to 8,192 tokens using data intended to strengthen factual, legal, and multilingual performance.
The 230M model card lists approximately 229.7 million parameters. The 350M version contains approximately 354.5 million. Both have a hidden size of 1,024 and a vocabulary containing 65,536 entries.
They support 15 languages, according to the model card. Those languages include English, Spanish, French, Arabic, Hindi, Japanese, Vietnamese, and Chinese.
Liquid AI positions the smaller model for tighter latency and memory constraints. It presents the larger version as the accuracy-oriented choice. Both require task-specific fine-tuning before they become production classifiers, routers, or extraction systems.
That qualification is important to any LFM2.5 encoder explained as a ready-made application. The base models supply language representations, but organizations must attach an output head and train for their target task.
The models use Liquid AI’s LFM Open License v1.0. Calling them open-weight means developers can download and run the trained parameters. It does not mean the release uses a standard permissive software license.
Hugging Face provides the distribution point, model cards, community discussion, and demonstrations. Liquid AI supplies the architecture, weights, evaluations, and implementation. This arrangement makes experimentation easy while keeping responsibility for the central performance claims with the model developer.
The immediate change is therefore concrete. Developers now have two downloadable, long-context encoders designed around CPU deployment rather than GPU-first generation.
Why Long-Context CPU Inference Is the Real Prize
The central opportunity is not a smaller chatbot, but a cheaper decision layer that can inspect complete working documents.
Production language systems perform many tasks that never require prose generation. They label requests, detect policy violations, classify sentiment, identify entities, rank passages, and choose which larger model receives a prompt.
These operations can run far more frequently than visible chatbot responses. An agent platform might evaluate a prompt against several safety rules before generation. It might classify the result again before delivering it.
Running every stage through a large generative model adds latency and hardware demand. It can also introduce variable output into tasks that need predictable labels or token spans.
A fine-tuned encoder offers a different route. It reads the relevant text in one forward pass and returns task-specific scores. The model can remain inside a local process instead of sending each document to an external service.
Context length determines whether that process sees the complete source. Older encoders often centered on shorter sequences, forcing developers to divide contracts, transcripts, or support threads into chunks. Chunking can separate a decision from the evidence that changes its meaning.
An 8,192-token window does not cover every long document. It does cover substantially more text than classic 512-token BERT deployments. That difference can reduce chunking and the surrounding aggregation logic.
Liquid AI illustrates the approach with CPU-only Hugging Face Spaces. Its demonstrations cover prompt routing, policy linting, spell checking, and personally identifiable information detection.
The PII demonstration reportedly detects 40 information types across 16 languages. Policy linting scores tokens against rules supplied as free text. Prompt routing compares an entire prompt against user-defined routing categories.
Those demonstrations identify the workloads Liquid AI wants to win. They are high-volume understanding tasks with bounded outputs and recurring infrastructure costs.
A local policy filter is especially relevant for agent systems. The filter can operate inside the same environment as an application, reducing the need to expose internal text to another remote endpoint.
The same logic applies to local technical documents. Teams building a searchable knowledge base need classification, extraction, and retrieval stages before any generated answer appears.
CPU deployment broadens where those stages can run. A developer laptop, an application server, or an edge device can execute the model without reserving a separate accelerator.
However, “runs on CPU” does not automatically mean instant or inexpensive at every scale. A 28-second pass can be practical for one contract and unsuitable for an interactive interface. Batch throughput also differs from single-document latency.
The stronger claim is operational flexibility. Teams can place specialized language processing where their data already resides, then reserve GPUs or remote models for tasks that truly require generation.
That division of labor pressures vendors selling general-purpose inference for every language operation. It also pressures teams that default to large language models before measuring whether a smaller encoder can handle the requirement.
LFM2.5 vs ModernBERT Comes Down to the Architecture
Liquid AI’s reported speed advantage grows with input length because its hybrid backbone avoids applying full attention in every layer.
ModernBERT provides the clearest opponent because it also targets efficient bidirectional encoding with an 8,192-token context. Released in late 2024, it updated the BERT design for longer inputs, modern hardware, and improved training.
The original BERT research established bidirectional pretraining as a foundation for language understanding. ModernBERT later combined that approach with architectural and training updates aimed at current deployment needs.
Liquid AI takes another route. LFM2 interleaves grouped-query attention with gated short-convolution blocks. Attention connects information across a sequence, while short convolutions focus on neighboring tokens with lower computational overhead.
This hybrid structure matters as inputs grow. Full self-attention compares positions across the sequence, so its computational burden rises quickly with length. Convolutional layers restrict more of their work to local neighborhoods.
Liquid AI does not remove attention. It reduces how often the architecture pays its full cost. The model can still exchange information across distant positions while processing many layers through cheaper local operations.
For encoder use, Liquid AI made those local operations bidirectional. Symmetric padding allows a convolution to incorporate neighbors before and after the current token. Full-attention layers also receive a bidirectional mask.
That mechanism creates the central case for LFM2.5 vs ModernBERT. Liquid AI is betting that hybrid sequence processing can preserve competitive understanding while slowing the growth of long-input latency.
According to the release results, LFM2.5-Encoder-230M was the fastest tested model at every CPU sequence length. Its advantage became most visible at the 8,192-token limit.
Liquid AI reports about 28 seconds for the smaller LFM2.5 model at that length. It says ModernBERT-base took more than 90 seconds, producing the stated 3.7-fold advantage.
The company observed a narrower pattern on an Apple GPU. ModernBERT-base reportedly led below roughly 1,000 tokens. Liquid AI’s encoders moved ahead from approximately 2,000 tokens.
That crossover illustrates the trade. Architecture choices optimized for long inputs do not guarantee leadership on short ones. Many production classification requests remain far below 2,000 tokens.
Parameter counts also complicate a simple speed comparison. ModernBERT-base contains about 149 million parameters, while Liquid AI’s smaller encoder contains about 230 million. The LFM2.5 model is larger but reportedly faster at long CPU sequences.
The benchmark therefore tests more than parameter count. Kernel behavior, memory access, sequence length, runtime configuration, and processor characteristics all influence measured latency.
The LFM2.5 encoder explained through this mechanism is not a universal replacement for attention-based models. It is a claim that mixed sequence operations fit long-context CPU workloads better.
Developers should benchmark against their actual input distribution. A system dominated by short messages might favor different architecture choices from one processing legal agreements or lengthy transcripts.
They should also measure total pipeline time after fine-tuning. Tokenization, batching, output heads, post-processing, and data transfer can change the advantage visible in a model-only forward pass.
Benchmark Quality Is Competitive, but the Evidence Has Limits
Liquid AI presents a credible reproducibility package, yet its results do not settle production performance across CPUs, runtimes, or specialized tasks.
The company evaluated 14 models across 17 tasks drawn from GLUE, SuperGLUE, and multilingual classification suites. Each model received full supervised fine-tuning for each task.
Liquid AI reports the mean from five held-out random seeds. Multiple seeds reduce the risk that an unusually favorable training run determines the ranking.
Its 350M encoder ranked fourth with a reported 17-task mean of 81.02. The models ahead were XLM-R XL, ModernBERT-large, and XLM-R large.
XLM-R XL led with 83.06 and contains 3.5 billion parameters. ModernBERT-large scored 81.68 with 395 million parameters. XLM-R large reached 81.34 with 560 million.
LFM2.5-Encoder-230M ranked sixth with 79.29. ModernBERT-base ranked seventh with 78.19. These averages support Liquid AI’s claim that its encoders remain competitive for their size.
They do not show consistent leadership across every task. ModernBERT-base exceeded the 230M LFM2.5 model on several individual benchmarks, while Liquid AI led on others.
The aggregated ranking also blends different evaluation types. The tasks include natural-language inference, paraphrase detection, sentiment analysis, semantic similarity, and multilingual classification.
An average helps compare general capability, but it can hide the measure that matters for a particular deployment. A policy system cares about false negatives and calibration, not its position on an unrelated sentiment task.
Liquid AI has released its evaluation harness, which improves the opportunity for replication. The repository includes downstream fine-tuning code and configurations associated with the reported comparisons.
Still, open code does not equal independent confirmation. Liquid AI selected the training procedure, comparison setup, aggregation method, and inference environment.
The CPU latency claim carries the largest unanswered question. The public article describes the sequence lengths and elapsed times, but it does not clearly identify the tested CPU configuration.
That omission affects interpretation. Laptop processors, cloud server CPUs, memory channels, instruction sets, thread counts, and power limits can produce very different behavior.
The current loading instructions also use trust_remote_code=True, allowing repository-provided code to execute through the Transformers library. Organizations with strict software controls will need to review that code before deployment.
The model card does not present a mature ONNX or OpenVINO deployment path. Those runtimes often matter to teams optimizing CPU inference, quantization, and cross-platform serving.
Quantized performance is another open issue. The published comparison does not establish how LFM2.5 behaves after lower-precision conversion or whether the same relative advantage survives.
The release also lacks production evidence covering sustained concurrency. Processing one long sequence measures latency, while an always-on classifier needs throughput, tail latency, memory usage, and stability under load.
Accuracy requires the same caution. Benchmark fine-tuning does not establish performance on an organization’s contracts, safety rules, customer language, or privacy categories.
A team evaluating LFM2.5 vs ModernBERT should reproduce both models using identical hardware and optimized settings. It should test short, median, and worst-case documents from the real workload.
The evaluation should include failure costs. A faster PII detector has little value if it misses sensitive identifiers that the current system catches. A routing model must also avoid sending requests to inappropriate downstream tools.
These limitations do not invalidate the release. They define the difference between a promising architecture result and a deployment decision.
What Hugging Face Developers Should Watch Next
Three signals will determine whether this release becomes a practical CPU standard or remains an interesting vendor benchmark.
The first signal is independent hardware replication. Developers need results across Apple silicon, mainstream x86 laptops, and server processors with disclosed thread counts and memory configurations.
Replication should measure more than the 8,192-token endpoint. Real datasets contain mixed lengths, so percentile latency and documents processed per hour provide a clearer operational picture.
If independent tests preserve a large long-context advantage, Liquid AI’s architectural case strengthens. If the gap contracts after equal runtime optimization, implementation choices likely explain more of the headline.
The second signal is optimized runtime support. ONNX exports, OpenVINO integration, stable quantization recipes, and native library support would make the models easier to operate beyond experimental Python environments.
These additions would also test whether the hybrid backbone maps well onto widely deployed CPU toolchains. A model that depends on custom eager execution can face adoption friction despite good benchmark results.
Successful 8-bit or lower-precision deployments would strengthen the local-inference argument. They could reduce memory and increase throughput while keeping task accuracy within acceptable limits.
The opposite result would weaken the comparison. ModernBERT and other established encoders benefit from mature optimization paths, so raw architecture speed does not guarantee the best deployed system.
The third signal is task-level adoption. Hugging Face download counts offer an early indicator, but published fine-tunes and reproducible case studies matter more.
Useful evidence would include policy filters measured on organizational rules, multilingual PII systems tested against realistic identifiers, and routers operating under sustained application traffic.
Developers should look for false-positive rates, false-negative rates, calibration, memory use, and tail latency. Those measures reveal whether the model improves a system rather than a leaderboard position.
Liquid AI’s fine-tuning example gives teams a starting point for classification. The next step is evidence from users who did not design the architecture.
Competitor responses will provide another clue within those signals. ModernBERT implementations can gain optimized kernels, while other long-context encoders can adopt hybrid or sparse processing.
Generative model vendors also have room to respond with cheaper classification endpoints. However, remote services still face data-transfer, connectivity, and local-control constraints that on-device encoders avoid.
For knowledge workers, the development could make local document organization more responsive and private. Contracts, transcripts, notes, and support histories can be classified before any text leaves a controlled environment.
For enterprise buyers, the release creates a sharper procurement question. Does each language task require generative reasoning, or can a specialized encoder deliver the needed decision with lower infrastructure demand?
For developers, the correct response is measurement. Build a representative test set, define accuracy thresholds, record the input-length distribution, and compare complete pipelines on deployment hardware.
Hugging Face makes that experiment accessible because both LFM2.5 variants and their supporting materials are available in one place. Accessibility, however, should not substitute for validation.
Liquid AI has offered a clear technical proposition: long-context understanding can stay on CPUs when an architecture limits repeated full-attention work. Its benchmarks give that proposition credible initial support.
The unresolved issue is whether independent deployments reproduce the advantage after every model receives equal optimization. That question should guide the next wave of tests, fine-tunes, and production reports.
If your team processes long documents continuously, compare LFM2.5 against the encoder already serving your workload. Use actual documents, disclosed hardware, and task-specific error measures.
The most important outcome will not be another average benchmark score. It will be evidence that a small encoder can inspect complete working context, meet accuracy requirements, and run predictably where the data lives.


