Liquid AI, an MIT spinoff specializing in efficient AI architecture, has announced the release of two high-performance open-weight bidirectional encoders: LFM2.5-Encoder-230M and LFM2.5-Encoder-350M. These models represent a significant shift in the landscape of masked language modeling, leveraging the proprietary LFM2 hybrid backbone to deliver high accuracy and long-context processing capabilities without the prohibitive computational costs typically associated with large-scale transformers. Both models feature an 8,192-token context window, allowing them to process roughly 15 pages of text in a single forward pass, a feat that positions them as formidable tools for enterprise-grade document analysis and edge-based artificial intelligence.
The release marks a pivotal moment for the encoder class of models, which serve as the foundational infrastructure for critical AI tasks such as classification, intent routing, safety filtering, and personally identifiable information (PII) detection. Unlike the more widely publicized generative decoders like GPT-4 or Llama, encoders are designed to "understand" text bidirectionally, looking at the context both before and after a specific word to create rich, multi-dimensional representations. Liquid AI’s new offerings aim to bridge the gap between the efficiency required for local deployment and the high-fidelity performance required for complex linguistic analysis.
The Evolution of the Encoder Architecture
To understand the significance of the LFM2.5 encoders, one must look at the historical trajectory of masked language models. The class was established by Google’s BERT (Bidirectional Encoder Representations from Transformers) in 2018, which revolutionized natural language processing by introducing the concept of bidirectional training. Over the years, models like RoBERTa and DeBERTa refined these techniques, but they often struggled with scaling context length and maintaining efficiency on non-GPU hardware.
Recently, ModernBERT pushed the boundaries of the architecture by improving accuracy and speed while expanding the context window. Liquid AI’s entry into this space with the LFM2 architecture represents the next step in this evolution. The core argument presented by Liquid AI is that the LFM2 backbone allows for linear or near-linear scaling of costs as input lengths increase. This is a departure from traditional transformers, where the computational complexity of the attention mechanism often grows quadratically with the sequence length, making long-document processing expensive and slow.
Technical Architecture: From Decoder to Encoder
The LFM2.5 encoders are unique in their derivation. Rather than being trained from scratch, which is computationally expensive and data-intensive, these models are initialized from Liquid AI’s existing LFM2.5-230M and LFM2.5-350M decoder backbones. The transition from a generative decoder to a bidirectional encoder involved three fundamental structural changes. First, the team implemented bidirectional attention masks, allowing every token to "see" every other token in the sequence. Second, they removed the causal masking used in generative tasks. Finally, they integrated specialized pooling layers to consolidate token-level representations into a single, actionable vector for classification tasks.
Architecturally, the LFM2 backbone is a hybrid design that interleaves gated short-convolution blocks with grouped-query attention (GQA). This design, detailed in the LFM2 technical report, is optimized for both throughput and memory efficiency. Both the 230M and 350M checkpoints utilize a hidden size of 1024 and a comprehensive vocabulary of 65,536 tokens. This large vocabulary, combined with support for 15 languages, ensures that the models are robust across diverse linguistic datasets and technical terminologies.
The training process for these encoders followed a rigorous two-stage methodology. The first stage involved Masked Language Model (MLM) pre-training, where the model learns to predict hidden tokens within a sequence to build a deep understanding of syntax and semantics. The second stage focused on classification fine-tuning, honing the models’ ability to categorize data and detect patterns within specific domains.
Performance Benchmarks and Comparative Analysis
Liquid AI conducted an exhaustive evaluation of the LFM2.5 encoders, testing them against 14 established models across 17 distinct tasks derived from the GLUE (General Language Understanding Evaluation) and SuperGLUE benchmarks, as well as multilingual classification suites. To ensure a fair comparison, every model in the test was fully fine-tuned for each specific task.
The results indicate that Liquid AI has achieved a high level of efficiency-to-performance ratio. The LFM2.5-Encoder-350M achieved a mean score of 81.02 across the 17 tasks, ranking fourth overall. Notably, the three models that outperformed it were significantly larger: the XLM-R XL (3.5 billion parameters), ModernBERT-large (395 million parameters), and XLM-R large (560 million parameters). The fact that a 350-million-parameter model can compete with a model ten times its size (the XLM-R XL) underscores the effectiveness of the LFM2 backbone.
The smaller LFM2.5-Encoder-230M also demonstrated strong performance, posting a mean score of 79.29. This allowed it to surpass ModernBERT-base and the entire EuroBERT suite, including versions with up to 2.1 billion parameters. Furthermore, both new encoders outperformed Liquid AI’s own specialized retrieval models, the LFM2.5-ColBERT and LFM2.5-Embedding models. This internal performance gap was the primary driver for Liquid AI to develop a dedicated general-purpose encoder rather than relying on existing retrieval-tuned weights.

