alt.freeweights.lfm / LFM2.5-Encoder-350M
From: LiquidAI <huggingface.co/LiquidAI>Newsgroups: alt.freeweights.lfmSubject:

LFM2.5-Encoder-350M

Date: 2026-11-15Commit: b886781Signed: 2DC28CC7B26A283B ✓

Fill mask model with 354M parameters. Safetensors weights, 1.42 GB in all. Published by LiquidAI under LFM-1.0 (custom).

354M params1.42GBLFM2.5-Encoder-350Msafetensorscustom terms
FactsParams354MSize1.42 GBFormatssafetensorsTaskfill maskLicenseLFM-1.0 (custom)From sourcecustom termsread terms
# custom terms: read the license before you download
$ fw get LiquidAI/LFM2.5-Encoder-350M
# manifest sha256 0d9c14f3f4f4… · 1.42 GB · 9 files
$ fw verify ./LFM2.5-Encoder-350M LiquidAI/LFM2.5-Encoder-350M
From sourceHosted (signed)LiquidAI/LFM2.5-Encoder-350MLast check: 2026-11-15 02:47 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Fine-tune of LFM2.5-350M-Base.

Works with

Runs with

Ranked by fit to this model (safetensors), then by GitHub stars.

Overview

Size
1.42 GB
Weights
1.42 GB (safetensors)
Parameters
354M
Formats
safetensors
Task
fill mask
License
LFM-1.0 (custom) (custom)
Files
9, each with a sha256
Publisher
LiquidAI
Added
2026-11-15
Section
alt.freeweights.lfm
Lineage

Original release from the publisher.

Base model: LiquidAI/LFM2.5-350M-Base

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 02:47 UTCpassed

Model card

From the publisher at commit b886781. Shown as plain text with links; images open at the publisher.

Image: Liquid AI

Try LFM • Docs • LEAP • Discord

LFM2.5-Encoder-350M#

LFM2.5-Encoder is a family of multilingual bidirectional encoders built on the LFM2 architecture, available in two sizes:

  • LFM2.5-Encoder-230M — a lightweight encoder for tight latency and memory budgets, punching above its size class.
  • LFM2.5-Encoder-350M (this model) — a larger sibling for maximum downstream quality.

Both are masked language models with full bidirectional attention, designed to be fine-tuned into task-specific models (classification, token classification, retrieval, reranking, and semantic similarity) across 15 languages, and to run efficiently on-device.

Find more details about our encoders in our blog post.

Key highlights:

  • Top quality for its size. Ahead of every model its size or smaller, and ~5 points above our own retrieval siblings.
  • General-purpose. 8k context, strong across NLI, paraphrase, sentiment, and multilingual tasks.
  • Fast and on-device. Matches or beats ModernBERT throughput, with a long-context edge on CPU.

Note. 💻 Demos: We built the demos below from fine-tuned LFM2.5-Encoders. Each one runs in a CPU-only Hugging Face space:

  • Zero-shot prompt routing — define your own routing lanes as free text. The model scores the whole prompt against every lane in one pass.
  • Zero-shot policy linting — check text against your company's rules, written as free text. It scores every token against every rule in one pass.
  • Spell checking — correct misspellings token by token.
  • PII detection — spot and remove 40 kinds of personal information across 16 languages.
  • Masked-diffusion text generation — bonus: run the encoder as a chatbot that generates text by iteratively unmasking instead of left to right.

📄 Model details#

PropertyLFM2.5-Encoder-230MLFM2.5-Encoder-350M
TypeBidirectional encoder (masked language model)Bidirectional encoder (masked language model)
BackboneLFM2LFM2
Total parameters~229.7M~354.5M
Hidden size10241024
Vocabulary size65,53665,536
Context length8,192 tokens8,192 tokens
LicenseLFM Open License v1.0LFM Open License v1.0

Supported languages: English, German, Spanish, French, Italian, Dutch, Polish, Portuguese, Arabic, Hindi, Japanese, Russian, Turkish, Vietnamese, Chinese (15).

Architecture. LFM2.5-Encoder is built on the LFM2 hybrid backbone, which interleaves gated short-convolution blocks with grouped-query attention. For encoder use, the causal mask is replaced with full bidirectional (non-causal) attention and the model is trained with a masked language modeling head. The encoder body is exposed as Lfm2BidirectionalModel; masked-LM loading uses Lfm2BidirectionalForMaskedLM. Both are wired through auto_map and require trust_remote_code=True.

Lfm2BidirectionalForMaskedLM(
  (lfm2): Lfm2BidirectionalModel
  (lm_head): Linear(in_features=1024, out_features=65536, bias=False)
)

Training. LFM2.5-Encoder-350M is adapted from the LFM2 base and trained with a masked language modeling objective on a large multilingual corpus. Pre-training uses a two-stage schedule that extends the context window to up to 8,192 tokens.

