d1-2B 是一个面向文本、图像和视频的决策模型,基于 LFM3-VL-2B 构建。它通过单次前向传播即可返回校准后的答案,无需生成 token。
有关开源 d1 的更多信息,请查阅我们的发布博客。
LFM3 系列包含基座模型、文本模型、视觉模型、音频模型、全模态模型和决策模型。d1-2B 面向文本、图像和视频进行决策,d1-Omni-2B 则额外支持音频。
| 属性 | 规格 |
|---|---|
| 检查点 | 后训练决策模型,基于 LFM3-VL-2B 构建 |
| 参数量 | 1.92B |
| 架构 | LFM3 主干网络,24 层:13 层门控短卷积、5 层滑动窗口注意力、6 层全局注意力 |
| 上下文长度 | 128K tokens |
| 词表大小 | 128,000 tokens |
| 输入 | 一个状态(文本或 JSON)、图片或视频,以及任意数量的命名问题 |
| 输出 | 带概率的类型化答案,无生成 token |
| 支持语言 | 英语、阿拉伯语、中文、法语、德语、意大利语、日语、韩语、葡萄牙语、西班牙语、越南语、泰语、印尼语、印地语、俄语、波兰语 |
| 许可证 | LFM Open License v1.0 |
d1-2B 适用于任何需要决策的流水线环节:路由与分诊、审核与安全护栏、意图与主题分类、文档与表单信息提取、评判与重排序、视觉检测等。它不是聊天模型。
知识密集型问题更适合使用更大的模型,且当状态超过约 64K tokens 时,答案的可靠性会下降。对于计数和评分类任务,估算结果较为可靠;对于自由量估算,可靠性则稍低。
d1-2B 基于 Transformers 运行,使用其专属的模型代码。它通过单次前向传播即可读取答案,因此无需设置任何采样参数。
Transformers 快速上手:
pip install "transformers>=5.19" torch torchvision pillowimport torch
from transformers import AutoModel
device = "cuda" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu"
dtype = torch.float32 if device == "cpu" else torch.bfloat16
model = AutoModel.from_pretrained("LiquidAI/d1-2B", trust_remote_code=True, dtype=dtype).to(device)
# Several named questions over one state, answered in one pass
questions = {
"refund": {"type": "noul", "instructions": "Is the customer asking for a refund?"}, # yes/no: P(yes)
"team": {"type": "choice", "instructions": "Which team should handle this?",
"criteria": {"billing": "Charges, refunds, invoices", "shipping": "Delivery and parcels",
"technical": "App or site faults"}},
"topics": {"type": "choice", "multiple": True, "instructions": "Which topics does the message raise?",
"criteria": {"billing": "Payments and charges", "delivery": "Shipping and parcels",
"login": "Signing in to the account"}},
"urgency": {"type": "score", "instructions": "How urgent is this ticket?", "criteria": ["low", "medium", "high"]},
}
out = model.system_one("I was charged twice and my parcel never arrived. Please refund one charge.", questions)
a = out["answers"]
urgency = a["urgency"]["legend"][str(int(a["urgency"]["score"]))]
print(round(a["refund"]["noul"], 2), a["team"]["choice"], a["topics"]["choices"], urgency)
# 1.0 billing ['billing', 'delivery'] mediuminvoice = "ACME SA\nInvoice 2026-117\nTotal due: 1 234,50 EUR\nPay before 03/04/2026 (day/month/year)"
out = model.system_one(invoice, {
"payee": {"type": "text", "instructions": "Who issued the invoice?"},
"total": {"type": "number", "instructions": "How much is due?"},
"due": {"type": "date", "instructions": "By when must it be paid?"},
"vat": {"type": "number", "instructions": "How much VAT is charged?"},
})
a = out["answers"]
print(a["payee"]["text"], a["total"]["number"], a["due"]["date"], a["vat"]["number"])
# ACME SA 1234.5 2026-04-03 None统计数量、定位单个对象,或列出所有实例(max 最多读取该数量):
from transformers.image_utils import load_image
image = load_image("http://images.cocodataset.org/val2017/000000039769.jpg") # two cats on a sofa
out = model.system_one(None, {
"cats": {"type": "number", "instructions": "How many cats are there?", "range": [0, 10], "step": 1},
"remote": {"type": "box", "instructions": "Where is the remote control on the left?"},
"every_cat": {"type": "boxes", "instructions": "Every cat.", "max": 4},
}, media=[image])
a = out["answers"]
print(a["cats"]["number"], a["every_cat"]["count"], {k: round(v, 2) for k, v in a["remote"]["box"].items()})
# 2.0 2 {'top': 0.15, 'bottom': 0.24, 'left': 0.06, 'right': 0.28}tickets = ["Where is my parcel? It was due Monday.", "The app crashes when I open settings."]
for out in model.system_one_batch([(t, {"team": questions["team"]}) for t in tickets]):
print(out["answers"]["team"]["choice"])
# shipping
# technical| 调用 | 功能说明 |
|---|---|
system_one(state, questions, media=None) | 对单个状态一次性提出多个命名问题。media 可包含图片(PIL 图像或 {"type": "image", "path": ...})和视频帧序列({"type": "video", "video": [PIL images], "fps": 24})。 |
system_one_batch([(state, questions[, media]), ...]) | 单次调用批量处理多个请求。 |
set_size=(适用于以上任一调用) | 设定每次与状态一同读取的问题数量。默认值为模型的训练大小(16)。增大该值可提升速度,但会略微降低文本类问题的精度。 |
状态可以是字符串、任意 JSON 值,或者当媒体本身即为完整状态时的 None。每次调用返回 {"answers": {name: answer}, "usage": {"input_tokens": n, "output_tokens": 0}}。
type | 问题描述 | 返回字段 |
|---|---|---|
noul | 是或否 | noul:P(yes) |
choice | 从 criteria 指定的选项({name: description})中选择一个 | choice、confidence、probabilities |
choice 配合 multiple: true | 从 criteria 指定的选项中选多个 | choices、probabilities(每个选项各自的 P(yes)) |
score | 2 到 10 个有序等级,criteria 从最低到最高依次列出 | score(中位数等级)、confidence、probabilities、legend |
text、number、date | 从状态中读取一个值 | 对应类型的字段(数值附带 unit,日期为 ISO 8601 格式)、span、found |
number 配合 range | 估算值,步长为 step | number(中位数)、interval(p10, p90) |
box、boxes | 单张图片中的一个对象,或所有实例(最多 16 个,或由 max 指定上限) | box(top、bottom、left、right 为相对于图片的分数)、found、confidence,或 boxes 与 count |
当 found 低于 0.5 时,视为值或框不存在,此时返回 None。请在自身业务数据上校准任何决策阈值。
d1-2B 在我们内部的决策基准测试中,平均分和大多数单项基准测试中均领先于其他开源 d1 系列模型,以不到 d1-3B 三分之二的参数量超越后者。
| 基准测试 | d1 2B | d1-omni 600M | d1-Omni 2B | d1 3B |
|---|---|---|---|---|
| 决策 | ||||
| Decision Index 公开测试套件(v0.3) | 51.1 | 18.3 | 49.0 | 49.0 |
| DecisionBench (Hanno Labs) v1 | 77.1 | 58.7 | 76.4 | 73.1 |
| Decision Bench (decisionbench.ai) v4 | 85.2 | 57.9 | 84.7 | 83.6 |
| Fast Decisions | 58.8 | – | 56.8 | 59.3 |
| JevBench v1.4.1 | 77.9 | 58.0 | 75.3 | 76.2 |
| ImajevBench v2.0-lite | 75.5 | 21.7 | 72.3 | 64.0 |
| WorkflowEvals | 81.6 | 48.8 | 77.1 | 74.4 |
| Typed Decisions | 61.3 | 57.5 | 63.1 | 65.0 |
| 我们内部的测试板(涵盖一百余项公开与私有基准测试) | 63.2 | – | 61.8 | 58.8 |
| 视觉 | ||||
| AI2D | 76.7 | 37.1 | 71.5 | 79.9 |
| BLINK | 66.2 | 37.7 | 63.5 | 59.2 |
| CountQA | 51.4 | 26.8 | 45.4 | 42.6 |
| CV-Bench | 86.1 | 40.8 | 84.0 | 82.1 |
| ERQA | 45.8 | 27.3 | 42.5 | 39.8 |
| HallusionBench | 72.1 | 52.6 | 67.5 | 65.3 |
| MMBench | 87.9 | 54.2 | 85.2 | 84.9 |
| MME | 85.4 | 61.0 | 83.9 | 82.1 |
| MMMU-Pro | 26.4 | 11.9 | 24.1 | 18.5 |
| MMRB2 | 54.2 | 48.3 | 52.6 | 49.5 |
| MMStar | 67.5 | 31.9 | 61.3 | 59.9 |
| MMVP | 82.7 | 54.0 | 81.3 | 77.0 |
| NaturalBench | 81.5 | 58.8 | 80.0 | 79.8 |
| POPE | 88.7 | 82.7 | 89.9 | 88.6 |
| V* | 76.4 | 35.6 | 76.4 | 73.8 |
| VisualPuzzles | 29.9 | 26.2 | 26.9 | 29.5 |
| VisualWebBench | 96.2 | 14.9 | 88.6 | 71.4 |
| VL-RewardBench | 69.3 | 48.1 | 68.8 | 65.0 |
| 平均 | 70.2 | 42.8 | 67.7 | 65.4 |
四个模型均在相同的评测项上使用相同的评分标准,因此 d1-3B 和 d1-omni-600M 的部分数值与其各自模型卡片上的略有差异。d1-omni-600M 没有 Fast Decisions 和 board 分数。Average 是四个模型均有的公开基准的无权重平均值,因此不包含 Fast Decisions 和我们的 board。图像基准按每个基准选项上的决策来读取,每个基准最多 1,000 行。其中三个已饱和:POPE、MME 和 VisualWebBench。
在 H100 和 M5 Pro 上,使用 bf16 精度,model.compile() 后的热调用,取 20 次调用的中位数,三次运行中取最优。首次调用时编译大约需要一分钟。
| 硬件 | 单问题 | 3 个问题 | 5K token 状态 | 384 px 图片 | 单个框 | 多个框 | 单次调用 64 个状态 |
|---|---|---|---|---|---|---|---|
| NVIDIA H100 PCIe | 5.7 ms | 7.6 ms | 52 ms | 12.3 ms | 16.1 ms | 24.4 ms | 1,132 / s |
| AMD MI325X | 3.8 ms | 5.6 ms | 44 ms | 8.7 ms | 11.2 ms | 16.5 ms | 1,699 / s |
Apple M5 Pro (mps) | 18.6 ms | 26.5 ms | 753 ms | 45.2 ms | 53.5 ms | 100 ms | 109 / s |
@article{liquidAI2026opend1,
author = {Liquid AI},
title = {Open d1: Edge decision models for text, vision, and audio},
journal = {Liquid AI Blog},
year = {2026},
note = {https://www.liquid.ai/blog/open-d1},
}@article{liquidAI2026LFM3,
author = {Liquid AI},
title = {Introducing LFM3: Every Modality for Specialized Intelligence},
journal = {Liquid AI Blog},
year = {2026},
note = {https://www.liquid.ai/blog/lfm3},
}如有问题或反馈,请加入 Discord。如需自定义部署和微调支持,请联系 Liquid AI。