text
𝗛𝗼𝘄 𝘁𝗼 𝗿𝗲-𝗿𝗮𝗻𝗸 𝘆𝗼𝘂𝗿 𝘀𝗻𝗶𝗽𝗽𝗲𝘁𝘀 𝗶𝗻 𝗥𝗔𝗚 ⇒ ColBERT, Rerankers, Cross-Encoders
𝗛𝗼𝘄 𝘁𝗼 𝗿𝗲-𝗿𝗮𝗻𝗸 𝘆𝗼𝘂𝗿 𝘀𝗻𝗶𝗽𝗽𝗲𝘁𝘀 𝗶𝗻 𝗥𝗔𝗚 ⇒ ColBERT, Rerankers, Cross-Encoders
new_line
new_line
text
Let’s say you’re doing RAG, and in an effort to improve performance, you try to rerank a few possible source snippets by their relevancy to a query.
Let’s say you’re doing RAG, and in an effort to improve performance, you try to rerank a few possible source snippets by their relevancy to a query.
new_line
new_line
text
How can you score similarity between your query and any source document? 🤔 📄 ↔️ 📑
How can you score similarity between your query and any source document? 🤔 📄 ↔️ 📑
new_line
new_line
text
𝟭. 𝗝𝘂𝘀𝘁 𝘂𝘀𝗲 𝗲𝗺𝗯𝗲𝗱𝗱𝗶𝗻𝗴𝘀 : 𝗡𝗼-𝗶𝗻𝘁𝗲𝗿𝗮𝗰𝘁𝗶𝗼𝗻 🏎️
𝟭. 𝗝𝘂𝘀𝘁 𝘂𝘀𝗲 𝗲𝗺𝗯𝗲𝗱𝗱𝗶𝗻𝗴𝘀 : 𝗡𝗼-𝗶𝗻𝘁𝗲𝗿𝗮𝗰𝘁𝗶𝗼𝗻 🏎️
new_line
new_line
text
This means that you encode each token from both the query and the doc as separate vectors, then average the tokens of each separately to get in total 2 vectors, then you compute similarity via cosine or something.
This means that you encode each token from both the query and the doc as separate vectors, then average the tokens of each separately to get in total 2 vectors, then you compute similarity via cosine or something.
new_line
text
➡️ Notable examples: Check the top of the MTEB leaderboard!
➡️ Notable examples: Check the top of the MTEB leaderboard!
new_line
new_line
text
𝟮. 𝗟𝗮𝘁𝗲-𝗶𝗻𝘁𝗲𝗿𝗮𝗰𝘁𝗶𝗼𝗻: 𝘁𝗵𝗶𝘀 𝗶𝘀 𝗖𝗼𝗹𝗕𝗘𝗥𝗧 🏃
𝟮. 𝗟𝗮𝘁𝗲-𝗶𝗻𝘁𝗲𝗿𝗮𝗰𝘁𝗶𝗼𝗻: 𝘁𝗵𝗶𝘀 𝗶𝘀 𝗖𝗼𝗹𝗕𝗘𝗥𝗧 🏃
new_line
new_line
text
These encode each token from both query and doc as separate vectors as before, but compare all together without previously averaging them and losing information.
These encode each token from both query and doc as separate vectors as before, but compare all together without previously averaging them and losing information.
new_line
new_line
text
This is more accurate than no-interaction but also slower because you have to compare n*m vectors instead of 2. At least you can store documents in memory. And ColBERT has some optimisations like pooling to be faster.
This is more accurate than no-interaction but also slower because you have to compare n*m vectors instead of 2. At least you can store documents in memory. And ColBERT has some optimisations like pooling to be faster.
new_line
new_line
text
➡️ Notable examples: ColBERTv2, mxbai-colbert-large-v1, jina-colbert-v2
➡️ Notable examples: ColBERTv2, mxbai-colbert-large-v1, jina-colbert-v2
new_line
new_line
text
𝟯. 𝗘𝗮𝗿𝗹𝘆 𝗶𝗻𝘁𝗲𝗿𝗮𝗰𝘁𝗶𝗼𝗻: 𝗖𝗿𝗼𝘀𝘀-𝗲𝗻𝗰𝗼𝗱𝗲𝗿𝘀 🏋️
𝟯. 𝗘𝗮𝗿𝗹𝘆 𝗶𝗻𝘁𝗲𝗿𝗮𝗰𝘁𝗶𝗼𝗻: 𝗖𝗿𝗼𝘀𝘀-𝗲𝗻𝗰𝗼𝗱𝗲𝗿𝘀 🏋️
new_line
new_line
text
Basically you run the concatenated query + document in a model to get a final score.
Basically you run the concatenated query + document in a model to get a final score.
new_line
new_line
text
This is the most accurate, but also the slowest since it gets really long when you have many docs to rerank! And you cannot pre-store embeddings.
This is the most accurate, but also the slowest since it gets really long when you have many docs to rerank! And you cannot pre-store embeddings.
new_line
new_line
text
➡️ Notable examples: MixedBread or Jina AI rerankers!
➡️ Notable examples: MixedBread or Jina AI rerankers!
new_line
new_line
text
🚀 So what you choose is a trade-off between speed and accuracy: I think ColBERT is often a really good choice!
🚀 So what you choose is a trade-off between speed and accuracy: I think ColBERT is often a really good choice!
new_line
new_line
text
Based on this great post by Jina AI 👉 
Based on this great post by Jina AI 👉 
link
https://jina.ai/news/what-is-colbert-and-late-interaction-and-why-they-matter
https://jina.ai/news/what-is-colbert-and-late-interaction-and-why-they-matter
𝗛𝗼𝘄 𝘁𝗼 𝗿𝗲-𝗿𝗮𝗻𝗸 𝘆𝗼𝘂𝗿 𝘀𝗻𝗶𝗽𝗽𝗲𝘁𝘀 𝗶𝗻 𝗥𝗔𝗚 ⇒ ColBERT, Rerankers, Cross-Encoders