We recommend fine-tuning LFM2.5-Encoder-350M for a range of downstream tasks, such as:

  • Text classification: sentiment, topic, intent/routing, moderation, and business-text linting.
  • Token classification: named-entity recognition, span extraction, and sequence labeling.
  • Retrieval and reranking: a backbone for dense embedding or late-interaction (ColBERT-style) retrievers.
  • Semantic similarity: STS, paraphrase, and duplicate detection.
  • Natural language inference and extractive QA: sentence-pair reasoning and answer-span extraction.

🏃 How to run#

Install the latest version of transformers:

pip install -U transformers

Run masked-token prediction:

from transformers import AutoModelForMaskedLM, AutoTokenizer
import torch

tok = AutoTokenizer.from_pretrained("LiquidAI/LFM2.5-Encoder-350M", trust_remote_code=True)
mlm = AutoModelForMaskedLM.from_pretrained("LiquidAI/LFM2.5-Encoder-350M", trust_remote_code=True)

text = f"The capital of France is {tok.mask_token}."
enc = tok(text, return_tensors="pt")
with torch.no_grad():
    logits = mlm(**enc).logits
pos = (enc["input_ids"][0] == tok.mask_token_id).nonzero()[0].item()
print([tok.decode([t]).strip() for t in logits[0, pos].topk(5).indices.tolist()])
# -> ['Paris', 'Strasbourg', 'Paris', 'Lyon', 'Versailles']

For downstream tasks, load the encoder body and attach your own head (classification, token classification, regression, retrieval):

from transformers import AutoModel
body = AutoModel.from_pretrained("LiquidAI/LFM2.5-Encoder-350M", trust_remote_code=True)

If your GPU supports it, we recommend using LFM2.5-Encoder-350M with Flash Attention 2 to reach the highest efficiency. To do so, install Flash Attention as follows, then use the model as normal:

pip install flash-attn

📊 Performance#

For each benchmark task, we run a full supervised fine-tune and report that fine-tuned model's score. The results below span 14 models across 17 tasks from GLUE, SuperGLUE, and multilingual classification tasks. The full evaluation harness is open-sourced in the eurobert-repro repository.

Image: benchmark_ranking

17-task results (avg@5 fresh seeds ± std)#
RankModelParams17-task mean± std
1XLM-R XL (3.5B)3.5B83.06±1.16
2ModernBERT-large (395M)395M81.68±2.49
3XLM-R large (560M)560M81.34±1.66
4LFM2.5-Encoder-350M (ours)350M81.02±1.00
5mDeBERTa-v3 (280M)280M80.37±1.06
6LFM2.5-Encoder-230M (ours)230M79.29±1.02
7ModernBERT-base (149M)149M78.19±1.39
8XLM-R base (280M)280M77.46±1.63
9EuroBERT-210M210M76.87±2.00
10mGTE-MLM (305M)305M76.53±1.85
11LFM2.5-ColBERT-350M350M76.18±1.25
12EuroBERT-610M610M75.87±2.03
13LFM2.5-Embedding-350M350M75.68±0.83
14EuroBERT-2.1B2.1B72.19±5.59

Click to expand per-task results — all 17 tasks (avg@5 fresh seeds ± std)

