Shop Viral Mens Fashion Now
Enjoy fast, free delivery, exclusive deals, and award-winning movies & TV shows.
Buy New
-37% $50.00
FREE delivery Monday, August 31
Ships from: Amazon.com
Sold by: Amazon.com
$50.00 with 37 percent savings
List Price: $79.99
FREE delivery Monday, August 31
Or Prime members get FREE delivery Tomorrow, August 27. Order within 2 hrs 9 mins. Join Prime
In Stock
$$50.00 () Includes selected options. Includes initial monthly payment and selected options. Details
Price
Subtotal
$$50.00
Subtotal
Initial payment breakdown
Shipping cost, delivery date, and order total (including tax) shown at checkout.
Shipper / Seller
Amazon.com
Amazon.com
Shipper / Seller
Amazon.com
Returns
FREE 30-day refund/replacement
FREE 30-day refund/replacement
Quick refund
Usually issued within 24 hours. See exceptions
FREE return
At least one free return option available.
Convenient dropoff
At any of our 50,000 US locations.
See return policy
Support
Product support included
What's Product Support?
In the event your product doesn't work as expected or you need help using it, Amazon offers free product support options such as live phone/chat with an Amazon associate, manufacturer contact information, step-by-step troubleshooting guides, and help videos. By solving product issues, we help the planet by extending the life of products. Availability of support options differ by product and country. Learn more
Gift options
Available at checkout
Available at checkout This item is a gift. Change
At checkout, you can add a custom message, a gift receipt for easy returns and have the item gift-wrapped
Payment
Secure transaction
Your transaction is secure
We work hard to protect your security and privacy. Our payment security system encrypts your information during transmission. We don’t share your credit card details with third-party sellers, and we don’t sell your information to others. Learn more
$41.40
Gently read. May have name of previous ownership, or ex-library edition. Binding tight; spine straight and smooth, with no creasing; covers clean and crisp. Minimal signs of handling or shelving. 100% GUARANTEE! Shipped with delivery confirmation, if you're not satisfied with purchase please return item! Ships USPS Media Mail Gently read. May have name of previous ownership, or ex-library edition. Binding tight; spine straight and smooth, with no creasing; covers clean and crisp. Minimal signs of handling or shelving. 100% GUARANTEE! Shipped with delivery confirmation, if you're not satisfied with purchase please return item! Ships USPS Media Mail See less
FREE delivery September 2 - 4. Details
In stock
$$50.00 () Includes selected options. Includes initial monthly payment and selected options. Details
Price
Subtotal
$$50.00
Subtotal
Initial payment breakdown
Shipping cost, delivery date, and order total (including tax) shown at checkout.
Access codes and supplements are not guaranteed with used items.
Ships from and sold by Stellar Book Company.
Added to

Sorry, there was a problem.

There was an error retrieving your Wish Lists. Please try again.

Sorry, there was a problem.

List unavailable.
Kindle app logo image

Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.

Read instantly on your browser with Kindle for Web.

Using your mobile phone camera - scan the code below and download the Kindle app.

QR code to download the Kindle App

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

Follow the authors

Get new release updates & improved recommendations
Something went wrong. Please try your request again later.

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

4.2 out of 5 stars (117)

{"desktop_buybox_group_1":[{"displayPrice":"$50.00","priceAmount":50.00,"currencySymbol":"$","integerValue":"50","decimalSeparator":".","fractionalValue":"00","symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"pnKnL7j18Z2teJ2rek3iS77ERt6RKE8IdLMhaEUNdGxiMC%2BtKZwgC%2BFOhnsXe6E6%2FNbjvNWTEGOJd88aoG4899uDlVs8TVh2smRlA4SRlBLhBO3fhIrJZdGiFc1Z9bevsUNkG%2Fvt27mzd0EhK50ANA%3D%3D","locale":"en-US","buyingOptionType":"NEW","aapiBuyingOptionIndex":0}, {"displayPrice":"$41.40","priceAmount":41.40,"currencySymbol":"$","integerValue":"41","decimalSeparator":".","fractionalValue":"40","symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"pnKnL7j18Z2teJ2rek3iS77ERt6RKE8Iw4TxDCL6h%2BLhqoICQZF09cHZHS33ejImysRHhTWKG0gis%2FTC%2Bccadzp8ygBA9UPbvx8TwISgifxkZ32hfAGh60yZG5gHbXsFCHiMDZcVrOH%2Fi%2Fb0EPi2dOLF7I4w4IFjUB5ofVy9XAJkFmEUZLb%2BLIJJj%2B5aarif","locale":"en-US","buyingOptionType":"USED","aapiBuyingOptionIndex":1}]}

