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
Rerankers typically adopt a Cross-Encoder architecture, in contrast to the Bi-Encoder architecture used in vector retrieval.
Reranking uses a Cross-Encoder model to re-score and re-rank the candidate chunks recalled by Top-K, with precision far higher than that of a Bi-Encoder.
Timeline (last 90 days)
Cross-Encoder与Bi-Encoder有本质区别:Bi-Encoder独立编码查询和文档,速度快但精度有限,适合第一阶段召回;Cross-Encoder将[query, document]拼接输入Transformer,精度更高但无法预计算,适合对Top-20到Top-100的小候选集重排序。ms-marco-MiniLM-L-6-v2是6层结构,单次推理约几十毫秒,是生产环境中性价比高的重排序选择。
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.
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.
All Facts (6)
Rerankers typically adopt a Cross-Encoder architecture, in contrast to the Bi-Encoder architecture used in vector retrieval.
75%VerifiedReranking uses a Cross-Encoder model to re-score and re-rank the candidate chunks recalled by Top-K, with precision far higher than that of a Bi-Encoder.
65%UnverifiedBi-Encoder将问题和文档分别独立编码成向量再计算相似度,Cross-Encoder将问题和候选文档拼接后一起输入模型通过注意力机制充分交互
95%UnverifiedCross-Encoder与Bi-Encoder有本质区别:Bi-Encoder独立编码查询和文档,速度快但精度有限,适合第一阶段召回;Cross-Encoder将[query, document]拼接输入Transformer,精度更高但无法预计算,适合对Top-20到Top-100的小候选集重排序。ms-marco-MiniLM-L-6-v2是6层结构,单次推理约几十毫秒,是生产环境中性价比高的重排序选择。
50%UnverifiedA 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.
50%UnverifiedThe 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.
50%