Front Matter
Front Matter

Problem-Solution Key

What do you need to build? Find the chapters, tools, and techniques that solve it.

You have a concrete problem to solve and need to know where to look. This table maps common NLP, ML, and AI engineering tasks to the specific chapters and framework tutorials where you will find the techniques, code, and architecture patterns to solve them. Each row includes a concrete example and recommended tools. Bookmark this page; you will come back to it often.

How to Use This Key

Scan the Task column for what you need to accomplish. The Example column gives a concrete scenario. The Tools column links to framework tutorials in the appendices. The Where to Look column links directly to relevant chapters. Most real-world projects combine multiple rows.

Text Understanding and Classification

Categorize, label, and understand text at the document or sentence level

TaskExampleToolsWhere to Look
Sentiment analysis "Is this product review positive, negative, or neutral?" HuggingFace, DSPy 11.1 Prompt Engineering, 12.1 LLM vs. Classical ML, 14.6 Fine-Tuning for Classification
Topic classification "Route this support ticket to billing, technical, or account team." HuggingFace, LangChain 11.1 Prompt Engineering, 12.3 Hybrid Pipeline Patterns, 14.6 Fine-Tuning for Classification
Intent detection "Does the user want to book a flight, check status, or cancel?" LangChain, LlamaIndex 21.4 Multi-Turn Dialogue, 11.1 Prompt Engineering
Spam and content moderation "Flag toxic comments before they appear on the forum." HuggingFace 32.1 LLM Security Threats, 12.1 LLM vs. Classical ML, 31.3 Production Guardrails
Zero-shot and few-shot classification "Classify emails into 50 categories with only 3 examples each." DSPy, HuggingFace 11.1 Prompt Engineering, 6.7 In-Context Learning Theory

Information Extraction

Pull structured data from unstructured text

TaskExampleToolsWhere to Look
Named entity recognition (NER) "Extract all company names, dates, and dollar amounts from SEC filings." HuggingFace 12.5 Structured Information Extraction, 1.1 Intro to NLP, 14.6 Sequence Tasks
Relation extraction "Which drug treats which disease in this clinical trial report?" HuggingFace, LangChain 12.5 Structured Extraction, 28.3 Healthcare AI
JSON/structured output extraction "Parse this invoice into {vendor, amount, date, line_items}." LangChain, Semantic Kernel 10.2 Structured Output, 12.5 Structured Extraction
Table and document parsing "Extract tables from scanned PDFs into a spreadsheet." LlamaIndex 27.3 Document Understanding & OCR, 19.5 Vision-Based Document Retrieval
Event extraction and timeline building "Build a timeline of key events from this legal case file." LangChain, LlamaIndex 12.5 Structured Extraction, 25.4 Research Agents

Text Generation and Summarization

Produce, condense, and transform text

TaskExampleToolsWhere to Look
Abstractive summarization "Summarize this 40-page research paper in 3 bullet points." LangChain, LlamaIndex 11.1 Prompt Engineering, 5.1 Decoding Strategies, 19.4 Document Chunking
Creative writing and content generation "Write marketing copy for a product launch in three different tones." LangChain 5.2 Stochastic Sampling, 21.2 Personas & Creative Writing, 11.1 Prompt Engineering
Code generation "Generate a Python REST API from this OpenAPI spec." LangChain, Semantic Kernel 25.1 Code Generation Agents, 28.1 Vibe-Coding, 10.2 Structured Output
Constrained and structured generation "Generate valid SQL queries that only reference columns in my schema." HuggingFace 5.3 Advanced Decoding & Structured Generation, 10.2 Structured Output
Translation "Translate user-facing UI strings into 12 languages." HuggingFace 7.4 Multilingual LLMs, 2.3 Multilingual Tokenization
Text-to-SQL "Let business users query our data warehouse in plain English." LangChain, LlamaIndex 20.4 Text-to-SQL in RAG, 23.1 Function Calling
Synthetic data generation "Generate 10,000 realistic customer support conversations for training." DSPy, HuggingFace Ch. 13 Synthetic Data, 14.2 Data Preparation

Search, Retrieval, and Question Answering

Find and surface information from large document collections

