Designing Large Language Model Applications

by Suhas Pai

Artificial Intelligence

Book Details

Book Title

Designing Large Language Model Applications

Author

Suhas Pai

Publisher

O'Reilly Media

Publication Date

2025

ISBN

9781098150501

Number of Pages

367

Language

English

Format

PDF

File Size

8.7MB

Subject

Artificial Intelligence

Table of Contents

  • Copyright
  • Table of Contents
  • Preface
  • Who This Book Is For
  • How This Book Is Structured
  • What This Book Is Not About
  • How to Read the Book
  • Conventions Used in This Book
  • Using Code Examples
  • O’Reilly Online Learning
  • How to Contact Us
  • Acknowledgments
  • Part I. LLM Ingredients
  • Chapter 1. Introduction
  • Defining LLMs
  • A Brief History of LLMs
  • The Impact of LLMs
  • LLM Usage in the Enterprise
  • Prompting
  • Accessing LLMs Through an API
  • Strengths and Limitations of LLMs
  • Building Your First Chatbot Prototype
  • From Prototype to Production
  • Summary
  • Chapter 2. Pre-Training Data
  • Ingredients of an LLM
  • Pre-Training Data Requirements
  • Popular Pre-Training Datasets
  • Synthetic Pre-Training Data
  • Training Data Preprocessing
  • Effect of Pre-Training Data on Downstream Tasks
  • Bias and Fairness Issues in Pre-Training Datasets
  • Summary
  • Chapter 3. Vocabulary and Tokenization
  • Vocabulary
  • Tokenizers
  • Tokenization Pipeline
  • Summary
  • Chapter 4. Architectures and Learning Objectives
  • Preliminaries
  • Representing Meaning
  • The Transformer Architecture
  • Loss Functions
  • Intrinsic Model Evaluation
  • Transformer Backbones
  • Learning Objectives
  • Pre-Training Models
  • Summary
  • Part II. Utilizing LLMs
  • Chapter 5. Adapting LLMs to Your Use Case
  • Chapter 6. Fine-Tuning
  • The Need for Fine-Tuning
  • Fine-Tuning: A Full Example
  • Fine-Tuning Datasets
  • Summary
  • Chapter 7. Advanced Fine-Tuning Techniques
  • Continual Pre-Training
  • Parameter-Efficient Fine-Tuning
  • Combining Multiple Models
  • Summary
  • Chapter 8. Alignment Training and Reasoning
  • Defining Alignment Training
  • Reinforcement Learning
  • Hallucinations
  • Mitigating Hallucinations
  • In-Context Hallucinations
  • Hallucinations Due to Irrelevant Information
  • Reasoning
  • Inducing Reasoning in LLMs
  • Summary
  • Chapter 9. Inference Optimization
  • LLM Inference Challenges
  • Inference Optimization Techniques
  • Techniques for Reducing Compute
  • Techniques for Accelerating Decoding
  • Techniques for Reducing Storage Needs
  • Summary
  • Part III. LLM Application Paradigms
  • Chapter 10. Interfacing LLMs with External Tools
  • LLM Interaction Paradigms
  • Defining Agents
  • Agentic Workflow
  • Components of an Agentic System
  • Summary
  • Chapter 11. Representation Learning and Embeddings
  • Introduction to Embeddings
  • Semantic Search
  • Similarity Measures
  • Fine-Tuning Embedding Models
  • Instruction Embeddings
  • Optimizing Embedding Size
  • Chunking
  • Vector Databases
  • Interpreting Embeddings
  • Summary
  • Chapter 12. Retrieval-Augmented Generation
  • The Need for RAG
  • Typical RAG Scenarios
  • Deciding When to Retrieve
  • The RAG Pipeline
  • RAG for Memory Management
  • RAG for Selecting In-Context Training Examples
  • RAG for Model Training
  • Limitations of RAG
  • RAG Versus Long Context
  • RAG Versus Fine-Tuning
  • Summary
  • Chapter 13. Design Patterns and System Architecture
  • Multi-LLM Architectures
  • Programming Paradigms
  • Summary
  • Index
  • About the Author
  • Colophon