Open-Source Methodology and Reproducibility
In a move praised by the research community, Liquid AI has open-sourced its evaluation methodology under the Apache-2.0 license. This transparency allows third-party developers to verify the benchmarks and apply the same testing rig to their own custom models. The evaluation framework used FP32 master weights with BF16 autocast, ensuring that the comparisons focused on the architectural merits of the models rather than discrepancies in numerical precision or hardware optimization.
The team utilized a consistent AdamW optimizer recipe for all models, with learning rates meticulously selected across 10 different rates and three seeds per task. The final reported scores were the mean of five fresh seeds that were not used during the initial hyperparameter selection phase. By pinning the transformers library version to 4.56.2, Liquid AI eliminated dependency drift as a potential variable, providing a stable and reproducible baseline for future research.
Strategic Use Cases: Edge, Privacy, and High-Volume Pipelines
Liquid AI has identified three primary deployment environments where the LFM2.5 encoders provide a distinct advantage over existing solutions.
1. Edge and Embedded Systems:
In environments such as automotive onboard computers or industrial controllers, computational resources are strictly limited. These systems often lack dedicated high-end GPUs and cannot tolerate the latency or security risks associated with cloud-based processing. The LFM2.5 encoders are designed to run efficiently on CPUs, making them ideal for real-time intent routing or safety monitoring in offline settings.
2. Regulated and On-Premise Infrastructure:
Industries such as healthcare, finance, and legal services handle highly sensitive data that is often subject to strict residency requirements. The ability to process 8,192 tokens locally allows these organizations to analyze entire patient records, legal contracts, or financial reports without the data ever leaving their secure, in-house infrastructure. The 13-to-15-page context window is particularly relevant here, as it covers the length of most standard professional documents.
3. High-Volume, Cost-Sensitive Pipelines:
For large-scale data processing operations, the LFM2.5 encoders can serve as a "first pass" filter. By acting as a cheap, high-speed classifier or PII detector, these models can route only the most complex queries to larger, more expensive generative models, significantly reducing the overall operational cost of AI pipelines.
Deployment and Developer Integration
To facilitate immediate adoption, Liquid AI has integrated the encoders with the popular Hugging Face transformers library. The models are exposed as Lfm2BidirectionalModel for general use and Lfm2BidirectionalForMaskedLM for masked language tasks. Because the models utilize a custom hybrid architecture, developers are required to use the trust_remote_code=True flag during the loading process.
Recognizing that a base encoder requires task-specific training to be effective, Liquid AI has released a comprehensive fine-tuning tutorial focused on legal document analysis. Additionally, the research team launched five live demos running on CPU-only Hugging Face Spaces. These demos showcase practical applications including zero-shot prompt routing, policy linting, and spell checking. A particularly sophisticated PII detector demo illustrates the models’ multilingual capabilities, handling 40 different types of sensitive information across 16 languages.
Implications for the AI Industry
The release of the LFM2.5 encoders signals a growing trend toward "sovereign AI"—the ability for organizations to run high-performance models on their own hardware without relying on the "Big Tech" cloud ecosystem. By focusing on the 230M to 350M parameter range, Liquid AI is targeting the "sweet spot" of efficiency where models are small enough for edge deployment but sophisticated enough to handle complex reasoning.
As the industry moves toward more specialized AI agents, the role of the encoder as a "brain" for routing and safety will only grow. Liquid AI’s decision to release these models under the LFM Open License v1.0 further encourages a decentralized approach to AI development, providing researchers and startups with the tools needed to build secure, private, and cost-effective applications. The success of the LFM2 architecture in these benchmarks suggests that the future of AI may not just be about "bigger" models, but about smarter, more efficient architectures that can operate wherever data is generated.
