Quick Start Guide to Large Language Models, 2nd Edition

Book description

The Practical, Step-by-Step Guide to Using LLMs at Scale in Projects and Products

Large Language Models (LLMs) like ChatGPT are demonstrating breathtaking capabilities, but their size and complexity have deterred many practitioners from applying them. In Quick Start Guide to Large Language Models, Second Edition, pioneering data scientist and AI entrepreneur Sinan Ozdemir clears away those obstacles and provides a guide to working with, integrating, and deploying LLMs to solve practical problems. Ozdemir brings together all you need to get started, even if you have no direct experience with LLMs: step-by-step instructions, best practices, real-world case studies, hands-on exercises, and more. Along the way, he shares insights into LLMs' inner workings to help you optimize model choice, data formats, parameters, and performance.

In the second edition, readers will find comprehensive updates and new chapters that reflect the latest advancements in the field. In addition to updating existing code to meet current versions and expectations, this edition significantly expands content on Retrieval-Augmented Generation and AI Agents and introduces new chapters dedicated to manual and automated methods for evaluating LLMs, as well as alignment principles, highlighting the differences and implications of instructional versus value alignment. Additionally, more examples of fine-tuning larger models are included, and all code and model references have been updated to include the latest package versions and AI models like Llama 3 and Mistral v0.2 ensuring the new edition remains at the cutting edge of LLM technology.

  • More content on RAG and AI Agents

  • A new chapter on evaluating LLMs both manually and automatically

  • A new chapter on alignment principles (instructional versus value alignment, etc.)

  • General updates so all code is more current (using the latest package versions + AI models, like Llama 3, etc.)

  • Includes more content on fine-tuning principles

...

Table of contents

  1. Cover Page
  2. Title Page
  3. Contents
  4. Table of Contents
  5. Preface
  6. Acknowledgments
  7. About the Author
  8. Part I: Introduction to Large Language Models
    1. 1. Overview of Large Language Models
      1. Introduction
      2. What Are Large Language Models?
      3. Popular Modern LLMs
      4. Domain-Specific LLMs
      5. Applications of LLMs
      6. Summary
    2. 2. Semantic Search with LLMs
      1. Introduction
      2. The Task
      3. Solution Overview
      4. The Components
      5. Putting It All Together
      6. The Cost of Closed-Source Components
      7. Summary
    3. 3. First Steps with Prompt Engineering
      1. Introduction
      2. Prompt Engineering
      3. Working with Prompts Across Models
      4. Summary
    4. 4. The AI Ecosystem—Putting the Pieces Together
      1. Introduction
      2. The Ever-Shifting Performance of Closed-Source AI
      3. AI Reasoning versus Thinking
      4. Case Study 1: Retrieval Augmented Generation (RAG)
      5. Case Study 2: Automated AI Agents
      6. Conclusion
  9. Part II: Getting the Most Out of LLMs
    1. 5. Optimizing LLMs with Customized Fine-Tuning
      1. Introduction
      2. Transfer Learning and Fine-Tuning: A Primer
      3. A Look at the OpenAI Fine-Tuning API
      4. Preparing Custom Examples with the OpenAI CLI
      5. Setting Up the OpenAI CLI
      6. Our First Fine-Tuned LLM
      7. Summary
    2. 6. Advanced Prompt Engineering
      1. Introduction
      2. Prompt Injection Attacks
      3. Input/Output Validation
      4. Batch Prompting
      5. Prompt Chaining
      6. Case Study – How Good at Math Is AI?
      7. Summary
    3. 7. Customizing Embeddings and Model Architectures
      1. Introduction
      2. Case Study: Building a Recommendation System
      3. Summary
    4. 8. AI Alignment: First Principles
      1. Introduction
      2. Aligned to Whom and to What End?
      3. Alignment as a Bias Mitigator
      4. The Pillars of Alignment
      5. Constitutional AI—A Step Toward Self-Alignment
      6. Conclusion
  10. Part III: Advanced LLM Usage
    1. 9. Moving Beyond Foundation Models
      1. Introduction
      2. Case Study: Visual Q/A
      3. Case Study: Reinforcement Learning from Feedback
      4. Summary
    2. 10. Advanced Open-Source LLM Fine-Tuning
      1. Introduction
      2. Example: Anime Genre Multilabel Classification with BERT
      3. Example: LaTeX Generation with GPT2
      4. Sinan’s Attempt at Wise Yet Engaging Responses: SAWYER
      5. Summary
    3. 11. Moving LLMs into Production
      1. Introduction
      2. Deploying Closed-Source LLMs to Production
      3. Deploying Open-Source LLMs to Production
      4. Summary
    4. 12. Evaluating LLMs
      1. Introduction
      2. Evaluating Generative Tasks
      3. Evaluating Understanding Tasks
      4. Conclusion
      5. Keep Going!

Product information

  • Title: Quick Start Guide to Large Language Models, 2nd Edition
  • Author(s): Sinan Ozdemir
  • Release date: October 2024
  • Publisher(s): Addison-Wesley Professional
  • ISBN: 9780135346570