Prompt Engineering for Generative AI: Future-Proof Inputs for Reliable AI Outputs

Prompt Engineering for Generative AI: Future-Proof Inputs for Reliable AI Outputs
by 作者: James Phoenix (Author), Mike Taylor (Author)
Publisher Finelybook 出版社: O'Reilly Media
Edition: 1st
Publication Date 出版日期: 2024-06-25
Language 语言: English
Pages 页数: 422 pages
ISBN-10 书号: 109815343X
ISBN-13 书号: 9781098153434

Book Description

Large language models (LLMs) and diffusion models such as ChatGPT and Stable Diffusion have unprecedented potential. Because they have been trained on all the public text and images on the internet, they can make useful contributions to a wide variety of tasks. And with the barrier to entry greatly reduced today, practically any developer can harness LLMs and diffusion models to tackle problems previously unsuitable for automation.

With this book, you'll gain a solid foundation in generative AI, including how to apply these models in practice. When first integrating LLMs and diffusion models into their workflows, most developers struggle to coax reliable enough results from them to use in automated systems. Authors James Phoenix and Mike Taylor show you how a set of principles called prompt engineering can enable you to work effectively with AI.

Learn how to empower AI to work for you. This book explains:

  • The structure of the interaction chain of your program's AI model and the fine-grained steps in between
  • How AI model requests arise from transforming the application problem into a document completion problem in the model training domain
  • The influence of LLM and diffusion model architecture—and how to best interact with it
  • How these principles apply in practice in the domains of natural language processing, text and image generation, and code


"The absolute best book-length resource I've read on prompt engineering. Mike and James are masters of their craft."
—Dan Shipper, cofounder & CEO, Every
"This book is a solid introduction to the fundamentals of prompt engineering and generative AI. The authors cover a wide range of useful techniques for all skill levels from beginner to advanced in a simple, practical, and easy-to-understand way. If you're looking to improve the accuracy and reliability of your AI systems, this book should be on your shelf."
-Mayo Oshin, founder and CEO, Siennai Analytics, early LangChain contributor
"Phoenix and Taylor's guide is a lighthouse amidst the vast ocean of generative AI. Their book became a cornerstone for my team at Phiture AI Labs, as we learned to harness LLMs and diffusion models for creating marketing assets that resonate with the essence of our clients' apps and games. Through prompt engineering, we've been able to generate bespoke, on-brand content at scale. This isn't just theory; it's a practical masterclass in transforming AI's raw potential into tailored solutions, making it an essential read for developers looking to elevate their AI integration to new heights of creativity and efficiency."
—Moritz Daan, Founder/Partner, Phiture Mobile Growth Consultancy
"Prompt Engineering for Generative AI is probably the most future-proof way of future-proofing your tech career. This is without a doubt the best resource for anyone working in practical applications of AI. The rich, refined principles in here will help both new and seasoned AI engineers stay on top of this very competitive game for the foreseeable future."
- Ellis Crosby, CTO and cofounder, Incremento
"This is an essential guide for agency and service professionals. Integrating AI with service and client delivery, using automation management, and speeding up solutions will set new industry standards. You'll find useful, practical information and tactics in the book, allowing you to understand and utilize AI to its full potential."
- Byron Tassoni-Resch, CEO and cofounder, WeDiscover

From the Author

We've been doing prompt engineering since the GPT-3 beta in 2020, and when GPT-4 arrived we found a lot of the tricks and hacks we used were no longer necessary. This motivated us to define a set of future-proof principles that are transferrable across models and modalities, that will still be useful with GPT-5, or whatever model we use in the future. 
The Five Principles of Prompting are:

  1. Give Direction: Describe the desired style in detail, or reference a relevant persona.
  2. Specify Format: Define what rules to follow, and the required structure of the response.
  3. Provide Examples: Insert a diverse set of test cases where the task was done correctly.
  4. Evaluate Quality: Identify errors and rate responses, testing what drives performance.
  5. Divide Labor: Split tasks into multiple steps, chained together for complex goals.

We first published these principles as a blog post in July 2022, and they have stood the test of time, including mapping quite closely to OpenAI's own Prompt Engineering Guide, which came a year later. Anyone who works closely with generative AI is likely to converge on a similar set of strategies for solving common issues, but this book is designed to get you there quicker.
Throughout this book you'll see hundreds of demonstrative examples of prompting techniques, including both text and image prompting, as well as using Python to build AI automation scripts and products. This isn't a list of prompting hacks to find the right combination of magic words, it's a practical guide for building systems that provide the right context to AI applications, as well as how to test and scale AI systems for production.
The book will be useful for you if:

  • Your time is worth more than 40 dollars an hour, and saving a few hours reading this book instead of piecing everything together from multiple sources is worth it to you.
  • You're not just using AI casually but you're actually building an AI application or internal template many people will use hundreds or thousands of times a day.
  • You want tips for reducing hallucination and improving the reliability of AI, while learning from 100s of real-world examples of how to solve common issues working with AI.
  • You'd like to compare the strengths and weaknesses of OpenAI vs other models, as well as common frameworks like LangChain, different vector database options, and AUTOMATIC1111
  • You want to see what it looks like to build an end-to-end AI application, from a naive prompt to a full AI agent, including building a basic user interface with Gradio

Amazon page


Formats: PDF, EPUB | 254 MB

下载地址 Download解决验证以访问链接!
未经允许不得转载:finelybook » Prompt Engineering for Generative AI: Future-Proof Inputs for Reliable AI Outputs


  • 暂无文章

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址