liveBook · Manning

What you will learn in AI-Powered Search

by Trey Grainger, Doug Turnbull, Max Irwin
Foreword by Grant Ingersoll

Chapter by chapter

Chapter 1: Introducing AI-powered search

1.1 What is AI-powered search? · 1.2 Understanding user intent · 1.2.1 What is a search engine? · 1.2.2 What do recommendation engines offer? · 1.2.3 The personalization spectrum between search and recommendations · 1.2.4 Semantic search and knowledge graphs · 1.2.5 Understanding the dimensions of user intent · 1.3 How does AI-powered search work? · 1.3.1 The core search foundation · 1.3.2 Reflected intelligence through feedback loops · 1.3.3 Signals boosting, collaborative filtering, and learning to rank · 1.3.4 Content and domain intelligence · 1.3.5 Generative AI and retrieval augmented generation · 1.3.6 Curated vs. black-box AI · 1.3.7 Architecture for an AI-powered search engine · 1.4 Summary

What you learn in chapter 1 →

Chapter 2: Working with natural language

2.1 The myth of unstructured data · 2.1.1 Types of unstructured data · 2.1.2 Data types in traditional structured databases · 2.1.3 Joins, fuzzy joins, and entity resolution in unstructured data · 2.2 The structure of natural language · 2.3 Distributional semantics and embeddings · 2.4 Modeling domain-specific knowledge · 2.5 Challenges in natural language understanding for search · 2.5.1 The challenge of ambiguity (polysemy) · 2.5.2 The challenge of understanding context · 2.5.3 The challenge of personalization · 2.5.4 Challenges interpreting queries vs. documents · 2.5.5 Challenges interpreting query intent · 2.6 Content + signals: The fuel powering AI-powered search · 2.7 Summary

What you learn in chapter 2 →

Chapter 3: Ranking and content-based relevance

3.1 Scoring query and document vectors with cosine similarity · 3.1.1 Mapping text to vectors · 3.1.2 Calculating similarity between dense vector representations · 3.1.3 Calculating similarity between sparse vector representations · 3.1.4 Term frequency: Measuring how well documents match a term · 3.1.5 Inverse document frequency: Measuring the importance of a term in the query · 3.1.6 TF-IDF: A balanced weighting metric for text-based relevance · 3.2 Controlling the relevance calculation · 3.2.1 BM25: The industry standard default text-similarity algorithm · 3.2.2 Functions, functions, everywhere! · 3.2.3 Choosing multiplicative vs. additive boosting for relevance functions · 3.2.4 Differentiating matching (filtering) vs. ranking (scoring) of documents · 3.2.5 Logical matching: Weighting the relationships between terms in a query · 3.2.6 Separating concerns: Filtering vs. scoring · 3.3 Implementing user and domain-specific relevance ranking · 3.4 Summary

What you learn in chapter 3 →

Chapter 4: Crowdsourced relevance

4.1 Working with user signals · 4.1.1 Content vs. signals vs. models · 4.1.2 Setting up our product and signals datasets (RetroTech) · 4.1.3 Exploring the signals data · 4.1.4 Modeling users, sessions, and requests · 4.2 Introducing reflected intelligence · 4.2.1 What is reflected intelligence? · 4.2.2 Popularized relevance through signals boosting · 4.2.3 Personalized relevance through collaborative filtering · 4.2.4 Generalized relevance through learning to rank · 4.2.5 Other reflected intelligence models · 4.2.6 Crowdsourcing from content · 4.3 Summary

What you learn in chapter 4 →

Chapter 5: Knowledge graph learning

5.1 Working with knowledge graphs · 5.2 Using our search engine as a knowledge graph · 5.3 Automatically extracting knowledge graphs from content · 5.3.1 Extracting arbitrary relationships from text · 5.3.2 Extracting hyponyms and hypernyms from text · 5.4 Learning intent by traversing semantic knowledge graphs · 5.4.1 What is a semantic knowledge graph? · 5.4.2 Indexing the datasets · 5.4.3 Structure of an SKG · 5.4.4 Calculating edge weights to measure the relatedness of nodes · 5.4.5 Using SKGs for query expansion · 5.4.6 Using SKGs for content-based recommendations · 5.4.7 Using SKGs to model arbitrary relationships · 5.5 Using knowledge graphs for semantic search · 5.6 Summary

What you learn in chapter 5 →

Chapter 6: Using context to learn domain-specific language

