LiquidAI / LFM2.5-Encoder-350M-Diffusion

huggingface.co
Total runs: 1.4K
24-hour runs: 0
7-day runs: 165
30-day runs: 263
Model's Last Updated: July 28 2026
text-generation

Introduction of LFM2.5-Encoder-350M-Diffusion

Model Details of LFM2.5-Encoder-350M-Diffusion

LFM2.5-Encoder-350M-Diffusion

A full fine-tune of LFM2.5-Encoder-350M as a masked-diffusion instruction model that generates text by iteratively unmasking tokens instead of decoding left to right.

The model was SFT-trained on mlabonne/open-perfectblend , a dataset of roughly 1.39M conversations, for 3 epochs.

Masked diffusion is a natural extension of masked-language modeling: the model starts from masked answer tokens, repeatedly predicts all masked positions, fills the most confident tokens, and continues until the answer is complete.

Find more details about our encoders in our blog post .

💻 Demos : Try this fine-tuned model running in a CPU-only Hugging Face space: Masked-diffusion text generation — run the encoder as a chatbot that generates text by iteratively unmasking instead of left to right.

Usage

Install the required packages:

pip install torch transformers

Run masked-diffusion text generation:

import torch
from transformers import AutoModelForMaskedLM, AutoTokenizer

model_id = "LiquidAI/LFM2.5-Encoder-350M-Diffusion"

tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForMaskedLM.from_pretrained(model_id, trust_remote_code=True).eval()

messages = [{"role": "user", "content": "Give one short tip for writing clearer code."}]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt")

num_new_tokens = 12
mask_id = tokenizer.mask_token_id
input_ids = torch.cat(
    [inputs.input_ids, torch.full((1, num_new_tokens), mask_id, dtype=torch.long)],
    dim=1,
)
attention_mask = torch.ones_like(input_ids)

with torch.no_grad():
    for _ in range(num_new_tokens):
        mask_positions = (input_ids[0] == mask_id).nonzero(as_tuple=True)[0]
        if len(mask_positions) == 0:
            break

        logits = model(input_ids=input_ids, attention_mask=attention_mask).logits[0, mask_positions]
        logits[:, len(tokenizer):] = -torch.inf
        for token_id in tokenizer.all_special_ids:
            if token_id != tokenizer.eos_token_id:
                logits[:, token_id] = -torch.inf

        probs = logits.softmax(dim=-1)
        confidence, token_ids = probs.max(dim=-1)
        best = confidence.argmax()
        input_ids[0, mask_positions[best]] = token_ids[best]

generated = input_ids[0, inputs.input_ids.shape[1]:]
text = tokenizer.decode(generated, skip_special_tokens=True).split("[/Answer]")[0]
print(text.strip())
📬 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},
}

Runs of LiquidAI LFM2.5-Encoder-350M-Diffusion on huggingface.co

1.4K
Total runs
0
24-hour runs
79
3-day runs
165
7-day runs
263
30-day runs

More Information About LFM2.5-Encoder-350M-Diffusion huggingface.co Model

More LFM2.5-Encoder-350M-Diffusion license Visit here:

https://choosealicense.com/licenses/lfm1.0

LFM2.5-Encoder-350M-Diffusion huggingface.co

LFM2.5-Encoder-350M-Diffusion huggingface.co is an AI model on huggingface.co that provides LFM2.5-Encoder-350M-Diffusion's model effect (), which can be used instantly with this LiquidAI LFM2.5-Encoder-350M-Diffusion model. huggingface.co supports a free trial of the LFM2.5-Encoder-350M-Diffusion model, and also provides paid use of the LFM2.5-Encoder-350M-Diffusion. Support call LFM2.5-Encoder-350M-Diffusion model through api, including Node.js, Python, http.

LFM2.5-Encoder-350M-Diffusion huggingface.co Url

https://huggingface.co/LiquidAI/LFM2.5-Encoder-350M-Diffusion

LiquidAI LFM2.5-Encoder-350M-Diffusion online free

LFM2.5-Encoder-350M-Diffusion huggingface.co is an online trial and call api platform, which integrates LFM2.5-Encoder-350M-Diffusion's modeling effects, including api services, and provides a free online trial of LFM2.5-Encoder-350M-Diffusion, you can try LFM2.5-Encoder-350M-Diffusion online for free by clicking the link below.

LiquidAI LFM2.5-Encoder-350M-Diffusion online free url in huggingface.co:

https://huggingface.co/LiquidAI/LFM2.5-Encoder-350M-Diffusion

LFM2.5-Encoder-350M-Diffusion install

LFM2.5-Encoder-350M-Diffusion is an open source model from GitHub that offers a free installation service, and any user can find LFM2.5-Encoder-350M-Diffusion on GitHub to install. At the same time, huggingface.co provides the effect of LFM2.5-Encoder-350M-Diffusion install, users can directly use LFM2.5-Encoder-350M-Diffusion installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

LFM2.5-Encoder-350M-Diffusion install url in huggingface.co:

https://huggingface.co/LiquidAI/LFM2.5-Encoder-350M-Diffusion

Url of LFM2.5-Encoder-350M-Diffusion

LFM2.5-Encoder-350M-Diffusion huggingface.co Url

Provider of LFM2.5-Encoder-350M-Diffusion huggingface.co

LiquidAI
ORGANIZATIONS

Other API from LiquidAI

huggingface.co

Total runs: 119.0K
Run Growth: 76.2K
Growth Rate: 64.05%
Updated:April 02 2026
huggingface.co

Total runs: 104.2K
Run Growth: 78.6K
Growth Rate: 75.40%
Updated:March 30 2026
huggingface.co

Total runs: 100.4K
Run Growth: 58.9K
Growth Rate: 58.70%
Updated:February 13 2026
huggingface.co

Total runs: 94.9K
Run Growth: 25.8K
Growth Rate: 27.18%
Updated:March 30 2026
huggingface.co

Total runs: 20.2K
Run Growth: -12.8K
Growth Rate: -63.43%
Updated:March 30 2026
huggingface.co

Total runs: 15.0K
Run Growth: -24.0K
Growth Rate: -159.48%
Updated:March 30 2026
huggingface.co

Total runs: 11.9K
Run Growth: -170
Growth Rate: -1.43%
Updated:March 30 2026
huggingface.co

Total runs: 9.6K
Run Growth: -1.9K
Growth Rate: -19.52%
Updated:March 30 2026
huggingface.co

Total runs: 6.5K
Run Growth: 449
Growth Rate: 6.86%
Updated:March 30 2026
huggingface.co

Total runs: 3.8K
Run Growth: -692
Growth Rate: -18.35%
Updated:March 30 2026