Let’s say you’re doing RAG, and in an effort to improve performance, you try to rerank a few possible source snippets by their relevancy to a query.

How can you score similarity between your query and any source document? 🤔 📄 ↔️ 📑

𝟭. 𝗝𝘂𝘀𝘁 𝘂𝘀𝗲 𝗲𝗺𝗯𝗲𝗱𝗱𝗶𝗻𝗴𝘀 : 𝗡𝗼-𝗶𝗻𝘁𝗲𝗿𝗮𝗰𝘁𝗶𝗼𝗻 🏎️

This means that you encode each token from both the query and the doc as separate vectors, then average the tokens of each separately to get in total 2 vectors, then you compute similarity via cosine or something.
➡️ Notable examples: Check the top of the MTEB leaderboard!

𝟮. 𝗟𝗮𝘁𝗲-𝗶𝗻𝘁𝗲𝗿𝗮𝗰𝘁𝗶𝗼𝗻: 𝘁𝗵𝗶𝘀 𝗶𝘀 𝗖𝗼𝗹𝗕𝗘𝗥𝗧 🏃

These encode each token from both query and doc as separate vectors as before, but compare all together without previously averaging them and losing information.

This is more accurate than no-interaction but also slower because you have to compare n*m vectors instead of 2. At least you can store documents in memory. And ColBERT has some optimisations like pooling to be faster.

➡️ Notable examples: ColBERTv2, mxbai-colbert-large-v1, jina-colbert-v2

𝟯. 𝗘𝗮𝗿𝗹𝘆 𝗶𝗻𝘁𝗲𝗿𝗮𝗰𝘁𝗶𝗼𝗻: 𝗖𝗿𝗼𝘀𝘀-𝗲𝗻𝗰𝗼𝗱𝗲𝗿𝘀 🏋️

Basically you run the concatenated query + document in a model to get a final score.

This is the most accurate, but also the slowest since it gets really long when you have many docs to rerank! And you cannot pre-store embeddings.

➡️ Notable examples: MixedBread or Jina AI rerankers!

🚀 So what you choose is a trade-off between speed and accuracy: I think ColBERT is often a really good choice!

Based on this great post by Jina AI 👉 https://jina.ai/news/what-is-colbert-and-late-interaction-and-why-they-matter
👀
John6666 wsuff
❤️
FM-1976 roger-temp