Building LLMs for Production :Enhancing LLM Abilities And Reliability With Prompting, Fine-Tuning And RAG
Language: English Publication details: SPD 2024Description: 453ISBN:- 9789355427830
| Cover image | Item type | Current library | Home library | Collection | Shelving location | Call number | Materials specified | Vol info | URL | Copy number | Status | Notes | Date due | Barcode | Item holds | Item hold queue priority | Course reserves | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Books | Cummins College of Engineering for Women Pune | 006.35 BOU (Browse shelf(Opens below)) | Available (not for issue) | CCEP-BK-67514 |
Table of Contents
Acknowlegment...............................................................................................................................i
Preface ............................................................................................................................................ii
List of Abbreviations...................................................................................................................... v
Introduction .................................................................................................................................... 1
Chapter I: Introduction to LLMs.................................................................................................... 1
What are Large Language Models .................................................................................... 8
Key LLM Terminologies................................................................................................... 8
From Language Models to Large Language Models ...................................................... 19
History of NLP/LLMs..................................................................................................... 26
Recap............................................................................................................................... 30
Chapter II: LLM Architectures and Landscape............................................................................ 33
Understanding Transformer ............................................................................................ 34
Transformer Model’s Design Choices............................................................................. 42
The Generative Pre-trained Transformer (GPT) Architecture ........................................ 50
Introduction to Large Multimodal Models...................................................................... 54
Proprietary vs. Open Models vs. Open-Source Language Models.................................. 59
Applications and Use-Cases of LLMs............................................................................. 66
Recap............................................................................................................................... 70
Chapter III: LLMs in Practice ...................................................................................................... 73
Understanding Hallucinations and Bias .......................................................................... 74
Evaluating LLM Performance......................................................................................... 77
Controlling LLM Outputs ............................................................................................... 82
Pretraining and Fine-Tuning LLMs................................................................................. 84
Recap............................................................................................................................... 87
Chapter IV: Introduction to Prompting ........................................................................................ 89
Prompting and Prompt Engineering ................................................................................ 90
Prompting Techniques..................................................................................................... 92
Bad Prompt Practices .................................................................................................... 100
Tips for Effective Prompt Engineering ......................................................................... 103
Recap............................................................................................................................. 105
Chapter V: Introduction to LangChain & LlamaIndex .............................................................. 107
LangChain Introduction ................................................................................................ 108
LangChain Agents & Tools Overview.......................................................................... 110
Building LLM-Powered Applications with LangChain ................................................111
Building a News Articles Summarizer ..........................................................................115
LlamaIndex Introduction ...............................................................................................123
LangChain vs. LlamaIndex vs. OpenAI Assistants.......................................................132
Recap .............................................................................................................................134
Chapter VI: Prompting with LangChain.....................................................................................137
What are LangChain Prompt Templates........................................................................138
Few Shot Prompts and Example Selectors....................................................................145
Managing Outputs with Output Parsers.........................................................................152
Improving Our News Articles Summarizer...................................................................163
Creating Knowledge Graphs from Textual Data: Unveiling Hidden Connections .......172
Recap .............................................................................................................................177
Chapter VII: Retrieval-Augmented Generation..........................................................................179
Retrieval-Augmented Generation..................................................................................180
LangChain’s Indexes and Retrievers.............................................................................181
Data Ingestion................................................................................................................186
What are Text Splitters and Why They are Useful........................................................191
Tutorial: A Customer Support Q&A Chatbot................................................................201
Embeddings...................................................................................................................207
What are LangChain Chains..........................................................................................215
Tutorial: A YouTube Video Summarizer Using Whisper and LangChain....................222
Tutorial: A Voice Assistant for Your Knowledge Base ................................................232
Preventing Undesirable Outputs With the Self-Critique Chain.....................................245
Recap .............................................................................................................................254
Chapter VIII: Advanced RAG....................................................................................................257
Prompting vs. Fine-Tuning vs. RAG.............................................................................258
Advanced RAG Techniques with LlamaIndex..............................................................260
Production-Ready RAG Solutions with LlamaIndex ....................................................271
RAG - Metrics & Evaluation.........................................................................................276
LangChain’s LangSmith – Introduction ........................................................................294
Recap .............................................................................................................................299
Chapter IX: Agents.....................................................................................................................301
What are Agents: Large Models as Reasoning Engines................................................302
An Overview of AutoGPT and BabyAGI .....................................................................308
The Agent Simulation Projects in LangChain............................................................... 322
Tutorial: Building Agents for Analysis Report Creation............................................... 327
Tutorial: Query and Summarize a DB with LlamaIndex .............................................. 336
Building Agents with OpenAI Assistants...................................................................... 345
LangChain OpenGPT.................................................................................................... 355
Tutorial: Multimodal Financial Document Analysis from PDFs.................................. 357
Recap............................................................................................................................. 371
Chapter X: Fine-Tuning ............................................................................................................. 373
Techniques for Fine-Tuning LLMs............................................................................... 374
Low-Rank Adaptation (LoRA) ..................................................................................... 375
Practical Example: SFT with LoRA.............................................................................. 377
Using SFT for Financial Sentiment............................................................................... 388
Fine-Tuning a Cohere LLM with Medical Data............................................................ 396
Reinforcement Learning from Human Feedback .......................................................... 405
Tutorial: Improving LLMs with RLHF......................................................................... 409
Recap............................................................................................................................. 429
Chapter XI: Deployment ............................................................................................................ 431
Challenges of LLM Deployment................................................................................... 432
Model Quantization....................................................................................................... 433
Model Pruning............................................................................................................... 440
Deploying an LLM on a Cloud CPU............................................................................. 442
Recap............................................................................................................................. 448
Conclusion.................................................................................................................................. 451
There are no comments on this title.