Ranked #15 of 25 on Saturday, November 21
Embeddings vs grep: rethinking dense retrieval's edge in code search
The paper introduces Repo-Premium, a repository-level code-search benchmark over 91 real repos in six languages with raw and curated queries and pull requests from 2022 to 2026. It finds that dense retrieval's advantage over BM25 comes largely from evaluation…
Ranked #15 of 25 on Saturday, November 21
Why it matters
Teams building code RAG or coding agents may get comparable results from grep plus LLM query expansion, or should fuse both, before investing in embedding infrastructure.
What happened
1 min readThe paper introduces Repo-Premium, a repository-level code-search benchmark over 91 real repos in six languages with raw and curated queries and pull requests from 2022 to 2026. It finds that dense retrieval's advantage over BM25 comes largely from evaluation choices (chunking files for BM25, counting edited tests as relevant) and from queries lacking the code's rare identifiers. Expanding queries with LLM-written identifiers (generate-then-grep) lets BM25 match dense retrieval in every Python pool.
Our analysis
This helps explain why agents like Claude Code and Codex do well with grep while benchmarks favor embeddings. A preregistered test pool and pull requests opened after the LLM's release are methodological strengths. The finding that no method predicts which retriever wins on a given query makes the fusion recommendation sensible. It is not yet peer reviewed, and full parity is reported only for Python pools.