Per-task results — all 17 tasks (avg@5 fresh seeds ± std)#
ModelXNLIPAWS-XAmazonMASSIVESeaHorseCoLA*SST-2*MRPC*STS-B*QQP*MNLI*QNLI*RTE*BoolQ*CB*WiC*WSC*ALL
XLM-R XL (3.5B)87.12±0.4593.30±0.4162.29±0.0588.21±0.3259.51±3.5284.58±1.1895.69±0.3087.65±1.6990.20±0.9391.72±0.0790.09±0.1194.47±0.2882.38±3.5183.70±0.2489.88±3.7266.55±1.3764.62±1.5883.06
ModernBERT-large (395M)81.76±0.3892.46±0.1860.42±0.1585.65±0.9440.20±17.1883.37±0.2096.10±0.5388.14±1.7992.16±0.2491.81±0.1390.65±0.1894.36±0.1081.59±4.9281.68±2.3488.21±3.2470.16±2.5769.81±7.1881.68
XLM-R large (560M)84.69±0.5993.23±0.7861.58±0.1388.50±0.1756.12±2.3183.34±1.7593.83±1.0488.77±2.1591.35±0.2390.48±0.2388.29±0.0793.08±0.2380.79±3.1480.54±0.7978.21±8.6966.24±5.4163.65±0.4381.34
LFM2.5-Encoder-350M (ours)79.82±0.2991.53±0.7360.57±0.0985.70±0.1354.96±0.4184.43±0.8195.11±0.2687.21±1.8691.59±0.0592.08±0.1089.03±0.1793.97±0.2375.23±3.8481.52±0.6983.21±2.0469.66±2.2361.73±3.1581.02
mDeBERTa-v3 (280M)83.01±0.4792.59±0.3960.62±0.3187.64±0.5154.97±2.0483.91±1.0392.41±0.9685.39±2.5989.87±0.2290.23±0.1586.30±0.1891.99±0.3569.75±2.0378.29±1.3988.21±2.4067.71±3.0563.46±0.0080.37
LFM2.5-Encoder-230M (ours)77.63±0.3190.86±0.2459.97±0.2185.52±0.6954.61±0.6281.42±1.5694.08±0.3780.20±2.6690.99±0.1291.71±0.0787.98±0.2292.96±0.3767.29±1.9776.54±1.0183.21±4.4870.31±1.3462.69±1.0579.29
ModernBERT-base (149M)76.64±0.3192.17±0.1558.98±0.1185.32±0.2145.19±1.7283.07±1.9394.79±0.5284.46±2.7090.75±0.1491.23±0.1188.68±0.1793.04±0.3658.70±1.9474.78±4.1081.07±6.7566.90±2.3963.46±0.0078.19
XLM-R base (280M)78.20±0.8091.36±0.4160.01±0.1287.47±0.4951.08±3.7581.17±1.0791.97±0.1886.47±0.7688.27±0.3689.21±0.0483.07±0.2190.17±0.3262.60±7.0371.43±1.6479.64±7.5361.25±3.0063.46±0.0077.46
EuroBERT-210M80.83±0.3591.94±0.3159.94±0.1686.36±0.6745.16±16.6072.75±1.3090.64±0.9280.74±2.9989.29±0.2390.75±0.0985.63±0.2891.49±0.2754.95±2.5671.68±2.3586.79±2.4064.64±2.0163.27±0.4376.87
mGTE-MLM (305M)80.32±0.2091.73±0.2660.26±0.1087.79±0.2051.58±1.3175.44±4.6691.19±1.0086.32±1.4887.77±0.6489.82±0.0984.14±0.1590.94±0.4058.34±3.0969.32±3.7273.21±6.8059.34±7.4163.46±0.0076.53
LFM2.5-ColBERT-350M78.77±0.4789.74±0.4459.92±0.1386.65±0.1747.95±1.1371.06±1.0690.94±0.7873.43±7.2289.38±0.2891.11±0.1484.70±0.2390.66±0.1859.13±2.3074.25±1.6181.79±2.9362.04±2.1263.46±0.0076.18
EuroBERT-610M84.61±0.3491.84±0.9460.64±0.0886.03±0.9912.91±8.0570.60±2.1292.52±0.6685.20±1.3489.82±0.2291.13±0.0987.95±0.1992.57±0.3659.28±7.9376.86±1.5585.71±4.3758.71±5.3063.46±0.0075.87
LFM2.5-Embedding-350M78.59±0.1189.13±0.6360.47±0.1387.03±0.2150.19±0.9072.54±0.6891.70±0.6977.45±1.3189.38±0.0991.14±0.1384.70±0.1290.62±0.5055.38±1.7470.17±1.9971.43±3.5763.10±1.2863.46±0.0075.68
EuroBERT-2.1B70.52±14.2292.34±0.1960.45±0.7085.40±1.366.84±6.8168.99±0.6792.50±1.0382.94±3.1066.44±32.3691.03±0.2981.56±16.6293.56±0.2553.29±0.7977.23±6.7782.86±5.1457.90±4.7563.46±0.0072.19

* = dev split (GLUE/SuperGLUE test labels hidden). The 5 multilingual columns are labeled test. SeaHorse & STS-B are Spearman×100. All other tasks are accuracy.

Inference speed#

The LFM2 backbone was built for fast inference, and the encoders inherit it. While ModernBERT-base is faster at short sequences in Apple GPU inputs, LFM2.5-Encoders overtake it as inputs grow. At long input sequences of 8k on CPU, the encoders run 3.3× faster than ModernBERT-base.

Image: inference_perf_cpu

Image: inference_perf_gpu

🔧 Fine-tuning#

LFM2.5-Encoder-350M follows standard BERT-style fine-tuning. Attach a task head to the encoder body and train end-to-end. Suggested starting points (tune per task):

HyperparameterSuggested range
Learning rate1e-5 – 5e-5
Warmup ratio0.1
Weight decay0.1
Epochs3 – 20 (early stopping, patience 3)
Precisionbf16 autocast (fp32 master weights)

📬 Contact#

Citation#

@article{liquidAI2026Encoders,
  author = {Liquid AI},
  title = {LFM2.5-Encoders: Fast at Long Context, Even on CPU},
  journal = {Liquid AI Blog},
  year = {2026},
  note = {www.liquid.ai/blog/lfm2-5-encoders},
}