6.1 Classifying query intent · 6.2 Query-sense disambiguation · 6.3 Learning related phrases from query signals · 6.3.1 Mining query logs for related queries · 6.3.2 Finding related queries through product interactions · 6.4 Phrase detection from user signals · 6.4.1 Treating queries as entities · 6.4.2 Extracting entities from more complex queries · 6.5 Misspellings and alternative representations · 6.5.1 Learning spelling corrections from documents · 6.5.2 Learning spelling corrections from user signals · 6.6 Pulling it all together · 6.7 Summary

What you learn in chapter 6 →

Chapter 7: Interpreting query intent through semantic search

7.1 The mechanics of query interpretation · 7.2 Indexing and searching on a local reviews dataset · 7.3 An end-to-end semantic search example · 7.4 Query interpretation pipelines · 7.4.1 Parsing a query for semantic search · 7.4.2 Enriching a query for semantic search · 7.4.3 Sparse lexical and expansion models · 7.4.4 Transforming a query for semantic search · 7.4.5 Searching with a semantically enhanced query · 7.5 Summary

What you learn in chapter 7 →

Chapter 8: Signals-boosting models

8.1 Basic signals boosting · 8.2 Normalizing signals · 8.3 Fighting signal spam · 8.3.1 Using signal spam to manipulate search results · 8.3.2 Combating signal spam through user-based filtering · 8.4 Combining multiple signal types · 8.5 Time decays and short-lived signals · 8.5.1 Handling time-insensitive signals · 8.5.2 Handling time-sensitive signals · 8.6 Index-time vs. query-time boosting: Balancing scale vs. flexibility · 8.6.1 Tradeoffs when using query-time boosting · 8.6.2 Implementing index-time signals boosting · 8.6.3 Tradeoffs when implementing index-time boosting · 8.7 Summary

What you learn in chapter 8 →

Chapter 9: Personalized search

9.1 Personalized search vs. recommendations · 9.1.1 Personalized queries · 9.1.2 User-guided recommendations · 9.2 Recommendation algorithm approaches · 9.2.1 Content-based recommenders · 9.2.2 Behavior-based recommenders · 9.2.3 Multimodal recommenders · 9.3 Implementing collaborative filtering · 9.3.1 Learning latent user and item features through matrix factorization · 9.3.2 Implementing collaborative filtering with Alternating Least Squares · 9.3.3 Personalizing search results with recommendation boosting · 9.4 Personalizing search using content-based embeddings · 9.4.1 Generating content-based latent features · 9.4.2 Implementing categorical guardrails for personalization · 9.4.3 Integrating embedding-based personalization into search results · 9.5 Challenges with personalizing search results · 9.6 Summary

What you learn in chapter 9 →

Chapter 10: Learning to rank for generalizable search relevance

10.1 What is LTR? · 10.1.1 Moving beyond manual relevance tuning · 10.1.2 Implementing LTR in the real world · 10.2 Step 1: A judgment list, starting with the training data · 10.3 Step 2: Feature logging and engineering · 10.3.1 Storing features in a modern search engine · 10.3.2 Logging features from our search engine corpus · 10.4 Step 3: Transforming LTR to a traditional machine learning problem · 10.4.1 SVMrank: Transforming ranking to binary classification · 10.4.2 Transforming our LTR training task to binary classification · 10.5 Step 4: Training (and testing!) the model · 10.5.1 Turning a separating hyperplane’s vector into a scoring function · 10.5.2 Taking the model for a test drive · 10.5.3 Validating the model · 10.6 Steps 5 and 6: Upload a model and search · 10.6.1 Deploying and using the LTR model · 10.6.2 A note on LTR performance · 10.7 Rinse and repeat · 10.8 Summary

What you learn in chapter 10 →

Chapter 11: Automating learning to rank with click models

11.1 (Re)creating judgment lists from signals · 11.1.1 Generating implicit, probabilistic judgments from signals · 11.1.2 Training an LTR model using probabilistic judgments · 11.1.3 Click-Through Rate: Your first click model · 11.1.4 Common biases in judgments · 11.2 Overcoming position bias · 11.2.1 Defining position bias · 11.2.2 Position bias in RetroTech data · 11.2.3 Simplified dynamic Bayesian network: A click model that overcomes position bias · 11.3 Handling confidence bias: Not upending your model due to a few lucky clicks · 11.3.1 The low-confidence problem in click data · 11.3.2 Using a beta prior to model confidence probabilistically · 11.4 Exploring your training data in an LTR system · 11.5 Summary

What you learn in chapter 11 →

Chapter 12: Overcoming ranking bias through active learning

