HuggingFace Blog · 原文 2026-10-28 · 译文 2026-10-28 · 难度 进阶
精读 · 译文(非本站原创)
来自资源池 · HuggingFace Blog ↗ · 原文:Build specialized multimodal models with LFM3 ↗ · 版权归 HuggingFace Blog 所有 · 译文为个人学习的非官方翻译,以原文为准;如权利方有疑虑可联系公众号「疯了再说」删除
导读 · LFM 第三代:六模态一骨干全 2B 级,1.7B 超上代、256K 端侧常驻

为什么精读这篇它把「一个通用大模型」的路线反着走到底:六种专用模型(文本/视觉/音频/omni/决策)全部从同一个 1.7B 骨干分叉、全部单卡微调、全部端侧部署——「专用智能的起点」。tri-hybrid 架构与 256K 端侧上下文是边缘 agent 的硬件级答卷,d1 决策模型升级则让 Jev 线的开放对手再进一格。

  • 家族结构:LFM3-1.7B-Base 一个骨干分叉出六个 2B 级模型——LFM3-1.7B(文本)/VL-2B(视觉,首次支持视频输入)/Audio-2B(语音)/Omni-2B(首个 omni:文本+视觉+音频输入,文本+语音输出)/d1-2B 与 d1-omni-2B(决策)——按模态选模型、单 GPU 微调、部署到应用运行处
  • 四大变化总览:每参数更强(1.7B 超 LFM2.5-2.6B、参数省 35%);一模态一骨干(六模型同源);为边缘而生(4-bit 约 1GB、256K 上下文让 agent 常驻设备);为专用而生(每个模型单卡微调)
  • 骨干架构四改动:tri-hybrid 层混(24 层=13 门控短卷积+5 滑窗注意力 SWA(256-token 窗)+6 全局注意力,卷积核 3→7);head-wise 门控注意力(sigmoid 门控每个头输出、没贡献的头可关闭——顺带抑制伤害量化的激活离群值);partial RoPE(全局层只旋转每头最高频的一半维度,另一半按内容匹配不管距离;SWA 层保留全 RoPE);三明治归一(每块对输入输出都归一)
  • 架构搜索硬件在环:14 种设备与后端组合(手机、树莓派 5、笔记本、云 CPU/GPU、高通 Hexagon NPU);预训练 22T token(词表同 LFM2.5-8B-A1B 的 128K),最后 3.5T 为中期训练(精选数据、agentic 轨迹与工具调用占比更大)并扩窗到 256K
  • 长上下文收益:短提示上 LFM3-1.7B 与 LFM2-1.2B 每参数持平,8K token 上下文时快约 25%
  • 两个自研编码器:视觉(卷积+注意力混合,比前代 SigLIP2 省 3 倍算力;164M 参数即匹敌 Qwen3.5-2B 视觉编码器且 FLOPs 省 2.2 倍;视频按帧对嵌入成时间片、时间序列长度减半);音频(滑窗注意力+短卷积、全因果——你说话时它在预填充,首 token 低至 50ms)+ LiquidCodec 音频 tokenizer(Apple M4 Max 单 CPU 线程约 87 倍实时、支持流式)
  • 文本模型战绩:在 Hermes Agent、Pi、OpenClaw 等 harness 里后训练;WebArena-Verified 38.42 对上代 3.02,浏览器与商务应用长任务上胜 Qwen3.5-9B
  • VL 战绩:参数更少(1.9B vs 3.1B)而 62 项视觉基准均分 57.6→71.4,与六倍大的 Gemma 4 12B 持平;会先逐步推理再回答、能找物体并推理位置(机器人底座)
  • Audio/Omni:18 语言语音聊天/识别/合成/翻译、口语转工具调用;UTMOSv2 语音质量 3.83 对 3.22;Omni 在音视频理解上胜 10.7B 级(Qwen2.5-Omni-7B 等)
  • d1 决策模型 2B 化:单次前向答全部问题(带校准概率),新增能力——指向物体、读文档值、数值区间估计、多选全选;d1-2B 比 d1-3B 参数少三分之一而四套决策基准全高(ImajevBench 75.5 对 64.0);d1-omni-2B 支持语音提问且几乎不掉准