TaskExampleToolsWhere to Look
Semantic search "Find all contracts that mention early termination clauses." LlamaIndex, LangChain 19.1 Embedding Models, 19.3 Vector Databases, 1.3 Word Embeddings
RAG (retrieval-augmented generation) "Answer questions about our internal docs with source citations." LlamaIndex, LangChain 20.1 RAG Architecture, 19.4 Document Chunking, 29.3 RAG Evaluation
Knowledge base Q&A "Let employees ask HR questions and get policy-grounded answers." LlamaIndex, LangChain 20.1 RAG Architecture, 21.3 Memory & Context, 23.5 Agentic RAG
Hybrid search (keyword + semantic) "Combine BM25 and vector search for an e-commerce product catalog." LlamaIndex 19.2 Vector Index Algorithms, 20.1 RAG Architecture
Recommendation and personalization "Recommend articles based on what similar readers enjoyed." HuggingFace 28.4 Recommendation & Search, 19.1 Embedding Models

Conversational AI and Chatbots

Build interactive dialogue systems and assistants

TaskExampleToolsWhere to Look
Customer support chatbot "Handle L1 support tickets: answer FAQs, escalate complex issues." LangChain, LlamaIndex 21.1 Dialogue Architecture, 20.1 RAG, 23.1 Function Calling
Multi-turn conversation management "Maintain context across a 20-message travel booking dialogue." LangGraph, LangChain 21.3 Memory & Context, 21.4 Multi-Turn Dialogue
Voice assistant integration "Add speech-to-text and text-to-speech to our AI concierge." HuggingFace 21.5 Voice & Multimodal Interfaces, 27.2 Audio Generation
Persona and character design "Create a friendly, knowledgeable AI tutor that never gives answers directly." LangChain, Prompt Templates 21.2 Personas & Companionship, 11.1 Prompt Engineering

Agents and Automation

Build autonomous systems that reason, plan, and act

TaskExampleToolsWhere to Look
Tool-using agent "Let the AI call our APIs to look up orders, process refunds, update CRM." LangGraph, Semantic Kernel 22.1 Agent Paradigm, 23.1 Function Calling, 23.4 Custom Tool Design
Multi-agent orchestration "Coordinate a researcher, a coder, and a reviewer to produce a report." CrewAI, LangGraph 24.1 Framework Landscape, 24.2 Architecture Patterns, 24.4 Orchestration
Web browsing and scraping agent "Navigate competitor websites and extract pricing into a spreadsheet." LangGraph 25.2 Browser Agents, 25.3 Computer Use Agents
Deep research agent "Investigate a technical topic across 50 papers and produce a synthesis." LangGraph, CrewAI 25.4 Research Agents, 22.3 Planning & Reasoning
MCP and A2A integration "Connect our agent to Slack, GitHub, and Jira via standard protocols." LangChain, Semantic Kernel 23.2 Model Context Protocol, 23.3 Agent-to-Agent Protocol
Agent safety and sandboxing "Prevent our coding agent from accessing production databases." LangGraph 26.1 Agent Safety, 26.2 Sandboxed Execution

Training, Fine-Tuning, and Model Customization

Adapt, align, and build models for your domain, data, and quality bar

TaskExampleToolsWhere to Look
Full fine-tuning "Train a domain-specific model on 100K medical Q&A pairs." HuggingFace, W&B/MLflow 14.1 When to Fine-Tune, 14.3 Supervised Fine-Tuning
LoRA and parameter-efficient tuning "Adapt a 70B model on a single GPU using LoRA adapters." HuggingFace, W&B/MLflow 15.1 PEFT Methods, 15.3 Training Platforms
RLHF and preference alignment "Make our model refuse harmful requests while staying helpful." HuggingFace, W&B/MLflow 17.1 RLHF, 17.2 DPO, 17.3 Constitutional AI
Knowledge distillation "Compress GPT-4 quality into a 7B model for on-device deployment." HuggingFace 16.1 Distillation, 16.2 Model Merging
Pretraining from scratch "Build a 3B-parameter model on proprietary legal corpora." HuggingFace, Distributed ML 6.1 Language Model Pretraining, 6.4 Scaling Laws, 4.1 Transformer Architecture
Data curation and filtering "Clean, deduplicate, and quality-filter 500GB of web-scraped text." HuggingFace, Datasets 6.2 Data Pipelines, 14.2 Data Preparation, Ch. 13 Synthetic Data
Continual and incremental learning "Update our model monthly with new product data without catastrophic forgetting." HuggingFace, W&B/MLflow 14.4 Continual Fine-Tuning, 16.2 Model Merging
Embedding model training "Train a custom embedding model for our legal document corpus." HuggingFace 19.1 Embedding Models, 14.5 Representation Learning

Scaling, Infrastructure, and Optimization

Train faster, serve cheaper, and run models on any hardware

