liveBook · Manning

Information retrieval

As explained in LLM Customization and Fine-Tuning

The process of finding the most relevant text chunks for a query based on embedding similarity.

Information retrieval finds text chunks relevant to a query by embedding both the query and chunks, then locating the closest points in vector space. Direct retrieval can compare a chunk matrix with the query vector and sort the top results. section 4.5.3

Choose similarity and embedding size with practical tradeoffs in mind:

  • Cosine similarity is the standard choice because it ignores vector magnitude; dot product suits encoders trained to produce unit-length vectors. section 4.5.3
  • Smaller embeddings are faster and cheaper to store; larger embeddings can preserve more semantic nuance. section 4.5.3

Semantic proximity

A paragraph about quarterly revenue may sit near one about Q3 earnings, while a paragraph about lunch options sits farther away. section 4.5.3

How LLM Customization and Fine-Tuning covers it

How deep it goes
Explains vector-space search, similarity metrics, top-k sorting, and embedding-size tradeoffs.
Examples
Uses revenue and earnings paragraphs as nearby matches, contrasted with an unrelated lunch paragraph.
What you can do after
Understand retrieval as finding the vector-space neighbors of an embedded query.
How it connects
Connects retrieval to vector embeddings, vector indexes, vector databases, and cosine similarity.

Also explained in

Compare how 17 books explain information retrieval →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of LLM Customization and Fine-Tuning. The section links point to the parts of the book it draws on.