Example: why is lexical similarity not enough?
«اشتريت سيارة جديدة» ("I bought a new car") and «ابتعت مركبة حديثة» ("I purchased a modern vehicle"): no shared word, so Jaccard = 0, while the meaning is nearly identical. Conversely, «الكلب عض الرجل» ("the dog bit the man") and «الرجل عض الكلب» ("the man bit the dog"): Jaccard = 1 and the meaning differs. Contextual embeddings handle both cases better, but they are not immune to error in the second case.
Bi-encoder versus cross-encoder
- Bi-encoder: each text is encoded separately into a vector, then cosine is computed. It allows millions of texts to be indexed in advance.
- Cross-encoder: the two texts are fed into the model together, so each text sees the other in attention. It is more accurate but needs one pass per pair, so it is used only to rerank the top results.