15 段 · 约 9 分钟

LFM3 is our new generation of Liquid Foundation Models (LFMs), built to be the starting point for specialized intelligence. It brings text, vision, audio, omni, and decision models onto one shared backbone, all in the 2B parameter range. This means you can pick the model for your modality, fine-tune it on your own data on a single GPU, and deploy it where your application runs.

LFM3 是我们新一代 Liquid Foundation Models(LFM),为成为**专用智能的起点**而造:文本、视觉、音频、omni 与决策模型全部落在同一个共享骨干上,全部在 2B 参数量级。这意味着你可以按模态选模型、在单张 GPU 上用自己的数据微调、部署到你的应用运行的地方。

LFM3 brings four main changes compared to our previous LFM2 family: More capability per parameter — a new tri-hybrid architecture and training recipe allow LFM3-1.7B to outperform LFM2.5-2.6B while using 35% fewer parameters. Every modality on one backbone — six 2B-class models (text, vision, audio, omni, and decision) trained from LFM3-1.7B-Base, including our first omni model and video input for our vision model. Built for the edge — the text model fits in about 1 GB at 4-bit precision, new in-house vision and audio encoders speed up processing, and the text model's 256K context window lets agents run on-device. Made to be specialized — every model fine-tunes on a single GPU, so you can adapt it to your data, terminology, and deployment environment.

相比上一代 LFM2 家族,LFM3 有四大变化:**每参数更强**——新的 tri-hybrid 架构与训练配方让 LFM3-1.7B 以少 35% 的参数胜过 LFM2.5-2.6B;**一模态一骨干**——六个 2B 级模型(文本/视觉/音频/omni/决策)全部从 LFM3-1.7B-Base 训练而来,含我们首个 omni 模型与视觉模型的视频输入;**为边缘而生**——文本模型 4-bit 精度约 1GB 装得下,新的自研视觉与音频编码器加速处理,256K 上下文窗口让 agent 跑在设备上;**为专用而生**——每个模型都能在单张 GPU 上微调,适配你的数据、术语与部署环境。

How we built a more expressive backbone · 我们怎么造出更有表达力的骨干

LFM2 showed that a hybrid of short convolutions and attention can run fast on-device without sacrificing quality. For LFM3, we used our hardware-in-the-loop architecture search to redesign that architecture for agentic use cases, which need more capability per parameter and fast inference over long contexts. The search now covers 14 device and backend combinations, from phones and a Raspberry Pi 5 to laptops, cloud CPUs, GPUs, and the Qualcomm Hexagon NPU.

LFM2 证明了短卷积与注意力的混合能在设备上跑得快而不牺牲质量。LFM3 我们用「硬件在环」的架构搜索为 agentic 用例重新设计了架构——这类用例需要每参数更多能力与长上下文快速推理。搜索现在覆盖 14 种设备与后端组合:从手机、树莓派 5 到笔记本、云 CPU、GPU 与高通 Hexagon NPU。

LFM3-1.7B-Base has 24 layers and four main changes. Tri-hybrid layer mix: 13 gated short convolutions, 5 sliding-window attention (SWA) layers with a 256-token window, and 6 global attention layers. The convolutions use a kernel size of 7, up from 3 in LFM2. Head-wise gated attention: a sigmoid gate scales each head's output, so a head can switch off when it has nothing to add. This can help suppress activation outliers that hurt quantization. Partial RoPE: global attention layers rotate only the highest-frequency half of each head, so the other half matches on content regardless of distance. SWA layers keep full RoPE. Sandwich norm: each block normalizes both its input and its output to keep activations well-scaled.

