Quick Start Guide to Large Language Models: Strategies and Best Practices for Using ChatGPT and Other LLMs

Book description

The advancement of Large Language Models (LLMs) has revolutionized the field of Natural Language Processing in recent years. Models like BERT, T5, and ChatGPT have demonstrated unprecedented performance on a wide range of NLP tasks, from text classification to machine translation. Despite their impressive performance, the use of LLMs remains challenging for many practitioners. The sheer size of these models, combined with the lack of understanding of their inner workings, has made it difficult for practitioners to effectively use and optimize these models for their specific needs.

Quick Start Guide to Large Language Models: Strategies and Best Practices for using ChatGPT and Other LLMs is a practical guide to the use of LLMs in NLP. It provides an overview of the key concepts and techniques used in LLMs and explains how these models work and how they can be used for various NLP tasks. The book also covers advanced topics, such as fine-tuning, alignment, and information retrieval while providing practical tips and tricks for training and optimizing LLMs for specific NLP tasks.

This work addresses a wide range of topics in the field of Large Language Models, including the basics of LLMs, launching an application with proprietary models, fine-tuning GPT3 with custom examples, prompt engineering, building a recommendation engine, combining Transformers, and deploying custom LLMs to the cloud. It offers an in-depth look at the various concepts, techniques, and tools used in the field of Large Language Models.

Related Learning:

Topics covered:

  • Coding with Large Language Models (LLMs)

  • Overview of using proprietary models

  • OpenAI, Embeddings, GPT3, and ChatGPT

  • Vector databases and building a neural/semantic information retrieval system

  • Fine-tuning GPT3 with custom examples

  • Prompt engineering with GPT3 and ChatGPT

  • Advanced prompt engineering techniques

  • Building a recommendation engine

  • Combining Transformers

  • Deploying custom LLMs to the cloud

Table of contents

  1. Cover Page
  2. About This eBook
  3. Halftitle Page
  4. Title Page
  5. Copyright Page
  6. Pearson’s Commitment to Diversity, Equity, and Inclusion
  7. Contents
  8. Foreword
  9. Preface
    1. Audience and Prerequisites
    2. How to Approach This Book
    3. Overview
    4. Unique Features
    5. Summary
  10. Acknowledgments
  11. About the Author
  12. I: Introduction to Large Language Models
    1. 1. Overview of Large Language Models
      1. What Are Large Language Models?
      2. Popular Modern LLMs
      3. Domain-Specific LLMs
      4. Applications of LLMs
      5. 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. Building a Q/A Bot with ChatGPT
      5. Summary
  13. II: Getting the Most Out of LLMs
    1. 4. 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. Case Study: Amazon Review Category Classification
      8. Summary
    2. 5. Advanced Prompt Engineering
      1. Introduction
      2. Prompt Injection Attacks
      3. Input/Output Validation
      4. Batch Prompting
      5. Prompt Chaining
      6. Chain-of-Thought Prompting
      7. Revisiting Few-Shot Learning
      8. Testing and Iterative Prompt Development
      9. Summary
    3. 6. Customizing Embeddings and Model Architectures
      1. Introduction
      2. Case Study: Building a Recommendation System
      3. Summary
  14. III: Advanced LLM Usage
    1. 7. Moving Beyond Foundation Models
      1. Introduction
      2. Case Study: Visual Q/A
      3. Case Study: Reinforcement Learning from Feedback
      4. Summary
    2. 8. 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. The Ever-Changing World of Fine-Tuning
      6. Summary
    3. 9. Moving LLMs into Production
      1. Introduction
      2. Deploying Closed-Source LLMs to Production
      3. Deploying Open-Source LLMs to Production
      4. Summary
  15. IV: Appendices
    1. A. LLM FAQs
      1. The LLM already knows about the domain I’m working in. Why should I add any grounding?
      2. I just want to deploy a closed-source API. What are the main things I need to look out for?
      3. I really want to deploy an open-source model. What are the main things I need to look out for?
      4. Creating and fine-tuning my own model architecture seems hard. What can I do to make it easier?
      5. I think my model is susceptible to prompt injections or going off task. How do I correct it?
      6. Why didn’t we talk about third-party LLM tools like LangChain?
      7. How do I deal with overfitting or underfitting in LLMs?
      8. How can I use LLMs for non-English languages? Are there any unique challenges?
      9. How can I implement real-time monitoring or logging to understand the performance of my deployed LLM better?
      10. What are some things we didn’t talk about in this book?
    2. B. LLM Glossary
      1. Transformer Architecture
      2. Attention Mechanism
      3. Large Language Model (LLM)
      4. Autoregressive Language Models
      5. Autoencoding Language Models
      6. Transfer Learning
      7. Prompt Engineering
      8. Alignment
      9. Reinforcement Learning from Human Feedback (RLHF)
      10. Reinforcement Learning from AI Feedback (RLAIF)
      11. Corpora
      12. Fine-Tuning
      13. Labeled Data
      14. Hyperparameters
      15. Learning Rate
      16. Batch Size
      17. Training Epochs
      18. Evaluation Metrics
      19. Incremental/Online Learning
      20. Overfitting
      21. Underfitting
    3. C. LLM Application Archetypes
      1. Chatbots/Virtual Assistants
      2. Fine-Tuning a Closed-Source LLM
      3. Fine-Tuning an Open-Source LLM
      4. Fine-Tuning a Bi-encoder to Learn New Embeddings
      5. Fine-Tuning an LLM for Following Instructions Using Both LM Training and Reinforcement Learning from Human / AI Feedback (RLHF & RLAIF)
      6. Open-Book Question-Answering
  16. Index
  17. Permissions and Image Credits
  18. Code Snippets

Product information

  • Title: Quick Start Guide to Large Language Models: Strategies and Best Practices for Using ChatGPT and Other LLMs
  • Author(s): Sinan Ozdemir
  • Release date: October 2023
  • Publisher(s): Addison-Wesley Professional
  • ISBN: 9780138199425