Purchase options and add-ons

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

Read poolside to seaside.Shop kindle Paperwhite. pantry

Frequently bought together

This item: Prompt Engineering for Generative AI: Future-Proof Inputs for Reliable AI Outputs
$50.00
Get it as soon as Monday, Aug 31
In Stock
Ships from and sold by Amazon.com.
+
$52.40
Get it as soon as Monday, Aug 31
In Stock
Ships from and sold by Amazon.com.
+
$54.51
Get it as soon as Monday, Aug 31
In Stock
Ships from and sold by Amazon.com.
Total price: $00
To see our price, add these items to your cart.
Details
Added to Cart
Choose items to buy together.

Customers also bought or read

Loading...

From the brand


From the Publisher

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

From the Preface

The rapid pace of innovation in generative AI promises to change how we live and work, but it’s getting increasingly difficult to keep up. The number of AI papers published on arXiv is growing exponentially, Stable Diffusion has been among the fastest growing open source projects in history, and AI art tool Midjourney’s Discord server has tens of millions of members, surpassing even the largest gaming communities. What most captured the public’s imagination was OpenAI’s release of ChatGPT, which reached 100 million users in two months, making it the fastest-growing consumer app in history. Learning to work with AI has quickly become one of the most in-demand skills.

Everyone using AI professionally quickly learns that the quality of the output depends heavily on what you provide as input. The discipline of prompt engineering has arisen as a set of best practices for improving the reliability, efficiency, and accuracy of AI models. “In ten years, half of the world’s jobs will be in prompt engineering,” claims Robin Li, the cofounder and CEO of Chinese tech giant Baidu. However, we expect prompting to be a skill required of many jobs, akin to proficiency in Microsoft Excel, rather than a popular job title in itself. This new wave of disruption is changing everything we thought we knew about computers. We’re used to writing algorithms that return the same result every time—not so for AI, where the responses are non-deterministic. Cost and latency are real factors again, after decades of Moore’s law making us complacent in expecting real-time computation at negligible cost. The biggest hurdle is the tendency of these models to confidently make things up, dubbed hallucination, causing us to rethink the way we evaluate the accuracy of our work.

We’ve been working with generative AI since the GPT-3 beta in 2020, and as we saw the models progress, many early prompting tricks and hacks became no longer necessary. Over time a consistent set of principles emerged that were still useful with the newer models, and worked across both text and image generation. We have written this book based on these timeless principles, helping you learn transferable skills that will continue to be useful no matter what happens with AI over the next five years. The key to working with AI isn’t “figuring out how to hack the prompt by adding one magic word to the end that changes everything else,” as OpenAI cofounder Sam Altman asserts, but what will always matter is the “quality of ideas and the understanding of what you want.” While we don’t know if we’ll call it “prompt engineering” in five years, working effectively with generative AI will only become more important.

Editorial Reviews

Review

"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

Product details

  • Publisher ‏ : ‎ O'Reilly Media
  • Publication date ‏ : ‎ June 25, 2024
  • Edition ‏ : ‎ 1st
  • Language ‏ : ‎ English
  • Print length ‏ : ‎ 422 pages
  • ISBN-10 ‏ : ‎ 109815343X
  • ISBN-13 ‏ : ‎ 978-1098153434
  • Item Weight ‏ : ‎ 7.4 ounces
  • Dimensions ‏ : ‎ 7.25 x 0.75 x 9.5 inches
  • Best Sellers Rank: #113,676 in Books (See Top 100 in Books)
  • Customer Reviews:
    4.2 out of 5 stars (117)

About the authors

Follow authors to get new release updates, plus improved recommendations.

Customer reviews

