# Many asymmetric embedding models need task prefixes on inputs, and skipping…

By Saurabh Kumar · TIL note, Jun 23, 2026 · Tags: search

Source: https://saurabh-kumar.com/til/1782216000/

Many asymmetric embedding models need task prefixes on inputs, and skipping them quietly degrades relevance. Each model has its own scheme: nomic (`search_query:`/`search_document:`), E5 (`query:`/`passage:`), BGE (a query instruction sentence, bare docs) — not interchangeable. OpenAI `text-embedding-3-*` and `all-MiniLM-L6-v2` need none. Whether you add the prefix depends on the serving layer, not the model: raw endpoints (llama.cpp `/v1/embeddings`, HF TEI, Ollama) send bare text so it's on you, while sentence-transformers (`prompt_name="query"`) and vendor SDKs inject it for you. Adding `search_query:`/`search_document:` to a nomic-v1.5 call lifted cosine similarity on a real query/doc pair from 0.54 to 0.60 at zero cost.