12.1 Our automated LTR engine in a few lines of code · 12.1.1 Turning clicks into training data (chapter 11 in one line of code) · 12.1.2 Model training and evaluation in a few function calls · 12.2 A/B testing a new model · 12.2.1 Taking a better model out for a test drive · 12.2.2 Defining an A/B test in the context of automated LTR · 12.2.3 Graduating the better model into an A/B test · 12.2.4 When “good” models go bad: What we can learn from a failed A/B test · 12.3 Overcoming presentation bias: Knowing when to explore vs. exploit · 12.3.1 Presentation bias in the RetroTech training data · 12.3.2 Beyond the ad hoc: Thoughtfully exploring with a Gaussian process · 12.3.3 Examining the outcome of our explorations · 12.4 Exploit, explore, gather, rinse, repeat: A robust automated LTR loop · 12.5 Summary

What you learn in chapter 12 →

Chapter 13: Semantic search with dense vectors

13.1 Representation of meaning through embeddings · 13.2 Search using dense vectors · 13.2.1 A brief refresher on sparse vectors · 13.2.2 A conceptual dense vector search engine · 13.3 Getting text embeddings by using a Transformer encoder · 13.3.1 What is a Transformer? · 13.3.2 Openly available pretrained Transformer models · 13.4 Applying Transformers to search · 13.4.1 Using the Stack Exchange outdoors dataset · 13.4.2 Fine-tuning and the Semantic Text Similarity Benchmark · 13.4.3 Introducing the SBERT Transformer library · 13.5 Natural language autocomplete · 13.5.1 Getting noun and verb phrases for our nearest-neighbor vocabulary · 13.5.2 Getting embeddings · 13.5.3 ANN search · 13.5.4 ANN index implementation · 13.6 Semantic search with LLM embeddings · 13.6.1 Getting titles and their embeddings · 13.6.2 Creating and searching the nearest-neighbor index · 13.7 Quantization and representation learning for more efficient vector search · 13.7.1 Scalar quantization · 13.7.2 Binary quantization · 13.7.3 Product quantization · 13.7.4 Matryoshka Representation Learning · 13.7.5 Combining multiple vector search optimization approaches · 13.8 Cross-encoders vs. bi-encoders · 13.9 Summary

What you learn in chapter 13 →

Chapter 14: Question answering with a fine-tuned large language model

14.1 Question-answering overview · 14.1.1 How a question-answering model works · 14.1.2 The retriever-reader pattern · 14.2 Constructing a question-answering training dataset · 14.2.1 Gathering and cleaning a question-answering dataset · 14.2.2 Creating the silver set: Automatically labeling data from a pretrained model · 14.2.3 Human-in-the-loop training: Manually correcting the silver set to produce a golden set · 14.2.4 Formatting the golden set for training, testing, and validation · 14.3 Fine-tuning the question-answering model · 14.3.1 Tokenizing and shaping our labeled data · 14.3.2 Configuring the model trainer · 14.3.3 Performing training and evaluating loss · 14.3.4 Holdout validation and confirmation · 14.4 Building the reader with the new fine-tuned model · 14.5 Incorporating the retriever: Using the question-answering model with the search engine · 14.5.1 Step 1: Querying the retriever · 14.5.2 Step 2: Inferring answers from the reader model · 14.5.3 Step 3: Reranking the answers · 14.5.4 Step 4: Returning results by combining the retriever, reader, and reranker · 14.6 Summary

What you learn in chapter 14 →

Chapter 15: Foundation models and emerging search paradigms

15.1 Understanding foundation models · 15.1.1 What qualifies as a foundation model? · 15.1.2 Training vs. fine-tuning vs. prompting · 15.2 Generative search · 15.2.1 Retrieval augmented generation · 15.2.2 Results summarization using foundation models · 15.2.3 Data generation using foundation models · 15.2.4 Evaluating generative output · 15.2.5 Constructing your own metric · 15.2.6 Algorithmic prompt optimization · 15.3 Multimodal search · 15.3.1 Common modes for multimodal search · 15.3.2 Implementing multimodal search · 15.4 Other emerging AI-powered search paradigms · 15.4.1 Conversational and contextual search · 15.4.2 Agent-based search · 15.5 Hybrid search · 15.5.1 Reciprocal rank fusion · 15.5.2 Other hybrid search algorithms · 15.6 Convergence of contextual technologies · 15.7 All the above, please! · 15.8 Summary

What you learn in chapter 15 →

Concepts explained in this book

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.