4.2 out of 5 stars
117 global ratings
A wonderful primer for those discovering the amazing world of generative AI
5 out of 5 stars
A wonderful primer for those discovering the amazing world of generative AI
Somewhere in the past year, ChatGPT has gone from "cool, interesting, amusing" to a massively valuable work assistant capable of writing Python scripts, analysing data, and doing lots, lots, more. The key to this? The rapid evolution of OpenAI's GPT models and making my first forays into prompt engineering. If I thought I was getting good, though, this book took me reminded me that I'm just scratching the surface. Halfway through the first chapter I was already furiously scribbling notes in the margins for what I could do better with my prompt writing and by the end of the text I felt like I had gotten a very good grounding - not just in GPTs specifically but in the bigger picture of how these hugely powerful tools were trained and came to maturity. I imagine that few will argue with my assertion that there is lots of hyperbole and "noise" in the AI space right now which, as ever, makes it hard to pick out the signal from the noise. Which is precisely why I sought out an O'Reilly title and I'm very glad that I did. Thorough, excellent, and I hope that this edition will be the first of many. As this rapidly maturing field scales and matures I think that prompt engineering will be an essential discipline to master. Pick up this text to get a good foothold on things.
Thank you for your feedback
Sorry, there was an error
Sorry we couldn't load the review

Top reviews from the United States

  • 5 out of 5 stars
    A wonderful primer for those discovering the amazing world of generative AI
    Reviewed in the United States on August 3, 2024
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    Somewhere in the past year, ChatGPT has gone from "cool, interesting, amusing" to a massively valuable work assistant capable of writing Python scripts, analysing data, and doing lots, lots, more. The key to this? The rapid evolution of OpenAI's GPT models and making my first forays into prompt engineering.

    If I thought I was getting good, though, this book took me reminded me that I'm just scratching the surface. Halfway through the first chapter I was already furiously scribbling notes in the margins for what I could do better with my prompt writing and by the end of the text I felt like I had gotten a very good grounding - not just in GPTs specifically but in the bigger picture of how these hugely powerful tools were trained and came to maturity.

    I imagine that few will argue with my assertion that there is lots of hyperbole and "noise" in the AI space right now which, as ever, makes it hard to pick out the signal from the noise. Which is precisely why I sought out an O'Reilly title and I'm very glad that I did.

    Thorough, excellent, and I hope that this edition will be the first of many. As this rapidly maturing field scales and matures I think that prompt engineering will be an essential discipline to master. Pick up this text to get a good foothold on things.

    A wonderful primer for those discovering the amazing world of generative AI

    Somewhere in the past year, ChatGPT has gone from "cool, interesting, amusing" to a massively valuable work assistant capable of writing Python scripts, analysing data, and doing lots, lots, more. The key to this? The rapid evolution of OpenAI's GPT models and making my first forays into prompt engineering.

    If I thought I was getting good, though, this book took me reminded me that I'm just scratching the surface. Halfway through the first chapter I was already furiously scribbling notes in the margins for what I could do better with my prompt writing and by the end of the text I felt like I had gotten a very good grounding - not just in GPTs specifically but in the bigger picture of how these hugely powerful tools were trained and came to maturity.

    I imagine that few will argue with my assertion that there is lots of hyperbole and "noise" in the AI space right now which, as ever, makes it hard to pick out the signal from the noise. Which is precisely why I sought out an O'Reilly title and I'm very glad that I did.

    Thorough, excellent, and I hope that this edition will be the first of many. As this rapidly maturing field scales and matures I think that prompt engineering will be an essential discipline to master. Pick up this text to get a good foothold on things.

    7 people found this helpful
    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.
  • 4 out of 5 stars
    Understanding AI prompts as a science
    Reviewed in the United States on December 13, 2025
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    Prompt engineering is the art and science of finding the right words to generate the right responses from artificial intelligence (AI). It's becoming a skill in-demand in today's workplaces. It's also becoming an essential skill for life. To understand prompt engineering, you must understand how AI tools understand their inputs. This book explains that to you in many forms.

    It covers prompting as it intersects all the major AI disciplines, like general prompts (as in a ChatBot), fine-tuning, and retrieval-augmented generation (RAG). It also introduces how prompting intersects a couple of image-generation tools.

    As a scientist, I appreciate the theoretical approach to these practical matters. Too many people are hacks at AI these days, and any technical understanding can rapidly advance an individual's effectiveness. Prompt engineering is often made fun of as a "soft" topic, but as this book demonstrates, it intersects all the major AI areas. Presumably less garbage in means less garbage out. This book shows how you can make that take place.

    As typical for O'Reilly materials, this book appeals to people who desire an intermediate-to-advanced understanding of how AI works. It's not for the casual user. Anyone technical involved in professional knowledge generation using AI can benefit from understanding the dynamics "under the hood." It's a good, though perhaps not ground-breaking, textbook for those of us unable to take a class in the subject. Prompt engineering may be a soft topic to many, but books like this ground the field in the science that can make or break a digital or software product.

    2 people found this helpful
    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.
  • 5 out of 5 stars
    Great book
    Reviewed in the United States on December 20, 2025
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    Great book! It is helpful as I work towards my Masters of Science in Applied Artificial Intelligence

    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.
  • 5 out of 5 stars
    Comprehensive Guide with Practical Insights
    Reviewed in the United States on June 25, 2024
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    This is a solid book for understanding the art and science of working with LLMs and other generative AI models. I always struggled with getting the output I was looking for, and wasn't sure how best to "ask" the models for what I wanted. This book did a great job of laying out the strategies and practical guidance to craft the prompts. There were a lot of tips and tricks, but the overall understanding and framework around prompt engineering has been super useful.

    3 people found this helpful
    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.
  • 5 out of 5 stars
    A must read!
    Reviewed in the United States on June 25, 2024
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    Hands down, the best book on prompt engineering and implementing LLMs. Really enjoyed Michael and James deep dive. Whether you're technical or not, this book is foundational to a deeper understanding in how to properly explore and implement LLMs.

    One person found this helpful
    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.
  • 1 out of 5 stars
    Ohh boy
    Reviewed in the United States on January 7, 2026
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    I bought a new book. But heavy damage in cover of book. Not good.

    Ohh boy
    1 out of 5 stars
    Ohh boy
    Reviewed in the United States on January 7, 2026

    I bought a new book. But heavy damage in cover of book. Not good.

    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.
  • 4 out of 5 stars
    Helpful for GPT/LangChain framework
    Reviewed in the United States on August 7, 2024
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    I applaud the authors for putting forth a comprehensive introduction in a rapidly evolving space. I absorbed a lot, helpful as I was developing a prototype — using open source methods.

    And that’s where I was disappointed. The LLM and examples are highly adapted to OpenAI’s GPT-x and the bulky LangChain framework, something not obvious until you dig in to the book. Sure, this may be where newbie demand was when the authors began writing. But as the open source models and OpenAI alternatives gain speed (e.g. Llama 3.1, Groq, etc.) this book may quickly need an updated and expanded version to stay relevant.

    9 people found this helpful
    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.
  • 3 out of 5 stars
    Good concepts, but uneven depth
    Reviewed in the United States on January 17, 2026
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    Some helpful prompt frameworks, but parts felt repetitive and a few sections stayed too high-level for advanced users. Beginners will likely benefit more than experienced practitioners. If you’re new to prompt engineering it’s a decent starting point; if you’re already building structured prompts daily, it may feel light.

    2 people found this helpful
    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.

