Liquid AI has launched two open-weight bidirectional encoders, LFM2.5-Encoder-230M and LFM2.5-Encoder-350M. Each are masked language fashions constructed on the LFM2 hybrid spine. Each carry an 8,192-token context.
Encoders sit beneath classifiers, intent routers, security filters, and PII detectors. These jobs run constantly, normally with out a GPU, and more and more on longer inputs. BERT established the category. ModernBERT pushed its accuracy, velocity, and context. Liquid AI’s argument is that the LFM2 structure continues that line, as a result of its value grows extra slowly as inputs get longer.
How a decoder turned an encoder
The encoders are usually not skilled from scratch. They’re initialized from the LFM2.5-230M and LFM2.5-350M decoder backbones, then transformed with three modifications:
- First, the causal consideration masks is changed with a bidirectional one, so each token attends to either side.
- Second, the LFM2 brief convolutions are made non-causal utilizing symmetric middle padding, so every token’s convolution mixes in neighbours on either side.
- Third, the mannequin is skilled with a masked language modeling goal at a 30% masks charge. That’s denser than BERT’s 15%, following proof Liquid AI cites {that a} greater masks charge helps at this scale.
Coaching runs in two levels:
- Stage one establishes common language competence with a short-context MLM goal on a big net corpus at 1,024 tokens.
- Stage two extends context to eight,192 tokens on the complete knowledge combine, strengthening factual, authorized, and multilingual competence.
Architecturally, the spine interleaves gated short-convolution blocks with grouped-query consideration, the identical design described within the LFM2 technical report. Each checkpoints use a hidden measurement of 1024 and a 65,536-token vocabulary, and help 15 languages. The license is the LFM Open License v1.0.
The embed beneath breaks down the conversion, the complete rating desk, the per-task scores, and the CPU latency figures.
Each mannequin is totally fine-tuned per activity. Duties span GLUE, SuperGLUE and multilingual classification.
‘;
h+=’
| # | Mannequin | Params | Imply | ± std | |
|---|---|---|---|---|---|
| ‘+(i+1)+’ | ‘+r[0]+’ | ‘+r[1]+’ | ‘+r[2].toFixed(2)+’ | ±’+r[3].toFixed(2)+’ |
‘;
h+=’
LFM2.5-Encoder-350M ranks 4th; the three fashions above it are all bigger, together with one practically 10× its measurement. LFM2.5-Encoder-230M ranks sixth, above ModernBERT-base and each EuroBERT. Each rating above Liquid AI’s personal retriever fashions.
‘;
return h;
}
perform vTask(){
var keys=Object.keys(PER);
var h=”
> Per-task scores · chosen fashions
“;
h+=’‘;
h+=’
* = dev break up (GLUE / SuperGLUE take a look at labels are hidden). The 5 multilingual columns are labelled take a look at. SeaHorse and STS-B are Spearman×100; all different duties are accuracy. Six of 14 fashions proven; the complete matrix is on the Hugging Face mannequin playing cards.
‘;
return h;
}
perform drawTask(ok){
var v=PER[k],h=”
| Job | Rating | ‘+TASKS[i]+’ | ‘+v[i].toFixed(2)+’ |
|---|
‘;
doc.getElementById(“lfm-tt”).innerHTML=h;
}
perform vSpeed(){
var h=”
> One ahead move at 8,192 tokens · CPU
“;
h+=’
Liquid AI stories two measured factors at full 8K context on CPU.
‘;
h+=’
h+=’
LFM2.5-Encoder-230M
‘;
h+=’
ModernBERT-base (149M)
‘;
h+=’
‘;
h+=’
‘
Pace-up quoted in weblog~3.7×
‘+
‘
Pace-up quoted on mannequin playing cards3.3×
‘+
‘
Context measured8,192 tokens
‘+
‘
Sensible framingfull contract in underneath 30 s
‘+
‘
‘;
h+=’
GPU: ModernBERT-base leads beneath roughly 1K tokens on the Apple GPU. The LFM2.5 encoders take the lead from about 2K tokens, with a smaller margin than on CPU.
‘;
h+=’
The weblog and the mannequin playing cards give totally different multipliers for a similar comparability (3.7× vs 3.3×). Neither web page names the precise CPU used for the measurement.
‘;
return h;
}
perform vSpec(){
return ‘
> Mannequin particulars
‘+
‘
| Property | Encoder-230M | Encoder-350M |
|---|---|---|
| Kind | Bidirectional encoder (MLM) | Bidirectional encoder (MLM) |
| Spine | LFM2 | LFM2 |
| Complete parameters | ~229.7M | ~354.5M |
| Hidden measurement | 1024 | 1024 |
| Vocabulary measurement | 65,536 | 65,536 |
| Context size | 8,192 tokens | 8,192 tokens |
| Languages | 15 | 15 |
| License | LFM Open License v1.0 | LFM Open License v1.0 |
‘+
‘
Lessons: Lfm2BidirectionalModel for the physique, Lfm2BidirectionalForMaskedLM for masked-LM loading. Each are wired by way of auto_map and require trust_remote_code=True. Languages: English, German, Spanish, French, Italian, Dutch, Polish, Portuguese, Arabic, Hindi, Japanese, Russian, Turkish, Vietnamese, Chinese language.
‘;
}
perform vProto(){
return ‘
> How the comparability was run
‘+
‘
The harness is open-sourced underneath Apache-2.0. Its acknowledged aim is that solely mannequin weights differ between two cells of the desk.
‘+
‘
‘
Fashions14
‘+
‘
Duties17
‘+
‘
Job break up5 multilingual / 8 GLUE / 4 SuperGLUE
‘+
‘
Precision (all fashions)fp32 grasp + bf16 autocast
‘+
‘
OptimizerAdamW, β₂=0.95, wd=0.1
‘+
‘
Warmup / batch10% linear / 32
‘+
‘
LR search10 charges, 1e-5 to 1e-4
‘+
‘
Choice seeds3 (42–44)
‘+
‘
Reporting seeds5 recent (45–49)
‘+
‘
transformers pin4.56.2
‘+
‘
Choice jobs~7,100
‘+
‘
Reporting jobs~1,200
‘+
‘
‘+
‘
Said limits from the repository: GLUE and SuperGLUE report dev splits as a result of their take a look at labels are hidden, and WSC is retained for completeness however is uninformative, since no mannequin beats the bulk class underneath this recipe.
‘;
}
perform bind(){
var s=doc.getElementById(“lfm-sel”);
if(s){s.onchange=perform(){drawTask(s.worth);resize();};drawTask(s.worth);}
}
perform resize(){
strive{
var h=doc.getElementById(“lfm-term”).offsetHeight+40;
guardian.postMessage({lfmEncHeight:h},”*”);
}catch(e){}
}
out.innerHTML=vArch();
bind();
resize();
window.addEventListener(“load”,resize);
setTimeout(resize,120);
setTimeout(resize,600);
window.addEventListener(“resize”,resize);
})();
” type=”width:100%;border:0;overflow:hidden;show:block;” top=”620″ scrolling=”no” loading=”lazy” title=”LFM2.5-Encoders interactive”>
The benchmark outcomes
Liquid AI evaluated 14 fashions on 17 duties pulled from GLUE, SuperGLUE, and multilingual classification. Each mannequin is totally fine-tuned per activity, and the reported rating is that fine-tuned mannequin’s consequence.
LFM2.5-Encoder-350M posts a 17-task imply of 81.02 (±1.00), rating fourth. The three fashions forward of it are all bigger. They’re XLM-R XL at 3.5B (83.06), ModernBERT-large at 395M (81.68), and XLM-R giant at 560M (81.34). The highest mannequin is sort of 10 instances its measurement.
LFM2.5-Encoder-230M posts 79.29 (±1.02), rating sixth. It beats ModernBERT-base at 78.19 and each EuroBERT mannequin within the desk, together with EuroBERT-610M (75.87) and EuroBERT-2.1B (72.19). Each new encoders additionally rating above Liquid AI’s personal retrieval siblings, LFM2.5-ColBERT-350M (76.18) and LFM2.5-Embedding-350M (75.68). That hole is the acknowledged cause Liquid AI constructed a general-purpose encoder as a substitute of reusing the retrievers.
The methodology is the extra fascinating half, and it’s open-sourced underneath Apache-2.0. Each mannequin is loaded with fp32 grasp weights and bf16 autocast, so the desk compares fashions quite than quantity codecs. Each mannequin makes use of the identical AdamW recipe, taken from the EuroBERT card. Studying charge is chosen per mannequin and activity throughout 10 charges and three seeds. Scores are then reported because the imply over 5 recent seeds that by no means touched choice. The transformers model is pinned to 4.56.2 so dependency drift isn’t an uncontrolled variable.
Use Circumstances and Deployment Environments
The discharge names three settings. Edge and embedded units come first. A automobile’s onboard compute or an industrial controller has no spare GPU, and can’t afford a cloud spherical journey. Regulated and on-premise methods in finance, healthcare, and authorized, the place paperwork are lengthy, delicate, and can’t depart in-house infrastructure. And high-volume cost-sensitive pipelines, the place a small encoder acts as an inexpensive first move in entrance of a bigger mannequin.
Liquid AI additionally places a helpful quantity on the context window: 8,192 tokens is roughly 13 to fifteen pages. One ahead move covers a full contract or an entire affected person report.
To indicate what a fine-tuned encoder seems like, the analysis group shipped 5 demos. Every runs in a CPU-only Hugging Face House. They cowl zero-shot immediate routing, zero-shot coverage linting, and spell checking. A PII detector handles 40 data varieties throughout 16 languages. A bonus masked-diffusion demo runs the encoder as a chatbot that generates by iteratively unmasking.
Getting them operating
Each encoders load by way of transformers. The physique is uncovered as Lfm2BidirectionalModel and masked-LM loading makes use of Lfm2BidirectionalForMaskedLM. Each are wired by way of auto_map, so trust_remote_code=True is required on each load name.
A base encoder produces general-purpose representations, not activity outputs, so fine-tuning is obligatory. Liquid AI’s fine-tuning tutorial walks by way of lengthy authorized paperwork at an 8k context configuration. The mannequin choice steerage is easy: 350M when accuracy issues most, 230M for tighter {hardware} or greater throughput.
Key Takeaways
- Liquid AI launched LFM2.5-Encoder-230M and LFM2.5-Encoder-350M, open-weight bidirectional encoders with 8,192-token context.
- Each convert LFM2.5 decoders into encoders through bidirectional masking, non-causal brief convolutions, and 30% MLM.
- LFM2.5-Encoder-350M ranks 4th of 14 fashions at 81.02; the three above it are all bigger.
- At 8K tokens on CPU, the 230M runs one ahead move in ~28s versus over 90s for ModernBERT-base.
Try the Liquid AI weblog publish, the Hugging Face write-up, and the mannequin playing cards for LFM2.5-Encoder-230M and LFM2.5-Encoder-350M.
Asif Razzaq is the CEO of Marktechpost Media Inc.. As a visionary entrepreneur and engineer, Asif is dedicated to harnessing the potential of Synthetic Intelligence for social good. His most up-to-date endeavor is the launch of an Synthetic Intelligence Media Platform, Marktechpost, which stands out for its in-depth protection of machine studying and deep studying information that’s each technically sound and simply comprehensible by a large viewers. The platform boasts of over 2 million month-to-month views, illustrating its recognition amongst audiences.