TaskExampleToolsWhere to Look
Distributed training "Train across 8 GPUs with data and tensor parallelism." Distributed ML, HuggingFace 6.3 Distributed Pretraining, 6.5 Parallelism Strategies
Quantization for deployment "Reduce model size from 32-bit to 4-bit for edge serving." HuggingFace, Inference Serving 9.1 Model Quantization, 9.5 Pruning & Sparsity
Inference serving at scale "Serve our model at 1,000 requests/second with p99 latency under 2s." Inference Serving 9.4 Serving Infrastructure, 31.1 Deployment Architecture, 9.2 KV-Cache & Batching
Hardware planning and GPU selection "Choose the right GPU cluster for fine-tuning a 70B model." Hardware Guide 9.3 Hardware Landscape, 33.5 Compute Planning
KV-cache optimization and speculative decoding "Cut time-to-first-token by 3x with speculative decoding." Inference Serving 9.2 KV-Cache & Batching, 8.3 Test-Time Compute
Model compression and pruning "Prune 40% of weights while keeping 95% of benchmark accuracy." HuggingFace 9.5 Pruning & Sparsity, 16.1 Distillation

Deployment and Operations

Ship, monitor, and maintain LLM systems in production

TaskExampleToolsWhere to Look
Production deployment architecture "Design the infra for a multi-tenant LLM service with rate limiting." Inference Serving, Env Setup 31.1 Deployment Architecture, 31.3 Scaling & Guardrails
Observability and monitoring "Set up tracing, cost tracking, and quality dashboards for our LLM app." W&B/MLflow 30.1 Observability & Tracing, 30.2 Drift Detection, 26.3 Agent Cost Control
Cost optimization "Cut our monthly LLM API spend from $40K to $15K without losing quality." W&B/MLflow 33.3 ROI & Value, 33.5 Compute Planning, 9.1 Quantization
A/B testing and experiment tracking "Compare two prompt variants on 10% of production traffic." W&B/MLflow, DSPy 29.2 Experimental Design, 31.2 CI/CD for LLMs
Build vs. buy decision "Should we fine-tune an open model or use GPT-4 via API?" 33.4 Vendor Evaluation, 33.6 Build vs. Buy & TCO, 12.1 LLM vs. Classical ML

Multimodal and Domain Applications

Work with images, audio, video, and industry-specific problems

TaskExampleToolsWhere to Look
Image understanding and VQA "Describe the contents of product photos for accessibility." HuggingFace 27.1 Vision-Language Models, 10.4 Multimodal APIs
Image generation "Generate product mockups from text descriptions." HuggingFace 27.1 Image Generation, 5.4 Diffusion Models
Financial NLP "Extract sentiment signals from earnings call transcripts for trading." LangChain 28.2 LLMs in Finance, 12.5 Structured Extraction
Healthcare and biomedical AI "Summarize patient records and flag medication interactions." HuggingFace 28.3 Healthcare AI, 32.3 Bias & Fairness
Legal document analysis "Review contracts for non-standard clauses and flag risks." LlamaIndex, LangChain 28.4 Legal AI, 20.1 RAG Architecture
Education and tutoring "Build a Socratic tutor that adapts to student knowledge level." LangChain 28.6 Education, 21.2 Personas
Cybersecurity applications "Analyze log files to detect anomalous access patterns." LangChain 28.5 Cybersecurity, 32.8 Red Teaming
Robotics and embodied AI "Use an LLM to plan robot navigation in a warehouse." HuggingFace 28.7 Robotics & Embodied AI, 22.3 Planning

Safety, Evaluation, and Governance

Test, secure, audit, and regulate AI systems

TaskExampleToolsWhere to Look
LLM evaluation and benchmarking "Compare three models on our domain-specific test set." W&B/MLflow, Benchmarks 29.1 Evaluation Fundamentals, 29.2 Experimental Design
Hallucination detection and mitigation "Ensure our medical chatbot never fabricates drug dosage information." LangChain, LlamaIndex 32.2 Hallucination & Reliability, 20.1 RAG (grounding), 29.3 RAG Evaluation
Prompt injection defense "Prevent users from jailbreaking our customer-facing assistant." 32.1 Security Threats, 26.1 Agent Safety
Bias and fairness auditing "Test our hiring assistant for demographic bias before launch." HuggingFace 32.3 Bias & Fairness, 32.5 Risk Governance
Regulatory compliance (EU AI Act) "Classify our AI system's risk level and prepare documentation." Model Cards 32.4 Regulation, 32.9 EU AI Act
Interpretability and model understanding "Explain why the model rejected this loan application." HuggingFace 18.1 Attention & Probing, 18.3 Practical Interpretability, 18.2 Mechanistic Interpretability
Red teaming "Systematically probe our model for harmful outputs before launch." 32.8 Red Teaming, 29.1 Evaluation Fundamentals