Files

9 files · 1.42 GBWeights 1.42 GB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 9 files with their sha256
FileSizesha256
.gitattributes1.52 KB11ad7efa24975ee4b0c3c3a38ed18737f0658a5f75a0a96787b576a78a023361
LICENSE10.6 KB4d28ca14dedc0b3d0fcc2b3339f0e79931faa33874f3d24f522183a8fc70068c
README.md13.8 KB1e8659cbe458ef9250ad6b0e4f3792ae78d02ed69df2b92c60fee1dc77fab846
config.json1.50 KB559f88ddcebfb0a7b46ba99a074b17f3a951f278b3010a0f22fdf5d9cc358d11
model.safetensors1.42 GBcd70e404c3c6c1756b2cf5dc75de2a87788b460e3a6156c1a4ab134b824c2706
modeling_lfm2_bidirectional.py7.09 KBf171f518be2a07da48b17fdea5655cad0a2452ab548e90e8ae903143686647e2
special_tokens_map.json120 B03de0f13c1ba6ffdc6051cded0d0276f9eedb712ee0f5d4b16a102ea280dab5b
tokenizer.json4.73 MB1efc3a6609abf6b63b1f47188d139f3b59973a6a434dffe970a7261a51ed2711
tokenizer_config.json92.0 KB016985c5cbbde5da8a08e904472e8b280bcf5cb84c43c6af0721ca0c21adf121
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
b886781f7c pinned now2026-11-15 02:47 UTC9 files · 1.42 GB

Use it

# custom terms: read the license before you download
$ fw get LiquidAI/LFM2.5-Encoder-350M
# manifest sha256 0d9c14f3f4f4… · 1.42 GB · 9 files
$ fw verify ./LFM2.5-Encoder-350M LiquidAI/LFM2.5-Encoder-350M
Terms that come with these files. LFM 1.0: commercial use only for organisations under US$10M annual revenue. Keep a copy of the license with the files.
Custom license (custom). Read the license text first. Open this panel to show the commands once you accept its terms.
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/LiquidAI/LFM2.5-Encoder-350M.json --dir ./LFM2.5-Encoder-350M $ python3 fw.py verify ./LFM2.5-Encoder-350M ./LiquidAI__LFM2.5-Encoder-350M.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download LiquidAI/LFM2.5-Encoder-350M --revision b886781f7c6f10ca9b7096e21b83e30a073c2f39 --local-dir ./LFM2.5-Encoder-350M

License

Name
LFM Open License v1.0
Id
LicenseRef-LFM-1.0
Class
Custom terms
Redistribution
click-through
Listing
Hosted (signed)
Terms
LFM 1.0: commercial use only for organisations under US$10M annual revenue. Keep a copy of the license with the files.
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
LICENSE
Text sha256
4d28ca14dedc0b3d0fcc2b3339f0e79931faa33874f3d24f522183a8fc70068c
Terms gate
Yes. The commands stay folded until you open them after reading the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: LiquidAI <huggingface.co/LiquidAI>Newsgroups: alt.freeweights.lfmSubject: LFM2.5-Encoder-350MDate: 2026-11-15Commit: b886781Signed: 2DC28CC7B26A283B ✓
Upstream
LiquidAI/LFM2.5-Encoder-350M
Pinned commit
b886781f7c6f10ca9b7096e21b83e30a073c2f39
Manifest
LFM2.5-Encoder-350M.json · .minisig
Manifest sha256
0d9c14f3f4f455bd3350d34908b2743373e7f707ae901b65da67043a2528948d
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 02:47 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/LiquidAI/LFM2.5-Encoder-350M.json $ curl -O https://freeweights.allternit.com/manifests/LiquidAI/LFM2.5-Encoder-350M.json.minisig $ minisign -Vm LFM2.5-Encoder-350M.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

Parent

LiquidAI/LFM2.5-350M-Base · this model is a finetune of it

1 model in the catalog name this one as their parent.

Fine-tunes
1
Fine-tunes 1
Get it
Read license, then download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download LiquidAI/LFM2.5-Encoder-350M
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. LFM2.5-Encoder-350M.json. Provenance. Takedown history: none.
From: LiquidAI <huggingface.co/LiquidAI>Subject: LFM2-1.2B
From: LiquidAI <huggingface.co/LiquidAI>Subject: LFM2-1.2B-Extract
From: LiquidAI <huggingface.co/LiquidAI>Subject: LFM2-1.2B-RAG
From: LiquidAI <huggingface.co/LiquidAI>Subject: LFM2-1.2B-Tool
From: LiquidAI <huggingface.co/LiquidAI>Subject: LFM2-2.6B
From: LiquidAI <huggingface.co/LiquidAI>Subject: LFM2-2.6B-Exp