How Is LFM3's Tri-Hybrid Architecture Built and Trained?
How Liquid AI built LFM3-1.7B-Base: 13 gated short convolutions, 5 sliding-window and 6 global attention layers, and a 22T-token recipe to 256K context.

How is LFM3's tri-hybrid architecture built and trained?
LFM3-1.7B-Base is a 1.73B-parameter, 24-layer text model that mixes three layer types: 13 gated short convolutions, 5 sliding-window attention layers and 6 global attention layers. Liquid AI pre-trained it on 22T tokens in stages. A main pre-training run covers web, synthetic, code, math and science data. Then 3.5T tokens of curated mid-training data, heavy on agentic traces and tool calls, stretch the context window to 256K. Post-training turns the base checkpoint into LFM3-1.7B.
TL;DR
- LFM3-1.7B-Base uses a tri-hybrid stack of 24 layers: 13 gated short convolutions, 5 sliding-window attention layers and 6 global attention layers.
- The model saw 22T tokens in total, with the final 3.5T tokens being curated mid-training data rather than raw web text.
- Context grows in steps, and the recipe reaches 256K tokens of input plus output through dedicated 128K and 256K extension stages.
- Mid-training adds a larger share of agentic traces and tool calls, plus chat data with and without thinking traces.
- Post-training combines SFT, mixed RL, multi-domain on-policy distillation and agentic RL to produce LFM3-1.7B.
- The base checkpoint is meant for heavy fine-tuning, not for chat or agents out of the box. At 4-bit precision it needs about 1 GB of memory.
What are the three layer types in the tri-hybrid design?
The model card lists the stack as 13 gated short convolution layers, 5 sliding-window attention layers and 6 global attention layers. That is 24 layers total.
| Layer type | Count | Share of stack |
|---|---|---|
| Gated short convolution | 13 | about 54% |
| Sliding-window attention | 5 | about 21% |
| Global attention | 6 | 25% |
Each type does a different job. This is general background, not something the card spells out layer by layer:
- Gated short convolutions mix information across a small local neighborhood of tokens. Their cost per token stays flat as the sequence grows, and they don't need a key-value cache the way attention does.
- Sliding-window attention lets each token attend to a bounded window of recent tokens. This gives finer local reasoning than a convolution while still capping memory.
- Global attention lets any token attend to the whole context. It is the most expensive layer type, so the design uses it in only a quarter of the stack.
The model card does not give the window size or the order in which the layers are interleaved, so treat those as unknowns until you read the code or the release blog post. The code ships with the checkpoint and loads with trust_remote_code=True.
The practical logic is straightforward. If only 6 of 24 layers keep a full-context cache, long sequences cost much less memory than in an all-attention model of similar depth. That matters for a model aimed at phones and laptops.
What are the core specs?
| Property | Value |
|---|---|
| Checkpoint | Pre-trained, text-only base model |
| Parameters | 1.73B |
| Layers | 24 |
| Context length | 256K tokens (input + output) |
| Vocabulary | 128,000 tokens |
| Languages | 16, including English, Arabic, Chinese, Japanese, Hindi and Russian |
| Weights | BF16 |
| License | LFM Open License v1.0 |
At 4-bit precision, Liquid AI says the model takes about 1 GB of memory, so it fits on any phone or laptop.
How was LFM3-1.7B-Base pre-trained?
Pre-training runs in two broad stages: main pre-training and mid-training. The training recipe diagram on the model card breaks the 22T tokens into smaller steps.
| Stage | Data | Tokens | Context |
|---|---|---|---|
| Main pre-training | Web and synthetic data | about 15T | not specified in the diagram |
| Main pre-training | Code, math and science | 3T | 4K |
| Mid-training | Curated agentic data | 3T | 32K |
| Extension | Long-context | 500B | 128K |
| Extension | Long-context | 50B | 256K |
Those figures add up to roughly the 22T total. The card states that the last 3.5T tokens are the curated mid-training portion, which matches the 3T plus 500B plus 50B at the end of the diagram.
Compared with LFM2, Liquid AI says the main pre-training mix adds more scientific papers, repository-level code, math and a wider range of knowledge sources. Repository-level code matters for long-context work, because the model sees how files in a project relate rather than isolated snippets.
Why train context length in stages?
Attention cost grows quickly with sequence length, so training on very long sequences from the start is expensive. The recipe instead spends most tokens at short context (4K for the code, math and science stage) and moves up in steps: 32K during mid-training, then 128K and 256K. The last two steps use far fewer tokens, 500B and 50B.
This staging pattern is common across long-context models. Most of the learning happens cheaply on short sequences, and a small, targeted budget teaches the model to use long positions. The card does not publish long-context benchmark results, so there are no numbers here on how well the model retrieves or reasons at 256K.
What is in the agentic mid-training data?
Mid-training uses curated, higher-quality data with a larger share of agentic traces and tool calls. An agentic trace is a record of a model working through a multi-step task, such as deciding to call a tool, reading the result and continuing. Exposing the base model to these patterns before post-training gives later RL stages something to build on.
The model card adds one detail with practical consequences. Mid-training also included chat data, with and without thinking traces, formatted with the same chat template as LFM3-1.7B. So even the base checkpoint responds to the chat template:
- With
apply_chat_template, reasoning is on by default, and responses start with a thinking trace. - Setting
enable_thinking=Falseprefills an empty thinking trace so the model answers directly.
Liquid AI still recommends LFM3-1.7B, not the base model, for chat, tool calling and agents.
How does post-training get from the base model to LFM3-1.7B?
The card names four post-training methods applied to this checkpoint:
- Supervised fine-tuning (SFT)
- Mixed reinforcement learning
- Multi-domain on-policy distillation
- Agentic reinforcement learning
It does not state the order, the datasets or the reward designs, and it publishes no benchmark comparisons between base and post-trained models. The final stage, agentic RL, fits with the mid-training data. Tool-call traces in the base give the RL stage a starting behavior worth reinforcing.
Should you use the base model or LFM3-1.7B?
Use the base model when you plan to change the model substantially. The card lists language-specific or domain-specific assistants, training on proprietary data, and experiments with new post-training approaches. For everyday chat, tool calling and agents, use LFM3-1.7B.
Liquid AI points to TRL for both continued pre-training and full post-training. It provides two example notebooks, one for SFT that extracts structured JSON from messy documents, and one for continued pre-training that teaches the model Turkish from raw text. Both start from LFM3-1.7B, and you switch to the base model by setting model_id = "LiquidAI/LFM3-1.7B-Base".
A minimal load looks like this:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "LiquidAI/LFM3-1.7B-Base"
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
dtype="bfloat16",
trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
Frequently Asked Questions
What does "tri-hybrid" mean in LFM3?
It means the network combines three layer types instead of one. In LFM3-1.7B-Base those are gated short convolutions, sliding-window attention and global attention, in a 13, 5 and 6 split across 24 layers.
How many tokens was LFM3-1.7B-Base trained on?
22T tokens in total. About 15T are web and synthetic data, and 3T are code, math and science at 4K context. The last 3.5T are curated mid-training data, which includes the long-context extension steps.
Can I use LFM3-1.7B-Base as a chat model?
You can prompt it with the chat template, since mid-training included chat data with and without thinking traces. Liquid AI recommends the post-trained LFM3-1.7B for chat, tool calling and agents, and positions the base model for heavy fine-tuning.
How much memory does the model need?
At 4-bit precision it takes about 1 GB, according to the model card. The released weights are in BF16, so running them unquantized needs more. The card gives no figure for that case or for long-context usage.
Which languages does it support?
Sixteen: English, Arabic, Chinese, French, German, Italian, Japanese, Korean, Portuguese, Spanish, Vietnamese, Thai, Indonesian, Hindi, Russian and Polish.
How we source, write, and correct our articles. Editorial standards



