Technical

How Large Language Models Actually Decide What to Cite

By Kai, founder of Hirira, an AI Search Optimization (AEO/GEO) agency · Updated July 18, 2026 · 8 min read

Most AI answer engines that browse the web use a process called retrieval-augmented generation, or RAG: the model doesn't read your whole website, it retrieves small chunks of text (passages), scores each one for relevance to the question, re-ranks the best candidates, and only then writes an answer grounded in whichever passages survived that filtering. Understanding this pipeline explains almost every piece of AEO advice that otherwise sounds like folklore.

The four-stage pipeline

Chunking

Pages get broken into passages, small pieces of text, often a paragraph or a single Q&A entry, rather than evaluated as one whole document. A page with one dense, unbroken block of text produces one large, unfocused chunk. A page structured into clear, short sections produces many focused chunks, each with a better shot at matching a specific question.

Embedding and retrieval

Each chunk is converted into a numerical representation (an embedding) that captures its meaning, not just its exact words. The user's question is converted the same way, and the system retrieves the chunks whose embeddings are mathematically closest to the question's, meaning semantically similar, not just keyword-matching.

Re-ranking

The initial retrieval usually pulls back more candidates than needed. A separate re-ranking step scores those candidates more precisely against the specific question, using a more expensive but more accurate relevance check, and keeps only the top few.

Grounded generation

Only after re-ranking does the model write an answer, using the surviving passages as its evidence. Well-built systems explicitly instruct the model to stick to what those passages say, and to cite them, rather than relying on its own trained memory.

What this explains

Why AI citation is more sensitive to structure than to word count

Since re-ranking keeps only a handful of top passages before the model ever writes anything, a business's content is competing chunk-for-chunk against every other page's chunks for that specific question, not page-for-page. A short, sharply focused answer to one exact question can out-compete a much longer page that never states the answer as cleanly.

The honest limit

This is a general description of how most live-retrieval AI answer engines work, not a guarantee of any specific model's exact internals, which companies don't fully publish and which change over time. Treat it as a working model for making structural decisions, not as a literal spec of any one product.

Want your content restructured around how this actually works?

A Hirira Snapshot identifies which pages are producing weak, unfocused chunks and shows you how to fix them.

Request a Free Check

Related reading