LFM3-1.7B-Base 共 24 层,有四项主要改动。**Tri-hybrid 层混**:13 层门控短卷积 + 5 层滑窗注意力(SWA,256-token 窗)+ 6 层全局注意力;卷积核大小从 LFM2 的 3 升到 7。**Head-wise 门控注意力**:一个 sigmoid 门缩放每个头的输出,没东西可贡献的头可以关闭——这有助于抑制伤害量化的激活离群值。**Partial RoPE**:全局注意力层只旋转每头最高频的一半维度,另一半按内容匹配、不受距离影响;SWA 层保留完整 RoPE。**三明治归一(sandwich norm)**:每块对输入与输出都做归一,保持激活尺度稳定。

The payoff shows at long context. Per parameter, LFM3-1.7B matches LFM2-1.2B on short prompts across edge devices, and with 8K tokens in context it is about 25% faster. LFM3-1.7B-Base was pre-trained on 22T tokens with the same 128K vocabulary as LFM2.5-8B-A1B. The final 3.5T tokens are a mid-training stage on curated data with a larger share of agentic traces and tool calls, which also extends the context window to 256K tokens.

回报在长上下文上显现:按每参数算,LFM3-1.7B 在边缘设备上的短提示与 LFM2-1.2B 持平,而上下文到 8K token 时快约 25%。LFM3-1.7B-Base 用 22T token 预训练(词表与 LFM2.5-8B-A1B 相同的 128K),最后 3.5T token 是精选数据上的中期训练——agentic 轨迹与工具调用占比更大——同时把上下文窗口扩到 256K。

One backbone for six models · 一个骨干六模型

Every LFM3 model branches from LFM3-1.7B-Base. Instead of running one large general-purpose model, you pick the one that fits your inputs, customize it, and run it on-device.

每个 LFM3 模型都从 LFM3-1.7B-Base 分叉。不是跑一个大的通用模型,而是选贴合你输入的那一个、定制它、在设备上运行。

The vision and audio models also get two new in-house encoders. Vision encoder: it combines convolution and attention and uses 3x less compute than the SigLIP2 encoder in previous LFM VL models. Our 164M-parameter encoder matches Qwen3.5-2B's vision encoder in accuracy while requiring 2.2x fewer FLOPs (both measured with the same LFM2.5-230M language backbone). For video, it embeds each pair of sampled frames into one temporal slice, halving the temporal sequence length. Audio encoder and LiquidCodec: the audio encoder mixes sliding-window attention and short convolutions and is fully causal, so the model can prefill while you speak, with time to first token as low as 50 ms. LiquidCodec, our new audio tokenizer, turns generated tokens into speech at about 87x real time on a single CPU thread on Apple M4 Max and supports streaming decoding.

视觉与音频模型还配了两个新的自研编码器。**视觉编码器**:卷积+注意力混合,算力比前代 LFM VL 模型的 SigLIP2 编码器省 3 倍;我们 164M 参数的编码器在精度上匹敌 Qwen3.5-2B 的视觉编码器、FLOPs 省 2.2 倍(两者都接同一个 LFM2.5-230M 语言骨干测量)。视频方面,它把采样帧两两嵌入一个时间片,时间序列长度减半。**音频编码器与 LiquidCodec**:音频编码器混合滑窗注意力与短卷积、全因果——你说话时它就能预填充,首 token 时间低至 50ms;新的音频 tokenizer LiquidCodec 在 Apple M4 Max 单 CPU 线程上以约 87 倍实时把生成 token 变成语音,支持流式解码。

How to use the LFM3 models · 怎么用 LFM3 模型

Reach for LFM3-1.7B when you need local agents, tool calling, structured outputs, or a base for domain-specific fine-tuning. It is post-trained to run in agentic harnesses such as Hermes Agent, Pi, and OpenClaw. It outperforms its predecessor, LFM2.5-2.6B, with 35% fewer parameters, and the biggest gains are on agentic tasks: on WebArena-Verified, it scores 38.42 against 3.02, and it even beats Qwen3.5-9B on long tasks in browsers and business apps.

需要本地 agent、工具调用、结构化输出或领域微调底座时选 **LFM3-1.7B**。它在 Hermes Agent、Pi、OpenClaw 等 agentic harness 里做过后训练。以少 35% 的参数胜过前任 LFM2.5-2.6B,且最大的涨幅在 agentic 任务上:WebArena-Verified 得 38.42(上代 3.02),在浏览器与商务应用的长任务上甚至胜过 Qwen3.5-9B。

