inference/research
verifiedhigh · 0.90updated 2026-10-04

LFM2-1.2B

hybrid-attention-ssm 1.17B

Fields

id
models/lfm2-1-2b
Family
lfm2
Vendor
Liquid AI
Release year
2025
Architecture
hybrid-attention-ssm
Params (B)
1.17
Active params (B)
1.17
Hidden size
2,048
Layers
16
KV heads
8
Head dim
64
GQA ratio
4
Max context
128,000
Context scaling method
native
Activation
swiglu
Attention variant
hybrid: 10 short-conv (Mamba-style) + 6 full-attention layers
KV cache (bytes/token)
0
FLOPs per active token
2,340,000,000
Open weights
yes
License
LFM Open License 1.0 (license: other)
notes
CONTEXT SCALING: null is a VERIFIED value here, checked against config rather than left blank. config.json (LiquidAI/LFM2-1.2B) declares rope_scaling null, rope_theta 1000000, max_position_embeddings 128000. Verified null. HYBRID MODEL — kv_cache_bytes_per_token is 0, not null, and not 'small'. The standard formula num_layers * num_kv_heads * head_dim * 2 * bytes does NOT apply to the whole model. config.json for LFM2 gives full_attn_idxs [2,5,8,10,12,14] — 6 of 16 layers are full attention — and the remaining 10 are short causal convolutions with conv_dim 2048 and conv_L_cache 3, i.e. a fixed-width rolling state of 3 timesteps, not a growing cache. Only the 6 attention layers consume KV: 6 * 8 * 64 * 2 * 2 = 12288 bytes/token at bf16, and that is constant in sequence length. Recorded as 0 because the repo's own convention for state-space/hybrid models is that there is no growing KV cache to plan for; the 12288 B/token attention slice is given here so the nonzero part is not lost. The serving consequence is the whole point: at the advertised 128000 max_position_embeddings, attention KV is 128000 * 12288 = 1.5 GiB and stops growing meaningfully, whereas a Llama-architecture 1.7B at the same context (SmolLM2, 196608 B/token) would need 23.4 GiB. That is a 15x difference in resident memory at long context from an architecture choice, at similar parameter count. num_attention_heads 32 / num_key_value_heads 8 (GQA 4:1); head_dim derived = 2048 / 32 = 64; num_heads 32 duplicated for legacy consumers. rope_theta 1e6, vocab 65536, block_use_swiglu true. LFM2.5 makes this explicit as a layer_types array. License is lfm1.0, a non-standard license — cardData reports 'other', so treat it as 'read the terms' not 'permissive'. GGUF and ONNX ports both exist (onnx-community/LFM2-1.2B-ONNX), including official LiquidAI ONNX. SERVICEABILITY JOIN (added 2026-10-03; the architecture x engine matrix this record was missing, with a citation per cell in docs/13-model-compatibility.md): FAMILY=hybrid-attention-ssm. REQUIRED KERNEL CLASS: two kernel families in one graph - a chunked linear-attention / delta-rule kernel for the SSM or linear-attention layers, and an ordinary or MLA decode kernel for the full-attention minority - plus a fixed-size recurrent state allocator. Three independent records say the recurrent branch is the hard part: flop/ssm-recurrent-state-update (the state is a fixed per-sequence tax that never amortises, so it scales with concurrency and NOT with context); flop/ssm-sequential-scan-tensor-core-mismatch (the recurrence is a multiplicative chain that tensor cores cannot express, so it must run as a sequential scan; the published SSD-vs-fused-scan gap is 2-8x for identical mathematics); and llama.cpp's own dispatch table, which puts every hybrid and SSM architecture in its supports_sm_tensor == false list [[mdl2-llamacpp-arch-class-registry]] - the engine agreeing with the arithmetic. That same list also shows llama.cpp needed ONE shared hybrid code path (llm_arch_is_hybrid, 18 entries: JAMBA, FALCON_H1, PLAMO2, GRANITE_HYBRID, LFM2, LFM2MOE, NEMOTRON_H, NEMOTRON_H_MOE, QWEN3NEXT, KIMI_LINEAR, BAILINGMOE3, KIMI_K3, GLM5_NEXT, QWEN35, QWEN35MOE, QWEN4EXP, DEEPSEEK4, MINIMAX_01) covering exactly the families vLLM and SGLang each ship as separate rows, which is why hybrid support arrives per engine release rather than at once. SUPPORTED BY (cited): vLLM native rows MambaForCausalLM, Mamba2ForCausalLM, JambaForCausalLM, FalconMambaForCausalLM, FalconH1ForCausalLM, NemotronHForCausalLM, GraniteMoeHybridForCausalLM, Qwen3NextForCausalLM, KimiLinearForCausalLM, Lfm2ForCausalLM, Lfm2MoeForCausalLM, OlmoHybridForCausalLM, KimiK3ForConditionalGeneration, BailingMoeV3ForCausalLM, Qwen3_5 rows [[mdl2-vllm-supported-models-2026-10]]; SGLang generative table names Granite 4.0 micro as 'hybrid Mamba-MoE ... combining gated short convolutions with a small number of grouped query attention blocks', Kimi Linear as 'hybrid linear attention model ... Kimi Delta Attention (KDA) for up to 6x faster decoding and 75% KV cache reduction vs full attention', Nemotron Nano as 'hybrid Mamba-Transformer architecture', Ling as 'hybrid MoE model: per-layer mix of DeepSeek-style MLA full attention and Qwen3 Gated-Delta-Net (GDN) linear attention', LFM2 as 'hybrid backbone', Mamba-Codestral as 'Mamba2 ... holds no KV cache', and its multimodal page carries the descriptor 'hybrid KDA/MLA' [[mdl2-sglang-generative-models]] [[mdl2-sglang-multimodal-language-models]]. TensorRT-LLM has rows for NemotronHForCausalLM, Qwen3NextForCausalLM, Qwen3_5MoeForCausalLM, Qwen4ExpForCausalLM, KimiLinearForCausalLM and KimiK3ForConditionalGeneration but NO row at all for MambaForCausalLM, Mamba2ForCausalLM, FalconH1ForCausalLM, Lfm2ForCausalLM or GraniteMoeHybridForCausalLM [[mdl2-trtllm-supported-models]]. PER-FAMILY FEATURE TRAPS, all from the TRT-LLM key-models matrix, which is the only per-architecture feature matrix in this repo [[mdl2-trtllm-supported-models]]: Qwen3NextForCausalLM has Sliding Window Attention = No and Speculative Decoding = No; Kimi K3 has no MTP or EAGLE-3 head at all (spec method DSpark only) and needs Blackwell SM100; MiniMax-M3 sparse-attention path supports neither KV cache reuse nor MTP in this release; DeepSeek-V4 and Step-3.7 are 'Untested' for disaggregated serving. KERNEL BUGS THAT ARE ARCHITECTURE-SPECIFIC AND REPRODUCED: (1) vLLM's EAGLE last-block drop (drop_eagle_block) costs 6-10 points of prefix-cache hit rate, and on a hybrid GDN/Mamba layout the scheduler alignment unit is 1,648 tokens instead of a 16-token dense block, so the same protection costs ~100x more cache hit - 97.5% to 86.9-91.7% hit rate and 30-40% batch throughput on prefix-reusing workloads [[eagle-prefix-cache-last-block-drop]]. (2) llama.cpp decode collapses on hybrid gated-deltanet GGUF models at high KV position: 33 t/s at 68K to 1.4 t/s at 91K with the model fully resident, across KV quant types and with FA on or off, reproduced on Windows and WSL2 on master and release [[gated-deltanet-decode-collapse-long-context]]. (3) llama.cpp's SYCL path has a regression specific to hybrid linear-attention graphs - qwen3next/qwen3_35 architecture models crash in ggml_sycl_op_mul_mat or return empty output on 2x Arc Pro B60, bracketed between builds b8477 (works) and b9479 (fails), while dense-attention models on the same cards are unaffected [[sycl-hybrid-linear-attention-arch-crash-intel-arc]]. (4) FlashInfer rejects large head sizes at engine init for the head geometry these hybrids introduce [[flashinfer-rejects-large-head-dim]]. Hybrid conv + attention: 10 short causal convolutions with conv_L_cache 3 (a 3-timestep rolling state, not a growing cache) plus 6 full-attention layers at full_attn_idxs [2,5,8,10,12,14]. Required kernels are a short-conv state path and an ordinary attention path; no MLA, no delta rule. vLLM has native Lfm2ForCausalLM and Lfm2MoeForCausalLM rows plus Lfm2VlForConditionalGeneration, and llama.cpp's llm_arch_is_hybrid and supports_rs_rollback both include LFM2 and LFM2MOE [[mdl2-vllm-supported-models-2026-10]] [[mdl2-llamacpp-arch-class-registry]]. SGLang's generative table lists LFM2 and LFM2.5 and describes 'LFM2 hybrid backbone, with SwiGLU experts, normalized sigmoid routing, and top-k expert selection'; its multimodal table lists LiquidAI/LFM2.5-VL-1.6B [[mdl2-sglang-generative-models]] [[mdl2-sglang-multimodal-language-models]]. TRT-LLM has no LFM row [[mdl2-trtllm-supported-models]]. ONNX ports exist for this family, which makes onnxruntime-genai the ONNX-first path [[onnxruntime-genai]] - though that engine's official architecture list names LFM2 explicitly alongside Granite, Granite MoE Hybrid, Phi, gpt-oss, Llama, Mistral, Qwen, Gemma, DeepSeek, Nemotron, InternLM2, SmolLM3, ERNIE 4.5, ChatGLM and Whisper, so it is a named row rather than an inference [[onnxruntime-genai]].

