[KongchangAI]
Concept双塔模型 / Bi-Encoder

Bi-Encoder

A retrieval architecture in which queries and documents are encoded independently into vectors. Document vectors can be precomputed and indexed, enabling efficient approximate nearest-neighbor search, but there is no interaction between query and document, which limits accuracy.

Core Facts

Timeline (last 90 days)

Oct 12

Cross-Encoder与Bi-Encoder有本质区别:Bi-Encoder独立编码查询和文档,速度快但精度有限,适合第一阶段召回;Cross-Encoder将[query, document]拼接输入Transformer,精度更高但无法预计算,适合对Top-20到Top-100的小候选集重排序。ms-marco-MiniLM-L-6-v2是6层结构,单次推理约几十毫秒,是生产环境中性价比高的重排序选择。

Unverified50%
Oct 4

A Cross-Encoder concatenates the query and candidate code snippet before feeding them together as input, achieving higher scoring accuracy than a Bi-Encoder but at greater computational cost, so it is typically used only to re-rank the Top-K candidates recalled by ANN.

Unverified50%
Aug 31

The bi-encoder model can pre-compute document vectors offline and build an index for fast retrieval, but the two texts cannot see each other during the encoding stage, making it impossible to model fine-grained word-level interactions.

Unverified50%

All Facts (6)

Source Articles