Zenaique

A PM asks why the RAG assistant feels sluggish next to a plain chatbot: account for the extra latency and what you'd do

Short answer·Medium·4.0 · 0·~3 min·Asked atCohereHumanloopNetflix
Attempt it

A product manager notices that your RAG assistant feels noticeably slower to respond than a plain LLM chatbot, and asks you to explain where the extra time goes and how to make it feel faster. Break down the additional latency RAG introduces and list the mitigations you would apply without removing retrieval.

Free · 2 AI evals / day
TL;DR

RAG adds embedding, search, optional reranking, and a longer prompt (heavier prefill) before generation. Stream to hide it, then cache, parallelize, and trim top-k to shrink it — don't drop retrieval.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Imagine two waiters. One takes your order and walks straight to the kitchen. The other first runs to the library to look up the recipe, picks the best version, copies it out, and only then heads to the kitchen. The second waiter is your RAG assistant — those extra errands are real time. You can't skip the library trip (it's what keeps the food accurate), but you can have the waiter start bringing out dishes the moment they're ready instead of waiting for the whole meal, run the errands at the same time, and keep a copy of recipes they've looked up before. RAG, short for Retrieval-Augmented Generation, gets faster the same way.

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

"Why does our RAG assistant feel slower than ChatGPT?" is a question every PM eventually asks, and the wrong answer — "let's drop retrieval" — throws away the entire reason the system exists. The right answer starts by being precise about where the time actually goes, because RAG latency is not one number; it's a chain of stages a plain chatbot simply doesn't run.

The interview value here is twofold: can you decompose the pipeline into the stages that add wall-clock time, including the easy to miss prefill cost of a longer prompt, and can you separate making it feel faster from making it actually faster? This deep dive walks the latency anatomy, the perceived versus actual mitigation split, the tradeoffs each fix carries, and how to measure it so the PM sees real progress instead of a moved mean.

Where the extra time actually goes

A plain chatbot has a two-step critical path: receive the message, generate a reply. RAG inserts a pipeline in front of generation, and every stage is wall-clock the chatbot never spends.

Embed the query. The user's text is encoded into a vector — one model call, typically tens of milliseconds, or near-zero if the embedding is cached.

Search. The query vector is matched against the index via approximate nearest neighbor search, often alongside a BM25 keyword search. Usually fast, but the tail depends on index type, corpus size, and the recall target you've configured.

Rerank (optional). A cross-encoder reads the query with each candidate and rescores. This is a forward pass per candidate, so its cost scales with the candidate-pool size N.

Assemble the prompt. The retrieved chunks are concatenated into the context. This produces a much longer input than the bare question — and that sets up the cost the next section covers.

The prefill tax everyone forgets
Perceived vs actual: streaming first, then shrink the work
Measuring it and the tradeoffs that bite
Caching: the layer that pays back the most
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.

Real products, models, and research that use this idea.

  • Perplexity streams its answer while showing a retrieval/search indicator so the wait reads as progress, not lag
  • Pinecone and Qdrant expose ANN parameters (ef_search, nprobe) to trade a little recall for lower tail latency
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QIf streaming hides the wait, why bother shrinking the actual latency at all?
A

Streaming only hides the time before the first token; it doesn't cut cost, server load, or the tail. A high time to first token still feels laggy even when streaming, and total wall-clock drives throughput and bill. So you stream for perception and trim prefill, parallelize, and cache for cost and the p99 the streaming illusion can't paper over.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Reaching for 'just drop retrieval to make it fast' — which throws away the grounding and freshness RAG exists to provide, when most of the latency can be hidden with streaming instead.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • List the stages RAG adds before generation that a plain chatbot skips

  • Explain why the retrieved context makes prefill heavier and delays the first token

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
Which metric best measures whether a RAG answer is grounded in the retrieved context?
MCQ·Medium