LiquidAI/LFM2.5-ColBERT-350M
摘要
LiquidAI 发布 LFM2.5-ColBERT-350M,这是一种后期交互多语言检索模型,同时还有一个密集双编码器变体,两者均基于 LFM2.5-350M-Base,支持 11 种语言,并设计为 RAG 管道的即插即用替代品。
查看缓存全文
缓存时间: 2026/06/22 13:32
LiquidAI/LFM2.5-ColBERT-350M · Hugging Face
来源:https://huggingface.co/LiquidAI/LFM2.5-ColBERT-350M Liquid AI
我们发布了两个新的同类最佳多语言检索模型:
- LFM2.5-Embedding-350M (https://huggingface.co/LiquidAI/LFM2.5-Embedding-350M) — 一个密集双编码器,每个文档一个向量。最小、最快的索引。
- LFM2.5-ColBERT-350M — 一个延迟交互模型。每个token一个向量,通过MaxSim匹配。索引大小更大,但精度更高、泛化能力更强。
两个模型均为350M参数,是LFM家族中首批双向成员,基于LFM2.5-350M-Base (https://huggingface.co/LiquidAI/LFM2.5-350M-Base) 构建。它们可以作为当前RAG管线的即插即用替代,目标是实现跨11种语言的快速、廉价且可靠的多语言/跨语言搜索。
更多关于双向架构和训练方法的详细信息,请查看我们的博客文章 (https://www.liquid.ai/blog/lfm2-5-retrievers)。
💻 演示:https://huggingface.co/spaces/LiquidAI/colbert-tool-selection

📄 模型详情
| 属性 | LFM2.5-ColBERT-350M | LFM2.5-Embedding-350M (https://huggingface.co/LiquidAI/LFM2.5-Embedding-350M) |
|---|---|---|
| 类型 | 延迟交互(每token向量) | 密集双编码器(单向量) |
| 总参数量 | ~353M | ~354M |
| 骨干网络 | LFM2.5-350M-Base (https://huggingface.co/LiquidAI/LFM2.5-350M-Base) + 双向补丁 | LFM2.5-350M-Base (https://huggingface.co/LiquidAI/LFM2.5-350M-Base) + 双向补丁 |
| 层数 | 17(10卷积 + 6注意力 + 1密集) | 17(10卷积 + 6注意力 + 1池化) |
| 词表大小 | 64,402 | 65,536 |
| 输出 | 每token 128维 | 1024维CLS向量 |
| 相似度 | MaxSim | 余弦 |
| 训练精度 | BF16 | BF16 |
| 许可证 | LFM开放许可证 v1.0 | LFM开放许可证 v1.0 |
文档长度: 512 tokens
查询长度: 32 tokens
支持语言: 英语、西班牙语、德语、法语、意大利语、葡萄牙语、阿拉伯语、瑞典语、挪威语、日语、韩语。
架构:
ColBERT(
(0): Transformer({'max_seq_length': 511, 'do_lower_case': False}) with Transformer model: Lfm2BidirectionalModel
(1): Dense({'in_features': 1024, 'out_features': 128, 'bias': False, 'activation_function': 'torch.nn.modules.linear.Identity'})
)
我们推荐将LFM2.5-Embedding-350M和LFM2.5-ColBERT-350M用于短上下文检索场景,例如:
- 电商:通过大规模语义搜索跨语言查找产品。
- FAQ与支持知识库:在面向客户的界面上可靠地检索正确答案。
- 设备端语义搜索:在消费级硬件上本地搜索文件、邮件和笔记。
- 企业知识助手:跨语言检索内部法律、财务和技术文档。
🏃 如何运行
Colab链接 (https://colab.research.google.com/drive/1uLswYrRTNw4P2P2qZ8JG-b8j-KDkQqwL?usp=sharing)
首先,安装PyLate和transformers库:
pip install -U pylate
检索
使用此模型配合PyLate进行文档索引和检索。索引使用FastPLAID (https://github.com/lightonai/fast-plaid) 实现高效相似性搜索。
索引文档
加载LFM2.5-ColBERT-350M并初始化PLAID索引,然后编码并索引你的文档:
from pylate import indexes, models, retrieve
# 步骤1:加载ColBERT模型(trust_remote_code应用双向补丁)
model = models.ColBERT(
model_name_or_path="LiquidAI/LFM2.5-ColBERT-350M",
trust_remote_code=True,
)
model.tokenizer.pad_token = model.tokenizer.eos_token
# 步骤2:初始化PLAID索引
index = indexes.PLAID(
index_folder="pylate-index",
index_name="index",
override=True, # 覆盖现有索引(如有)
)
# 步骤3:编码文档
documents_ids = ["1", "2", "3"]
documents = ["document 1 text", "document 2 text", "document 3 text"]
documents_embeddings = model.encode(
documents,
batch_size=32,
is_query=False, # 确保设为False以表示这些是文档
show_progress_bar=True,
)
# 步骤4:通过提供嵌入和对应ID将文档嵌入添加到索引
index.add_documents(
documents_ids=documents_ids,
documents_embeddings=documents_embeddings,
)
注意:不必每次都重新创建索引并编码文档。创建索引并添加文档后,可以在以后加载并使用该索引:
# 加载索引,只需使用正确的文件夹/名称实例化,不要覆盖
index = indexes.PLAID(
index_folder="pylate-index",
index_name="index",
)
为查询检索top-k文档
文档索引后,你可以为给定的一组查询检索最相关的top-k个文档。为此,使用要搜索的索引初始化ColBERT检索器,编码查询,然后检索top-k个文档以获取最佳匹配的ID和相关性分数:
# 步骤1:初始化ColBERT检索器
retriever = retrieve.ColBERT(index=index)
# 步骤2:编码查询
queries_embeddings = model.encode(
["query for document 3", "query for document 1"],
batch_size=32,
is_query=True, # 确保设为True以表示这些是查询
show_progress_bar=True,
)
# 步骤3:检索top-k文档
scores = retriever.retrieve(
queries_embeddings=queries_embeddings,
k=10, # 为每个查询检索前10个匹配项
)
重排序
如果你只想使用LFM2.5-ColBERT-350M在第一阶段检索管线上进行重排序而不构建索引,只需使用rank函数并传递查询和文档进行重排序:
from pylate import rank, models
queries = [
"query A",
"query B",
]
documents = [
["document A", "document B"],
["document 1", "document C", "document B"],
]
documents_ids = [
[1, 2],
[1, 3, 2],
]
model = models.ColBERT(
model_name_or_path="LiquidAI/LFM2.5-ColBERT-350M",
trust_remote_code=True,
)
queries_embeddings = model.encode(
queries,
is_query=True,
)
documents_embeddings = model.encode(
documents,
is_query=False,
)
reranked_documents = rank.rerank(
documents_ids=documents_ids,
queries_embeddings=queries_embeddings,
documents_embeddings=documents_embeddings,
)
📈 性能
我们突出显示(粗体)每种语言的最佳双编码器和最佳延迟检索器。
NanoBEIR多语言扩展 — NDCG@10
LiquidAI/nanobeir-multilingual-extended (https://huggingface.co/datasets/LiquidAI/nanobeir-multilingual-extended)。多语言检索能力。
| 模型 | 类型 | AVG | ar | de | en | es | fr | it | ja | ko | no | pt | sv |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| LiquidAI/LFM2.5-ColBERT-350M | late | 0.605 | 0.551 | 0.606 | 0.687 | 0.607 | 0.622 | 0.606 | 0.614 | 0.590 | 0.570 | 0.613 | 0.586 |
| LiquidAI/LFM2.5-Embedding-350M | dense | 0.577 | 0.529 | 0.581 | 0.644 | 0.581 | 0.592 | 0.583 | 0.575 | 0.563 | 0.557 | 0.581 | 0.566 |
| Qwen/Qwen3-Embedding-0.6B | dense | 0.556 | 0.514 | 0.560 | 0.649 | 0.568 | 0.565 | 0.565 | 0.551 | 0.530 | 0.516 | 0.571 | 0.525 |
| LiquidAI/LFM2-ColBERT-350M | late | 0.540 | 0.491 | 0.563 | 0.661 | 0.563 | 0.564 | 0.543 | 0.557 | 0.527 | 0.449 | 0.547 | 0.480 |
| Alibaba-NLP/gte-multilingual-base | dense | 0.528 | 0.477 | 0.523 | 0.624 | 0.537 | 0.542 | 0.528 | 0.511 | 0.494 | 0.516 | 0.534 | 0.526 |
| lightonai/GTE-ModernColBERT-v1 | late | 0.489 | 0.309 | 0.499 | 0.680 | 0.525 | 0.546 | 0.516 | 0.459 | 0.368 | 0.465 | 0.530 | 0.483 |
| lightonai/LateOn | late | 0.484 | 0.307 | 0.505 | 0.690 | 0.531 | 0.537 | 0.514 | 0.442 | 0.326 | 0.465 | 0.533 | 0.475 |
| lightonai/DenseOn | dense | 0.432 | 0.178 | 0.474 | 0.676 | 0.496 | 0.520 | 0.487 | 0.378 | 0.197 | 0.422 | 0.493 | 0.433 |
| Alibaba-NLP/gte-modernbert-base | dense | 0.383 | 0.112 | 0.449 | 0.666 | 0.448 | 0.475 | 0.408 | 0.275 | 0.180 | 0.376 | 0.431 | 0.391 |
| BAAI/bge-large-en-v1.5 | dense | 0.359 | 0.059 | 0.419 | 0.642 | 0.445 | 0.475 | 0.431 | 0.198 | 0.132 | 0.358 | 0.434 | 0.353 |
MKQA-11 — Recall@20
MKQA (https://github.com/apple/ml-mkqa)。跨语言能力(我们目标11种语言的子集)。
| 模型 | 类型 | AVG | ar | de | en | es | fr | it | ja | ko | no | pt | sv |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| LiquidAI/LFM2.5-ColBERT-350M | late | 0.694 | 0.608 | 0.709 | 0.748 | 0.711 | 0.715 | 0.707 | 0.703 | 0.640 | 0.689 | 0.703 | 0.700 |
| LiquidAI/LFM2.5-Embedding-350M | dense | 0.691 | 0.610 | 0.709 | 0.738 | 0.708 | 0.715 | 0.703 | 0.685 | 0.630 | 0.691 | 0.710 | 0.708 |
| Alibaba-NLP/gte-multilingual-base | dense | 0.675 | 0.567 | 0.692 | 0.741 | 0.705 | 0.703 | 0.697 | 0.655 | 0.563 | 0.698 | 0.700 | 0.699 |
| LiquidAI/LFM2-ColBERT-350M | late | 0.646 | 0.554 | 0.696 | 0.754 | 0.711 | 0.710 | 0.667 | 0.658 | 0.558 | 0.541 | 0.669 | 0.589 |
| Qwen/Qwen3-Embedding-0.6B | dense | 0.638 | 0.520 | 0.671 | 0.723 | 0.678 | 0.672 | 0.671 | 0.635 | 0.543 | 0.620 | 0.667 | 0.620 |
| lightonai/GTE-ModernColBERT-v1 | late | 0.459 | 0.092 | 0.532 | 0.754 | 0.552 | 0.615 | 0.510 | 0.275 | 0.166 | 0.503 | 0.524 | 0.524 |
| lightonai/LateOn | late | 0.454 | 0.157 | 0.492 | 0.755 | 0.537 | 0.577 | 0.481 | 0.316 | 0.209 | 0.472 | 0.502 | 0.501 |
| lightonai/DenseOn | dense | 0.435 | 0.165 | 0.482 | 0.751 | 0.491 | 0.553 | 0.457 | 0.325 | 0.222 | 0.438 | 0.443 | 0.453 |
| BAAI/bge-large-en-v1.5 | dense | 0.413 | 0.133 | 0.471 | 0.748 | 0.450 | 0.531 | 0.461 | 0.208 | 0.172 | 0.456 | 0.443 | 0.467 |
| Alibaba-NLP/gte-modernbert-base | dense | 0.295 | 0.060 | 0.333 | 0.736 | 0.273 | 0.417 | 0.291 | 0.100 | 0.052 | 0.332 | 0.326 | 0.330 |
推理速度 — llama.cpp
在MacBook Pro M4 Max上通过llama.cpp使用fp16的端到端延迟,测量32-token查询和256-token文档。Docs cached表示文档嵌入已预先计算并从索引中查找。
| 模型 | 阶段 | 文档缓存 | p50 | p95 |
|---|---|---|---|---|
| LFM2.5-Embedding-350M | 查询嵌入 | 是 | 7.3 ms | 9.6 ms |
| LFM2.5-ColBERT-350M | 查询嵌入 | 是 | 8.1 ms | 8.5 ms |
| LFM2.5-ColBERT-350M | 查询嵌入 + MaxSim | 是 | 8.2 ms | 15.2 ms |
| LFM2.5-ColBERT-350M | 查询嵌入 + 文档嵌入 + MaxSim | 否 | 34.3 ms | 36.3 ms |
两个模型LiquidAI/LFM2.5-ColBERT-350M-GGUF (https://huggingface.co/LiquidAI/LFM2.5-ColBERT-350M-GGUF/) 和 LiquidAI/LFM2.5-Embedding-350M-GGUF (https://huggingface.co/LiquidAI/LFM2.5-Embedding-350M-GGUF/) 已在Hugging Face上以不同的量化方案提供,适用于llama.cpp。
推理速度 — 企业级GPU
对于大规模生产级企业部署,我们还使用内部GPU堆栈进行实验,以在高负载下提供极低延迟的服务。我们观察到延迟低至1毫秒。

| 工作负载 | 设置 | p50 | p95 | p99 |
|---|---|---|---|---|
| LFM2.5-Embedding-350M | 查询嵌入 | 1.5 ms | 1.6 ms | 1.7 ms |
| LFM2.5-ColBERT-350M | 查询嵌入 | 1.3 ms | 1.4 ms | 1.5 ms |
| LFM2.5-ColBERT-350M | 查询嵌入 + MaxSim | 2.5 ms | 2.7 ms | 2.8 ms |
| LFM2.5-ColBERT-350M | 查询嵌入 + 文档嵌入 + MaxSim | 22.8 ms | 24.1 ms | 26.4 ms |
📬 联系我们
- 有问题或想联系?加入我们的Discord社区 (https://discord.com/invite/liquid-ai)。
- 如果您对边缘部署的定制解决方案感兴趣,请联系我们的销售团队 (https://www.liquid.ai/contact)。
引用
@article{liquidai2025lfm2,
title={LFM2 Technical Report},
author={Liquid AI},
journal={arXiv preprint arXiv:2511.23404},
year={2025}
}
@misc{PyLate,
title={PyLate: Flexible Training and Retrieval for Late Interaction Models},
author={Chaffin, Antoine and Sourty, Raphaël},
url={https://github.com/lightonai/pylate},
year={2024}
}
相似文章
LiquidAI/LFM2.5-Embedding-350M
Liquid AI 发布了 LFM2.5-Embedding-350M,这是一种密集双编码器,用于多语言检索,支持11种语言,可作为 RAG 流水线的直接替代方案。
@liquidai: 介绍 LFM2.5-Embedding-350M 和 LFM2.5-ColBERT-350M:两款为超快且精准的多语言检索模型
Liquid AI 推出 LFM2.5-Embedding-350M 和 LFM2.5-ColBERT-350M,这两款多语言检索模型经过优化,可在11种语言中实现快速准确的搜索,延迟低至1.5毫秒。
LiquidAI/LFM2.5-Encoder-350M
Liquid AI releases LFM2.5-Encoder-350M, a multilingual bidirectional encoder built on the LFM2 architecture, offering strong quality for its size, 8k context, and efficient on-device performance across 15 languages.
LiquidAI/LFM2.5-VL-3B · Hugging Face
LiquidAI releases LFM2.5-VL-3B, a 3B multimodal model for on-device deployment with improved OCR, grounding, and efficient inference, available in multiple formats including GGUF, ONNX, and MLX.
@maximelabonne: 我们刚刚发布了两个新的编码器模型(MLM)在2026年。它们非常快,易于训练,并且多语言能力强。试试…
Liquid AI发布了两个新的编码器模型,LFM2.5-Encoder-230M和LFM2.5-Encoder-350M。这些模型快速、易于训练且多语言能力强。速度基准测试显示,与ModernBERT-base相比,CPU性能提升了3.7倍以上。