LEVEL 02 / 05

Embeddings & retrieval

Search embeds your query and your documents into vectors, then returns the ones whose vectors sit nearest the query. Similarity stands in for relevance — so if you can move a passage next to the query in that space, you own the top result.

The tokenizer decided which symbols the model sees. Embeddings decide which symbols count as "similar" — and similarity, it turns out, is a number you can aim at directly.

Mission · hijack the #1 result

Build a passage from the word bank that ranks #1 for the query and reaches cosine ≥ 0.60 — without being about the query's actual answer.

query: ""your passage similarity: 0.000

What just happened: a passage about nothing relevant out-ranked every passage that actually answers the query — because the search system was only ever comparing vectors, never meaning.

Why it works: cosine similarity is a proxy an attacker with the embeddings can drive. Your passage isn't about the query — it just sits next to it. Real corpus-poisoning (Zhong et al. 2023) does exactly this with gradients (HotFlip). Fix: never treat retrieval rank as trust. Build it →