LFM2.5-Encoders for Fast Long-Context Inference on CPU
| Source: Hugging Face Blog
Tags: Liquid AI, LFM2.5, encoder, CPU inference, long-context, NLP, Hugging Face
Liquid AI releases two open-source encoder models — LFM2.5-Encoder-230M and LFM2.5-Encoder-350M — running 8,192-token context at ~3.7× faster than ModernBERT-base on CPU, built for production NLP tasks like intent classification, PII detection, and safety filtering without requiring GPU.
Details
Liquid AI released LFM2.5-Encoder-230M and LFM2.5-Encoder-350M on Hugging Face today, two general-purpose encoders designed to run cheaply on CPU at document-scale contexts. Both models are initialized from their respective LFM2 decoder backbones, then converted to bidirectional encoders using masked-language modeling, bidirectional attention, and symmetric short convolutions — a structural choice that keeps inference cost growing slowly with input length. Training happened in two stages: first a short-context masked-language objective on a broad web corpus at 1,024 tokens, then long-context adaptation to 8,192 tokens using a data mix covering factual, legal, and multilingual content. The 350M variant ranks 4th out of 14 comparable models across 17 tasks drawn from GLUE, SuperGLUE, and multilingual classification benchmarks, while delivering ~3.7× the throughput of ModernBERT-base at long context on CPU. The practical target is the class of always-on NLP jobs: intent routers, policy linters, PII detectors, and text classifiers. These typically run on CPU and process ever-longer inputs — exactly where the LFM2 architecture's sub-quadratic attention approach provides cost advantages over standard transformers. Both model weights and the full benchmark evaluation framework are open-sourced on Hugging Face. This is primarily useful for teams running production NLP pipelines who cannot justify GPU overhead for embedding-scale tasks.