Notes

CONTEXT SCALING: null is a VERIFIED value here, checked against config rather than left blank. config.json (LiquidAI/LFM2-1.2B) declares rope_scaling null, rope_theta 1000000, max_position_embeddings 128000. Verified null. HYBRID MODEL — kv_cache_bytes_per_token is 0, not null, and not 'small'. The standard formula num_layers * num_kv_heads * head_dim * 2 * bytes does NOT apply to the whole model. config.json for LFM2 gives full_attn_idxs [2,5,8,10,12,14] — 6 of 16 layers are full attention — and the remaining 10 are short causal convolutions with conv_dim 2048 and conv_L_cache 3, i.e. a fixed-width rolling state of 3 timesteps, not a growing cache. Only the 6 attention layers consume KV: 6 * 8 * 64 * 2 * 2 = 12288 bytes/token at bf16, and that is constant in sequence length. Recorded as 0 because the repo's own convention for state-space/hybrid models is that there is no growing KV cache to plan for; the 12288 B/token attention slice is given here so the nonzero part is not lost. The serving consequence is the whole point: at the advertised 128000 max_position_embeddings, attention KV is 128000 * 12288 = 1.5 GiB and stops growing meaningfully, whereas a Llama-architecture 1.7B at the same context (SmolLM2, 196608 B/token) would need 23.4 GiB. That is a 15x difference in resident memory at long context from an architecture choice, at similar parameter count. num_attention_heads 32 / num_key_value_heads 8 (GQA 4:1); head_dim derived = 2048 / 32 = 64; num_heads 32 duplicated for legacy consumers. rope_theta 1e6, vocab 65536, block_use_swiglu true. LFM2.5 makes this explicit as a layer_types array. License is lfm1.0, a non-standard license — cardData reports 'other', so treat it as 'read the terms' not 'permissive'. GGUF and ONNX ports both exist (onnx-community/LFM2-1.2B-ONNX), including official LiquidAI ONNX.

