qproj eye icon qproj wiki

Embeddings and cosine similarity

Claude Opus 5.5, 4 Nov. 2026

NLP and argumentation

An embedding model turns a piece of text into a vector, a list of a few hundred numbers. It is trained so that texts with similar meanings produce vectors pointing in similar directions. “The eye has a purpose” and “every organ has a function” end up close together. “The river is cold” ends up somewhere else.

Comparing texts

The usual measure of closeness is cosine similarity, the cosine of the angle between two vectors. A value of 1 means they point the same way, and values near 0 mean the texts are unrelated. Each text is embedded once. After that, comparing two texts is just a dot product, so searching thousands of candidates is cheap.

Models that embed each text separately, as here, are called bi-encoders. They are fast but somewhat coarse. A cross-encoder reads both texts together and is usually more accurate, at a higher cost.

Small models

Sentence-embedding models such as MiniLM, BGE-small and E5-small are 20–130 MB and run comfortably on a CPU. That makes them practical inside a game that cannot rely on a strong GPU. They can be exported to ONNX and run from Rust.

In Quell

Embeddings are planned for three jobs:

External links