Prompt Engineering in Practice: Design, Test, and Improve AI Prompts
暫譯: 實務中的 Prompt Engineering:設計、測試與改進 AI 提示詞

Davies, Richard, Fischer, Rafael

  • 出版商: Manning
  • 出版日期: 2026-10-20
  • 售價: $2,250
  • 貴賓價: 9.5 折 $2,137
  • 語言: 英文
  • 頁數: 248
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 1633436306
  • ISBN-13: 9781633436305
  • 相關分類: Prompt Engineering、Large language model
  • 尚未上市,無法訂購

相關主題

商品描述

Get the eBook free when you register your print book at Manning.

"A thoughtful, practical guide to prompt engineering as a real discipline."
--Che Gamble, Davies Group

Sometimes your LLMs return brilliant responses. Other times, not so much. Do you know why? Prompt Engineering in Practice shows you how to move from accidental AI results to reliable, production-grade systems you can deploy with confidence. Written by AI veterans Richard Davies and Rafael Fischer, this book introduces a unique approach: treat prompts as engineered, self-contained interfaces that you can compose, evaluate, and refine. This shift reframes model interactions as a strict software design discipline rather than a series of fuzzy trial-and-error exercises.

Spanning 11 comprehensive chapters, Prompt Engineering in Practice establishes a logical "design stack" that builds from microscopic syntax to macroscopic system architecture. You'll start by learning to define the structural elements of a prompt, including delimiters and falsifiable constraints, along with linguistic characteristics like precision, directness, and brevity. These techniques equip you to write well-specified prompts that you can successfully incorporate into reusable production components.

You'll then explore the foundational patterns that form the core of prompt engineering and enable you to build robust, scalable agentic workflows. Reviewer Dewang Sultania, Senior Machine Learning Engineer at Netflix, noted "The nine-pattern taxonomy provides genuinely useful composable prompt engineering strategies. It's also a great introduction on how LLM-powered systems actually work!"

Because LLM responses are consistently inconsistent, the book provides a practical framework to diagnose prompt failures systematically by treating prompts as specifications and investigating sources of variance. Throughout the book, you'll practice a process to systematically analyze and troubleshoot prompt failures as you navigate four distinct phases of the prompt engineering lifecycle--Design, Test, Iterate, Manage. By the time you reach the deployment and operations chapters that conclude the book, you'll be treating unexpected outputs as valuable debuggable system signals that help you isolate where a prompt is underspecified.

Ultimately, Prompt Engineering in Practice shows you how to treat prompts as first-class, maintainable software artifacts. You will learn to eliminate "prompt debt" by building version-controlled, audited prompt libraries that can be reviewed in pull requests, secured against injection, and managed using role-based access controls. By bridging the gap between prototype experimentation and production operations, this guide provides the exact tools needed to collaborate with cross-functional teams and maintain consistent, safe AI integrations over time.

What's inside

- Eliminate prompt debt with version-controlled, audited prompt libraries
- Reduce development iteration and rework through deliberate linguistic precision
- Mitigate hallucinations and security vulnerabilities using robust hardening techniques
- Diagnose and debug model output failures using systematic engineering frameworks

About the reader

This book is for software developers and AI engineers who want to build, secure, and maintain reliable LLM-powered systems in production.

About the author

Richard Davies is the Founder, CEO, and CTO of Meridias. He has worked exclusively in artificial intelligence since 2018, with hands-on experience across machine learning, agents, and Large Language Models. Rafael Fischer, PhD in Engineering, specializes in building and delivering agentic LLM solutions with clients in the US, Europe, and Brazil.

Table of Contents

Part 1 Foundations
1 Prompt engineering: The blueprint
Part 2 Prompt Design
2 Prompt design: Structural elements
3 Prompt design: Linguistic elements
4 Patterns
5 Templates
6 Prompt types
Part 3 Advanced Prompting
7 Contextual prompting
8 Prompt sampling
9 Advanced prompt patterns
Part 4 Practice
10 Security
11 Managing Prompts in Production

商品描述(中文翻譯)

註冊您在 Manning 購買的紙本書,即可免費取得電子書。

「這是一本深思熟慮、務實可行的指南,將提示工程視為一門真正的專業學科。」
--Che Gamble,Davies Group

有時候,您的 LLM 會產生令人驚豔的回應;但其他時候,結果就不那麼理想。您知道原因嗎?