SERVICEABILITY JOIN (added 2026-10-03; the architecture x engine matrix this record was missing, with a citation per cell in docs/13-model-compatibility.md): FAMILY=hybrid-attention-ssm. REQUIRED KERNEL CLASS: two kernel families in one graph - a chunked linear-attention / delta-rule kernel for the SSM or linear-attention layers, and an ordinary or MLA decode kernel for the full-attention minority - plus a fixed-size recurrent state allocator. Three independent records say the recurrent branch is the hard part: flop/ssm-recurrent-state-update (the state is a fixed per-sequence tax that never amortises, so it scales with concurrency and NOT with context); flop/ssm-sequential-scan-tensor-core-mismatch (the recurrence is a multiplicative chain that tensor cores cannot express, so it must run as a sequential scan; the published SSD-vs-fused-scan gap is 2-8x for identical mathematics); and llama.cpp's own dispatch table, which puts every hybrid and SSM architecture in its supports_sm_tensor == false list [[mdl2-llamacpp-arch-class-registry]] - the engine agreeing with the arithmetic. That same list also shows llama.cpp needed ONE shared hybrid code path (llm_arch_is_hybrid, 18 entries: JAMBA, FALCON_H1, PLAMO2, GRANITE_HYBRID, LFM2, LFM2MOE, NEMOTRON_H, NEMOTRON_H_MOE, QWEN3NEXT, KIMI_LINEAR, BAILINGMOE3, KIMI_K3, GLM5_NEXT, QWEN35, QWEN35MOE, QWEN4EXP, DEEPSEEK4, MINIMAX_01) covering exactly the families vLLM and SGLang each ship as separate rows, which is why hybrid support arrives per engine release rather than at once. SUPPORTED BY (cited): vLLM native rows MambaForCausalLM, Mamba2ForCausalLM, JambaForCausalLM, FalconMambaForCausalLM, FalconH1ForCausalLM, NemotronHForCausalLM, GraniteMoeHybridForCausalLM, Qwen3NextForCausalLM, KimiLinearForCausalLM, Lfm2ForCausalLM, Lfm2MoeForCausalLM, OlmoHybridForCausalLM, KimiK3ForConditionalGeneration, BailingMoeV3ForCausalLM, Qwen3_5 rows [[mdl2-vllm-supported-models-2026-10]]; SGLang generative table names Granite 4.0 micro as 'hybrid Mamba-MoE ... combining gated short convolutions with a small number of grouped query attention blocks', Kimi Linear as 'hybrid linear attention model ... Kimi Delta Attention (KDA) for up to 6x faster decoding and 75% KV cache reduction vs full attention', Nemotron Nano as 'hybrid Mamba-Transformer architecture', Ling as 'hybrid MoE model: per-layer mix of DeepSeek-style MLA full attention and Qwen3 Gated-Delta-Net (GDN) linear attention', LFM2 as 'hybrid backbone', Mamba-Codestral as 'Mamba2 ... holds no KV cache', and its multimodal page carries the descriptor 'hybrid KDA/MLA' [[mdl2-sglang-generative-models]] [[mdl2-sglang-multimodal-language-models]]. TensorRT-LLM has rows for NemotronHForCausalLM, Qwen3NextForCausalLM, Qwen3_5MoeForCausalLM, Qwen4ExpForCausalLM, KimiLinearForCausalLM and KimiK3ForConditionalGeneration but NO row at all for MambaForCausalLM, Mamba2ForCausalLM, FalconH1ForCausalLM, Lfm2ForCausalLM or GraniteMoeHybridForCausalLM [[mdl2-trtllm-supported-models]]. PER-FAMILY FEATURE TRAPS, all from the TRT-LLM key-models matrix, which is the only per-architecture feature matrix in this repo [[mdl2-trtllm-supported-models]]: Qwen3NextForCausalLM has Sliding Window Attention = No and Speculative Decoding = No; Kimi K3 has no MTP or EAGLE-3 head at all (spec method DSpark only) and needs Blackwell SM100; MiniMax-M3 sparse-attention path supports neither KV cache reuse nor MTP in this release; DeepSeek-V4 and Step-3.7 are 'Untested' for disaggregated serving. KERNEL BUGS THAT ARE ARCHITECTURE-SPECIFIC AND REPRODUCED: (1) vLLM's EAGLE last-block drop (drop_eagle_block) costs 6-10 points of prefix-cache hit rate, and on a hybrid GDN/Mamba layout the scheduler alignment unit is 1,648 tokens instead of a 16-token dense block, so the same protection costs ~100x more cache hit - 97.5% to 86.9-91.7% hit rate and 30-40% batch throughput on prefix-reusing workloads [[eagle-prefix-cache-last-block-drop]]. (2) llama.cpp decode collapses on hybrid gated-deltanet GGUF models at high KV position: 33 t/s at 68K to 1.4 t/s at 91K with the model fully resident, across KV quant types and with FA on or off, reproduced on Windows and WSL2 on master and release [[gated-deltanet-decode-collapse-long-context]]. (3) llama.cpp's SYCL path has a regression specific to hybrid linear-attention graphs - qwen3next/qwen3_35 architecture models crash in ggml_sycl_op_mul_mat or return empty output on 2x Arc Pro B60, bracketed between builds b8477 (works) and b9479 (fails), while dense-attention models on the same cards are unaffected [[sycl-hybrid-linear-attention-arch-crash-intel-arc]]. (4) FlashInfer rejects large head sizes at engine init for the head geometry these hybrids introduce [[flashinfer-rejects-large-head-dim]]. Hybrid conv + attention: 10 short causal convolutions with conv_L_cache 3 (a 3-timestep rolling state, not a growing cache) plus 6 full-attention layers at full_attn_idxs [2,5,8,10,12,14]. Required kernels are a short-conv state path and an ordinary attention path; no MLA, no delta rule. vLLM has native Lfm2ForCausalLM and Lfm2MoeForCausalLM rows plus Lfm2VlForConditionalGeneration, and llama.cpp's llm_arch_is_hybrid and supports_rs_rollback both include LFM2 and LFM2MOE [[mdl2-vllm-supported-models-2026-10]] [[mdl2-llamacpp-arch-class-registry]]. SGLang's generative table lists LFM2 and LFM2.5 and describes 'LFM2 hybrid backbone, with SwiGLU experts, normalized sigmoid routing, and top-k expert selection'; its multimodal table lists LiquidAI/LFM2.5-VL-1.6B [[mdl2-sglang-generative-models]] [[mdl2-sglang-multimodal-language-models]]. TRT-LLM has no LFM row [[mdl2-trtllm-supported-models]]. ONNX ports exist for this family, which makes onnxruntime-genai the ONNX-first path [[onnxruntime-genai]] - though that engine's official architecture list names LFM2 explicitly alongside Granite, Granite MoE Hybrid, Phi, gpt-oss, Llama, Mistral, Qwen, Gemma, DeepSeek, Nemotron, InternLM2, SmolLM3, ERNIE 4.5, ChatGLM and Whisper, so it is a named row rather than an inference [[onnxruntime-genai]].

Cross-references

This record references no other records — it is a leaf. It is cited by 0.