繁中

TOPIC DETAIL

Prompt Engineering Methodology

超越簡單的問答,透過結構化指令(YAML)、風格引導(Vibe Prompting)及角色設定(Gem),系統性地駕馭 AI,使其產出精準、穩定且具個人風格的內容。

核心觀念

  • 向 AI 問路:當不確定如何下指令時,最好的方法是直接問 AI:「我要完成 [目標],請教我如何寫出最適合你的萬能提示詞公式?」
  • YAML 結構化指令:對於需要精確控制、有固定規則的任務(如評語生成),使用 YAML 格式來定義行為,讓 AI 像讀設定檔一樣工作,穩定性遠高於純自然語言。
  • Vibe Prompting 注入靈魂:與其鉅細靡遺地描述所有細節,不如給予 AI 一個「氛圍 (Vibe)」,例如「用一個資深廣告文案的口吻…」,讓 AI 在特定風格框架下自由發揮,產出更自然的內容。
  • 用 AI 管理 AI:建立一個「行為指令小幫手 Gem」,專門用來生成、管理和迭代其他 AI 機器人 (Gem) 的行為指令,實現版本控制與高效優化。

整合工作流

  1. 初階:角色扮演與問路
    • 角色設定:在 Google Gemini 中設定「個人化建議」,讓 AI 扮演特定角色(如嚴格的文法老師、親切的客服)。
    • 提問公式:向 AI 提問「為了讓你更好地幫我 [生成食譜],我應該提供哪些資訊?請給我一個模板。」
  2. 中階:結構化指令 (YAML)
    • 定義規則:在 NotebookLM 中,建立一個 YAML 檔案來定義學生評語的生成規則,包含 語氣強度 (1-10)、溝通法則 (三明治溝通法)、字數限制 等。
    • 套用規則:將此 YAML 檔作為 NotebookLM 的「自訂對話」來源,AI 在生成評語時會嚴格遵守這些規則。
  3. 高階:建立自訂 Gem
    • 單一任務 Gem:在 Google Gemini 中,點選「新增 Gem」,將一個重複性任務(如「將這段文字轉成 IG 貼文」)的詳細「行為指令」填入。
    • 指令小幫手 Gem (Meta-AI):建立一個新的 Gem,其行為指令設定為「專門生成和管理其他 Gem 的行為指令,輸出格式為 YAML,需包含版本號,且每次都在舊版基礎上修改」。
  4. 風格化:Vibe Prompting
    • 在任何需要創意或個人風格的場景(如寫簡報腳本、社群貼文),放棄詳細的步驟指令,改用氛圍提示。
    • 範例:「想像你是一位走遍世界的旅行作家,剛從京都回來,請寫一篇帶有禪意和生活感的散文,描述雨中的金閣寺。」
    • 結合 AI 簡報術的 KH3R 元素(知識、愉悅、共鳴、回應、節奏),引導 AI 生成不僅正確、更有感染力的內容。

最佳金句

「你不會的東西,你就請 AI 教你,這是我最常用的提示詞。」 「最方便的方法就是我們寫一個機器人來專門寫其他機器人的行為指令,這麼做非常方便,是你可以不斷的去調整、更新、反覆迭代。」 「AI只幫助你協助你的結構跟排版,而你要提供你的特殊洞察…」

教學切入建議

此主題可貫穿整個 AI 教學課程,由淺入深。初期,教導學員如何用「角色扮演」和「問路」法與 AI 互動。中期,在講授特定應用(如 NotebookLM 評語生成)時,引入 YAML 結構化指令,展示其穩定性。後期,在專案或進階課程中,教學員如何建立自己的 Gem,甚至設計「管理 Gem 的 Gem」,建立完整的 AI 工作流程。

常見誤區

  • 將提示詞當作魔咒:迷信網路上流傳的「完美提示詞」,以為複製貼上就能解決一切問題,卻不懂得根據自己的情境進行修改。
  • 自然語言與結構化指令混用:在需要精確控制的場景(如程式碼生成)下,仍使用模糊的自然語言,導致 AI 產出不穩定或錯誤的結果。
  • 忽略版本管理:在優化 Gem 的行為指令時,沒有記錄每次的修改,導致新版本效果變差時,無法快速回溯到之前的有效版本。