Reach for LFM3-VL-2B when you need on-device visual understanding. It is the first LFM vision model that takes video as input; it reasons step by step before it answers, and it finds objects and reasons about how they are placed, a strong foundation for robotics. Compared with LFM2.5-VL-3B, it has fewer parameters (1.9B against 3.1B) yet raises the average across 62 vision benchmarks from 57.6 to 71.4, on par with Gemma 4 12B, a model more than six times larger.

需要端侧视觉理解时选 **LFM3-VL-2B**:这是第一个接受视频输入的 LFM 视觉模型;它会先逐步推理再回答,能找到物体并推理它们的空间摆放——机器人应用的扎实底座。对比 LFM2.5-VL-3B,参数更少(1.9B 对 3.1B)却把 62 项视觉基准的均分从 57.6 提到 71.4,与六倍大的 Gemma 4 12B 持平。

Reach for LFM3-Audio-2B when you need voice chat, speech recognition, speech synthesis, or translation across 18 languages on a laptop or edge device. It takes text or audio as input and responds with text, speech, or both, and it can turn spoken requests into tool calls. Compared with LFM2.5-Audio-1.5B, it uses a new in-house audio encoder and speech codec, speaks with higher quality (UTMOSv2 3.83 against 3.22), and adds audio understanding, general-purpose audio reasoning, and tool calling.

在笔记本或边缘设备上需要 18 语言语音聊天、语音识别、语音合成或翻译时选 **LFM3-Audio-2B**:文本或音频输入、文本或语音或双输出,还能把口语请求转成工具调用。对比 LFM2.5-Audio-1.5B:新的自研音频编码器与语音编解码器,语音质量更高(UTMOSv2 3.83 对 3.22),并新增音频理解、通用音频推理与工具调用。

Reach for LFM3-Omni-2B when you need one on-device model that sees, listens, and talks back, in place of a separate ASR model, vision-language model, LLM, and TTS model. It can answer spoken questions about an image, watch and listen to a video together, and turn what it sees and hears into tool calls. It is our first omni model, with text, vision, and audio input and both text and speech output, and it keeps the core capabilities of the standalone LFM3 models, including visual question answering, speech recognition, speech synthesis, and instruction following. Like LFM3-Audio-2B, it speaks through LiquidCodec, which turns generated tokens into speech faster than real time, so spoken replies stream as the model generates them. On audio-visual video understanding, it beats models up to 10.7B parameters, such as Qwen2.5-Omni-7B, on Daily-Omni, WorldSense, and AV-SpeakerBench.

需要一个「能看、能听、能说」的端侧模型来替代分开的 ASR+视觉语言模型+LLM+TTS 时选 **LFM3-Omni-2B**:它能语音回答关于图像的问题、同时看并听一段视频、把看到听到的变成工具调用。这是我们的首个 omni 模型——文本/视觉/音频输入,文本+语音输出——并保留各单模态模型的核心能力(视觉问答、语音识别与合成、指令遵循)。与 Audio 版一样经 LiquidCodec 说话:token 变语音快于实时,语音回复随模型生成流式吐出。音视频理解上(Daily-Omni、WorldSense、AV-SpeakerBench)胜过最高 10.7B 参数的模型(如 Qwen2.5-Omni-7B)。

Reach for the d1 models when you need fast, structured decisions instead of generated text. Give them a situation (a support ticket, an invoice, an app screen, a photo, a voice note) and a list of questions, and they answer all of them in a single forward pass, each with a calibrated probability. Beyond yes/no, choices, and scores, they can now point at objects, read values from documents, estimate numbers with a range, and pick every option that applies.

需要快速结构化决策而非生成文本时选 **d1 系列**:给它们一个情境(工单、发票、应用界面、照片、语音留言)和一组问题,单次前向全部作答、每个答案带校准概率。除了是非、选择与打分,它们现在还能**指向物体、读文档上的值、给出数值区间估计、多选全选**。