《Prompt Engineering in Practice》將教您如何從偶然獲得的 AI 結果,轉向可可靠部署、具備正式生產環境品質的系統。由 AI 資深專家 Richard Davies 與 Rafael Fischer 撰寫,本書提出一套獨特的方法:將提示視為經過工程化、獨立封裝的介面,讓您能夠組合、評估與持續改進。這種轉變將模型互動重新定義為嚴謹的軟體設計學科,而不再只是模糊的反覆試誤。

全書共 11 章,建立一套邏輯化的「設計堆疊」,從微觀的語法逐步延伸至宏觀的系統架構。您將先學習如何定義提示的結構元素,包括分隔符號與可證偽的限制條件,以及精確、直接、簡潔等語言特性。這些技巧能幫助您撰寫規格明確的提示,並將其成功整合至可重複使用的生產環境元件中。

接著,您將探索構成提示工程核心的基礎模式,並運用這些模式建立強健且可擴充的代理式工作流程。Netflix 資深機器學習工程師、書評者 Dewang Sultania 表示:「九種模式的分類法提供了真正實用、可組合的提示工程策略;同時也是了解 LLM 驅動系統實際運作方式的絕佳入門!」

由於 LLM 的回應始終具有不一致性,本書提供一套實用架構,將提示視為規格,並調查結果差異的來源,以系統化地診斷提示失效問題。在全書各章中,您將實際運用一套流程,依序經歷提示工程生命週期的四個階段——設計(Design)、測試(Test)、反覆改進(Iterate)與管理(Manage),系統化地分析與排除提示失效問題。當您讀到本書最後探討部署與營運的章節時,便能將非預期輸出視為有價值、可進行除錯的系統訊號,協助您找出提示規格不足之處。

最終,《Prompt Engineering in Practice》將教您把提示視為一等公民、可維護的軟體資產。您將學習如何建立受版本控制且經過稽核的提示函式庫,消除「提示債務」(prompt debt);這些提示可以在 pull request 中接受審查、受到防護以抵禦注入攻擊,並透過角色型存取控制加以管理。本指南彌合了原型實驗與正式生產環境營運之間的落差,提供與跨職能團隊協作,以及長期維持一致且安全的 AI 整合所需的確切工具。

內容包括

- 透過受版本控制且經過稽核的提示函式庫,消除提示債務
- 運用有意識的語言精確性,減少開發迭代與重工
- 使用強健的加固技術,降低幻覺與安全漏洞的風險
- 透過系統化的工程架構,診斷並除錯模型輸出失效問題

適合讀者

本書適合希望在正式生產環境中建立、保護與維護可靠 LLM 驅動系統的軟體開發人員與 AI 工程師。

作者簡介

Richard Davies 是 Meridias 的創辦人、執行長與技術長。自 2018 年起,他便專注於人工智慧領域,並在機器學習、代理程式與大型語言模型(Large Language Models)方面擁有豐富的實務經驗。

Rafael Fischer 擁有工程學博士學位,專長是為美國、歐洲與巴西的客戶建置並交付代理式 LLM 解決方案。

目錄

第一部 基礎
1 提示工程:藍圖

第二部 提示設計
2 提示設計:結構元素
3 提示設計:語言元素
4 模式
5 範本
6 提示類型

第三部 進階提示
7 情境式提示
8 提示取樣
9 進階提示模式

第四部 實務
10 安全性
11 正式生產環境中的提示管理

作者簡介

Richard Davies is the CTO of Vance, an artificial intelligence US-based startup in the business obligations and observance space. With over 6 years of industry experience, he specializes in developing cutting-edge AI products, including real-time semantic segmentation systems, activity detection algorithms, and machine translation platforms.

Rafael Fischer, PhD, is a Generative AI Software Engineer with over 6 years of experience designing and delivering scalable AI-powered products for companies in the US, Europe, and Brazil. He specializes in building full-stack, product-oriented solutions that integrate LLMs, agentic workflows, and secure, cloud-native architectures to create intuitive, high-impact user experiences.

作者簡介(中文翻譯)

Richard Davies 是 Vance 的技術長(CTO)。Vance 是一家總部位於美國、專注於企業義務與法規遵循領域的人工智慧新創公司。Richard Davies 擁有超過 6 年的業界經驗,專精於開發尖端 AI 產品,包括即時語意分割系統、活動偵測演算法,以及機器翻譯平台。

Rafael Fischer 博士是一名生成式 AI 軟體工程師,擁有超過 6 年的經驗,曾為美國、歐洲及巴西的企業設計並交付具備可擴充性的 AI 產品。他專精於建構以產品為導向的全端解決方案,整合 LLM、代理式工作流程(agentic workflows)與安全的雲端原生架構,打造直覺且具高影響力的使用者體驗。