Top reviews from other countries

  • 3 out of 5 stars
    book is ok but
    Reviewed in Canada on December 2, 2024
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    The book is ok yet I think you would get more for less if you just google for docs and articles on the web

    Sending feedback...
    Thanks, we'll investigate in the next few days.
  • 5 out of 5 stars
    Brilliant
    Reviewed in the United Kingdom on March 20, 2026
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.
    Sending feedback...
    Thanks, we'll investigate in the next few days.
  • 5 out of 5 stars
    I have an in-depth reference tool.?
    Reviewed in Australia on June 10, 2025
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    Great book! I am using it in conjunction with the authors training course.

    Sending feedback...
    Thanks, we'll investigate in the next few days.
  • 5 out of 5 stars
    Great book, detailed and practical advice
    Reviewed in Germany on July 9, 2024
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    This book on prompt engineering is an absolute gem! As someone delving into the intricacies of AI and language models, I found this resource incredibly valuable. The author does a fantastic job of breaking down complex concepts into manageable, easy-to-understand sections.

    The practical advice is where this book truly shines. Each chapter is filled with real-world examples and step-by-step guides that make applying the techniques straightforward. Whether you're a novice just starting out or a seasoned professional looking to refine your skills, there's something here for everyone.

    Sending feedback...
    Thanks, we'll investigate in the next few days.
  • 5 out of 5 stars
    Very comprehensive book
    Reviewed in Belgium on August 10, 2024
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    Gives a thorough introduction to prompt engineering . Some Python coding skills required

    Sending feedback...
    Thanks, we'll investigate in the next few days.