---en---

Core Concepts

  • Ask AI for Guidance: When unsure how to give instructions, the best approach is to directly ask the AI: “I want to achieve [goal]. Please teach me how to write the most suitable universal prompt formula for you.”
  • YAML Structured Instructions: For tasks requiring precise control and fixed rules (e.g., feedback generation), using YAML format to define behavior allows AI to work like reading a configuration file, offering much higher stability than pure natural language.
  • Vibe Prompting for Soul: Instead of meticulously describing every detail, give AI a “vibe” (e.g., “in the tone of a seasoned advertising copywriter…”) to let AI operate within a specific stylistic framework, producing more natural content.
  • AI Managing AI: Create a “Behavior Instruction Assistant Gem” specifically designed to generate, manage, and iterate the behavior instructions for other AI agents (Gems), enabling version control and efficient optimization.

Integrated Workflow

  1. Beginner: Role-Playing and Asking for Guidance:
    • Role Setting: Set “personalized suggestions” in Google Gemini, allowing AI to play specific roles (e.g., a strict grammar teacher, a friendly customer service agent).
    • Prompt Formula: Ask AI: “To better help me [generate a recipe], what information should I provide? Please give me a template.”
  2. Intermediate: Structured Instructions (YAML):
    • Define Rules: In NotebookLM, create a YAML file to define the rules for generating student feedback, including tone intensity (1-10), communication principles (sandwich feedback method), word count limit, etc.
    • Apply Rules: Use this YAML file as a “custom conversation” source in NotebookLM; AI will strictly adhere to these rules when generating feedback.
  3. Advanced: Create Custom Gems:
    • Single-Task Gem: In Google Gemini, click “Add Gem” and fill in detailed “behavior instructions” for a repetitive task (e.g., “convert this text into an Instagram post”).
    • Instruction Assistant Gem (Meta-AI): Create a new Gem whose behavior instructions are set to “specifically generate and manage behavior instructions for other Gems, outputting in YAML format, requiring version numbers, and modifying based on previous versions each time.”
  4. Stylization: Vibe Prompting:
    • In any scenario requiring creativity or personal style (e.g., writing presentation scripts, social media posts), forgo detailed step-by-step instructions and instead use vibe prompts.
    • Example: “Imagine you are a travel writer who has traveled the world and just returned from Kyoto. Please write an essay with a sense of Zen and life, describing the Golden Pavilion in the rain.”
    • Combine with KH3R elements from AI presentation techniques (Knowledge, Happiness, Resonance, Response, Rhythm) to guide AI in generating content that is not only accurate but also more engaging.

Best Quotes

“If you don’t know something, just ask AI to teach you; that’s my most common prompt.” “The most convenient way is to write a bot specifically to write behavior instructions for other bots. This is very convenient because you can constantly adjust, update, and iterate.” “AI only helps you with structure and layout, but you need to provide your unique insights…”

Teaching Entry Points

This topic can run through the entire AI teaching course, from shallow to deep. Initially, teach students how to interact with AI using “role-playing” and “asking for directions.” In the middle, when teaching specific applications (like NotebookLM feedback generation), introduce YAML structured instructions to demonstrate their stability. Later, in projects or advanced courses, teach students how to create their own Gems, and even design “Gems that manage Gems,” establishing a complete AI workflow.

Common Pitfalls

  • Treating Prompts as Magic Spells: Blindly believing in “perfect prompts” found online, assuming copy-pasting will solve all problems, without understanding how to modify them for specific contexts.
  • Mixing Natural Language with Structured Instructions: In scenarios requiring precise control (e.g., code generation), still using vague natural language, leading to unstable or incorrect AI output.
  • Ignoring Version Management: When optimizing Gem behavior instructions, not recording each modification, making it difficult to quickly revert to previous effective versions if new versions perform worse.

Key Concepts

  • 提示詞工程
  • YAML 結構化指令
  • Vibe Prompting
  • 角色設定
  • Gem
  • 行為指令小幫手
  • AI 管理 AI
  • 問路法
  • 認知負荷
  • 精準控制
  • 風格化
  • 效率與個人風格
  • 版本管理

Related Episodes