Grep vs vector search. #ai #tech #techtech

Grep vs vector search. #ai #tech #techtech

Grep vs. Modern AI Search: A Surprising Comparison

Introduction to Grep and Vector Search

  • The discussion begins with the introduction of grep, a command line tool from 1974, likened to a "control F" function.
  • Modern AI startups are promoting vector search technologies, emphasizing concepts like embeddings and semantic search.

PwC Study Overview

  • Researchers at PwC conducted a study comparing grep and vector search across five AI models and four agents.
  • The study involved analyzing 116 questions based on months of conversation history, focusing on specific queries about past mentions (e.g., restaurants or travel dates).

Results of the Comparison

  • Surprisingly, grep outperformed vector search in every model tested, including Claude, GPT, and Gemini.
  • The success of grep is attributed to the nature of the questions asked; they had literal answers that were directly retrievable.

Limitations of Vector Search

  • Vector search aims for conceptual closeness but can yield incorrect answers when exactness is required.
  • Grep's strength lies in its ability to find exact matches or nothing at all, which was advantageous in this specific context.

Critique of the Study's Design

  • The paper's design favored grep since all questions had clear literal answers within the data set.
  • In scenarios where nuanced language is used (e.g., synonyms for stress), grep would fail while embedding techniques would excel.

Conclusion on Use Cases

  • Despite its performance in this study, grep is deemed inadequate outside this specific use case; it lacks versatility compared to modern approaches like keyword search with BM25.
  • There’s skepticism regarding PwC's rationale for favoring grep in their analysis.