Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Generative AI with LangChain

You're reading from  Generative AI with LangChain

Product type Book
Published in Dec 2023
Publisher Packt
ISBN-13 9781835083468
Pages 360 pages
Edition 1st Edition
Languages
Author (1):
Ben Auffarth Ben Auffarth
Profile icon Ben Auffarth

Table of Contents (13) Chapters

Preface What Is Generative AI? LangChain for LLM Apps Getting Started with LangChain Building Capable Assistants Building a Chatbot like ChatGPT Developing Software with Generative AI LLMs for Data Science Customizing LLMs and Their Output Generative AI in Production The Future of Generative Models Other Books You May Enjoy
Index

Prompt engineering

Prompts are the instructions and examples we provide to language models to steer their behavior. They are important for steering the behavior of LLMs because they allow you to align the model outputs to human intentions without expensive retraining. Carefully engineered prompts can make LLMs suitable for a wide variety of tasks beyond what they were originally trained for. Prompts act as instructions that demonstrate to the LLM what the desired input-output mapping is.

Prompts consist of three main components:

  • Instructions that describe the task requirements, goals, and format of input/output. They explain the task to the model unambiguously.
  • Examples that demonstrate the desired input-output pairs. They provide diverse demonstrations of how different inputs should map to outputs.
  • Input that the model must act on to generate the output.

The following figure shows a few examples of prompting different language models (source: Pre...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}