Between the two d1 models: d1-2B — choose it for text, pictures, and video. It replaces d1-3B with a third fewer parameters and scores higher on all four of our decision suites, for example, 75.5 against 64.0 on ImajevBench. d1-omni-2B — choose it when your inputs include audio. If you ask by voice instead of in writing, it keeps nearly all of its accuracy.

两个 d1 之间:**d1-2B**——文本、图像与视频场景;比 d1-3B 少三分之一参数,四套决策基准全部更高(如 ImajevBench 75.5 对 64.0)。**d1-omni-2B**——输入含音频时选它:用语音代替文字提问,它保留几乎全部精度。

Fine-tune LFM3 for your task · 为你的任务微调 LFM3

Every LFM3 model fine-tunes on a single GPU, so you can adapt it to your data, terminology, and deployment environment.(原文附完整示例:教 LFM3 学会「行动」——在几条带工具调用的示范轨迹上微调 LFM3-1.7B,微调后的模型在免费试用的推理后端上把一条模糊的产品需求变成多步计划并调用工具完成;另附各模型的 transformers 加载代码与模型卡链接。)

每个 LFM3 模型都能在单张 GPU 上微调,适配你的数据、术语与部署环境。(原文附完整示例:教 LFM3 学会「行动」——在几条带工具调用的示范轨迹上微调 LFM3-1.7B,微调后的模型在免费试用的推理后端上把一条模糊的产品需求变成多步计划并调用工具完成;另附各模型的 transformers 加载代码与模型卡链接。)

Get Started with LFM3 · 上手

Both LFM3 and its Base variant are open-weight and available on Hugging Face today, alongside the six specialized models. We can't wait to see what you build.

LFM3 与 Base 变体连同六个专用模型今天全部以开放权重上架 Hugging Face。等不及看你们造什么了。

回忆挑战

先不看答案自己回忆——讲不出来再回正文找。考的是关系,不是标签。

1LFM3 为什么用「一个骨干分叉六模型」而不是训练一个大的多模态通用模型?这个设计与「为专用而生」的定位如何互相成就?

因为目标场景是端侧专用:设备装不下大通用模型,而大多数应用只用一种模态(客服语音、文档视觉、工单决策)。单骨干分叉让六模型共享同一套预训练资产(22T token 的世界知识+256K 窗口),分叉后各自带专用编码器/后训练,单卡就能微调出自己的变体——「专用」不是砍功能,而是同一底座上按模态与任务收敛。维护上也只需顾一个骨干的改进,六模型集体受益。

2partial RoPE(只旋转一半维度)解决什么问题?为什么 SWA 层保留全 RoPE 而全局层只用一半?

RoPE 按频率把位置编码进每头维度:高频部分编码精细局部位置,低频部分编码远距离关系。全局层只旋转最高频的一半,另一半变成「纯内容匹配」通道——远距离内容相似但位置差异大时仍能对上,缓解长上下文里 RoPE 的位置干扰。SWA 层窗口只有 256 token、根本不存在远距离匹配问题,全 RoPE 的局部分辨力更划算——两种注意力层各取所需。

3head-wise 门控注意力「没贡献的头可以关闭」为什么顺带改善了量化?

量化误差对激活离群值(activation outliers)最敏感——个别异常大的激活值会把整张量量表撑宽、正常值的精度被挤掉。某些注意力头是离群值的稳定来源;sigmoid 门控给每个头输出乘一个可学习的 0~1 系数,离群头在不需要时被压向零,激活分布更紧致——4-bit 下文本模型能塞进约 1GB 与此直接相关。

4d1 决策模型新增的「指向物体/读文档值/数值区间」对决策模型的实用边界意味着什么?

它把决策模型从「分类器」扩成「结构化提取+判断」:以前只能 yes/no/选标签,现在能回答「缺陷在图中哪个位置」「发票金额是多少」「估计数量在什么范围」——这些正是业务工单分诊、票据处理、界面质检的真实问题形态。配合单次前向多问题(带校准概率),决策模型可以承接更多原来必须上生成式 LLM 的任务,成本与延迟低一个量级。