proomt

Search

Search posts, papers, and topics

All posts

ByteByteGo12 min readintermediate

How LLMs Can Find a Needle in a Haystack

Summary

The post explains how retrieval‑augmented generation (RAG) lets LLM‑based assistants answer questions from private corpora. It covers chunking documents into passages, embedding queries and chunks, similarity metrics, and the trade‑offs of different vector indexes (flat, IVF, HNSW). The focus is on practical design choices rather than new research.

  • RAG requires a searchable representation of documents; chunk size balances precision vs. context.
  • Embedding models map queries and passages into a shared vector space; similarity metrics (cosine, dot‑product, Euclidean) must match the model’s training.
  • Exact flat search is O(n) and scales poorly; approximate indexes like IVF (inverted file) and HNSW (graph‑based) reduce work at the cost of recall.
  • Metadata (doc ID, version, effective date) is essential for grounding answers and handling stale policies.

LLM assistants are increasingly used for internal knowledge bases, where correctness and up‑to‑date citations are critical. Understanding retrieval pipelines and index trade‑offs helps engineers build reliable, cost‑effective systems.

6/10

Related reading

  1. Self-Evolving Search Index

    The paper introduces SELF-INDEX, a framework that lets a search index automatically diagnose retrieval failures, revise its keys, and validate changes, using a query simulator to anticipate future queries. Experiments show consistent gains across corpora and downstream LLM agents.

    Hugging Face Daily Papersarxiv.org1 minpaper
  2. Article: Your Next DSL Author Is a Language Model

    Typed Domain Grounding (TDG) embeds a DSL inside a mainstream language the LLM already knows (e.g., Kotlin) and uses the host compiler as an oracle. The author describes five building blocks—embedding, choosing a host language with high training‑data frequency, compiler‑driven type safety, a generate‑compile‑repair loop, and an on‑demand teaching tool—and shows measured results from kUML, a Kotli…

    InfoQinfoq.com18 min
  3. Glyph: A Multi-Strategy Agentic System for Column Description and Sensitivity-Ontology Tagging of Enterprise Data Catalogs

    Glyph is a production system that uses coordinated LLM agents and a fine‑tuned MiniLM encoder to automatically generate column descriptions and assign ontology tags in enterprise data catalogs. It combines code‑grounded retrieval, regex, and contrastive vector search, achieving NDCG@10 0.92 and MAP@100 0.90, and provides auditable provenance for each tag.

    Apple Machine Learning Researchapple.com1 minpaper
  4. BI-Agent and BI-Bench: Towards Automating End-to-End Business Intelligence

    The paper introduces BI‑Bench, a new benchmark of real‑world BI questions derived from public dashboards, and BI‑Agent, a tool‑augmented LLM system that breaks BI workflows into search, join, and transform subtasks. Baseline LLMs hit <50 % accuracy on BI‑Bench. By orchestrating specialized data‑management tools and post‑training the model with supervised fine‑tuning and reinforcement learning on…

    Hugging Face Daily Papersarxiv.org2 minpaper
  5. Do LLMs Have the Memory of a Goldfish?

    The article explains that LLMs don’t have persistent personal memory; all “memory” is supplied by the surrounding application via the context window, summaries, or external storage. It outlines the distinction between trained weights, working‑memory (token context), and persistent application memory, shows how to construct API calls to preserve conversation state, and discusses the cost and laten…

    ByteByteGobytebytego.com12 min