AI engineer 跨 GPT-4 / Claude / Gemini 數百小時測試後的 5 個可量化技巧 — CoT 鷹架、persona+goal+anti-goal、XML 比 markdown 準 28%、negative examples 比 positive 強、prompt chaining 完勝 mega-prompt。
不用離開網站,直接看這組 prompt 跑出來長怎樣(AI 即時生成,扣 1 點)。
原作者是 AI engineer、跨 3 家 model 數百小時測試。這 5 個技巧不是理論、是「我測過真的有用」的可重複技術。XML 超越 markdown 28% 是 measurable claim,CoT scaffold 跟 anti-goal 跟 prompt chaining 都已被 Anthropic 官方建議書背書。可以套在任何既有 prompt 上、不用重寫。
同樣 task:mega-prompt 出 cheerleading 式 mediocre 回應;加完 5 個技巧之後出 precise / qualified / no-hype / structured / 有 reasoning trail 的回應。Structured extraction 錯誤降 ~28%、編輯類任務從「改 sentences」變「surface 結構問題」、debugging 從「pattern-match 答」變「test hypothesis 答」。
以上為此 Prompt 丟進 ChatGPT / Claude / Gemini 後可得到的描述性成果,實際畫面會因填入的變數而有差異。
[task_description]你要做的事 — 想 well-defined(解問題 / 寫 email / 改 code)
[persona]明示水準的 persona(experienced engineer / senior editor / 10-year veteran)
[anti_goal]那 persona 的常見 failure mode(會 rewrite 而不是 surface issue / 會 cheerleading 而不是批評)
填下面的欄位,上方 prompt 會即時替換 [方括號] 內容。填好後按「複製組好的 prompt」直接丟進工具。
# 真的有效的 5 個 prompt engineering 技巧
跨 GPT-4 / Claude / Gemini 數百小時測試的蒸餾。沒廢話、只列實際 move the needle 的。
## TL;DR
- Chain-of-thought 還是王、但要「鷹架式」CoT
- Role prompting 單獨弱、要配 persona + goal + anti-goal
- XML tags 比 markdown 在 structured prompt 準 ~28%
- Negative examples(「不要 X」)超被低估、效果驚人
- Prompt chaining 幾乎每次都贏 mega-prompt
---
## 1. Chain-of-thought — 但加「reasoning scaffold」
不要只說 "think step by step"。給結構化鷹架:observation → hypothesis → test → conclusion。強迫 model 真正推理、不是 pattern-match 到「聽起來很有信心的答案」。
**Before**:
```
Solve this. Think step by step.
```
**After**:
```
Before answering, work through this:
<observation>What do I know for certain?</observation>
<hypothesis>What's my best guess and why?</hypothesis>
<test>What would disprove my hypothesis?</test>
<conclusion>Given the above, my answer is...</conclusion>
```
## 2. Persona + Goal + Anti-goal triple
大部分人只定 persona。要配「明確 goal」+「anti-goal」。Anti-goal 是 magic — 把 model 拉離 default failure mode。
**Weak**:
```
You are an expert editor.
```
**Strong**:
```
You are a sharp developmental editor at a top literary agency.
Goal: Help writers find structural weaknesses in their argument.
Anti-goal: Do NOT rewrite their sentences. Surface issues, don't fix them.
```
## 3. XML tags 取代 markdown(structured input)
Markdown ambiguous — `##` 可能 render 也可能 raw text。XML tags 是 unambiguous delimiter。在 structured extraction 任務上測過:XML 比 markdown header 少 ~28% 錯誤。
**XML 範本**:
```
<context>
{{paste your context here}}
</context>
<instructions>
- task 1
- task 2
</instructions>
<output_format>
JSON with keys: {{key1}}, {{key2}}
</output_format>
```
## 4. Contrastive examples(被低估的寶)
展示「不要什麼」和「要什麼」並排。Model 從對比學邊界、比只看 positive 強。一個 negative 常常贏三個 positive。
**範例**:
```
GOOD response: "The data suggests a 12% uplift in retention."
BAD response: "The data shows we did amazingly well and retention skyrocketed!"
Match the tone of the GOOD response — precise, qualified, no hype.
```
## 5. Prompt chaining > mega-prompt
3000-token mega-prompt 通常輸給 3 個 500-token 鏈式 prompt(每步餵下一步)。拆解。Model attention 有限、不要 10 個指令搶資源。
**Mega-prompt(弱)**:
```
分析這份報告、找出 3 個 issue、寫 executive summary、列 action items、寫 follow-up email、format 成 markdown ...
```
**Chained(強)**:
```
Step 1:分析這份報告、找出 3 個 issue。[輸入 → 輸出 issues]
Step 2:基於 issues、寫 executive summary。[issues → summary]
Step 3:基於 summary、列 action items。[summary → actions]
Step 4:format 成 markdown email。[全部 → email]
```
---
## 套用優先序
你正在寫的 prompt、按這順序檢查:
```
1. 有沒有 CoT 鷹架?沒有就加 <observation>/<hypothesis>/<test>/<conclusion>
2. Persona 有沒有 anti-goal?沒有就加「Do NOT do X」
3. 用 markdown 還 XML?structured input 一律 XML
4. 有給 negative example 嗎?沒就加「不要這樣寫 → 範例」
5. 是不是 mega-prompt?拆 3 步以上
```
5 個一起 stack、effect 不是相加是相乘。這組 prompt 專為 ChatGPT / Claude / Gemini 設計。把 prompt 內 3 個方括號 [變數] 換成你自己的內容,貼進 ChatGPT / Claude / Gemini 執行即可。難度中等,照變數說明填好後即可上手。
完整 prompt 免費開放閱讀,不用註冊;登入後可一鍵複製、收藏與留言。
prompt 文字本身你可自由使用與修改。但 AI 生成物(圖/音樂/影片/文字)的商用授權,取決於你在 ChatGPT / Claude / Gemini 使用的方案與其官方服務條款,請以該工具的授權規範為準。
Studio engineer 視角拆解 Suno 致命弱點(油炸 vocals、高頻 artifact)+ 4 步驟 DAW workflow + Suno Studio 修音 prompt
提案產生器 / 會議處理器 / 內容再利用 / 週五回顧 / 收工 reset — 試了 40 個只有這 5 個沒被丟掉、各省 30+ 分鐘 / 次。
適合:部落格、Medium、Notion 公開頁、Substack — 任何支援 iframe / HTML 嵌入的地方。對方點「看完整」會回到本站、是 prompt 庫的免費 backlink。
<iframe src="https://prompt.luvai.net/embed/prompt-engineering-5-techniques-that-moved-needle" width="100%" height="380" frameborder="0" style="border:1px solid #e0dcd0;border-radius:4px;" loading="lazy" title="PromptCraft Embed"></iframe>
# 真的有效的 5 個 prompt engineering 技巧
跨 GPT-4 / Claude / Gemini 數百小時測試的蒸餾。沒廢話、只列實際 move the needle 的。
## TL;DR
- Chain-of-thought 還是王、但要「鷹架式」CoT
- Role prompting 單獨弱、要配 persona + goal + anti-goal
- XML tags 比 markdown 在 structured prompt 準 ~28%
- Negative examples(「不要 X」)超被低估、效果驚人
- Prompt chaining 幾乎每次都贏 mega-prompt
---
## 1. Chain-of-thought — 但加「reasoning scaffold」
不要只說 "think step by step"。給結構化鷹架:observation → hypothesis → test → conclusion。強迫 model 真正推理、不是 pattern-match 到「聽起來很有信心的答案」。
**Before**:
```
Solve this. Think step by step.
```
**After**:
```
Before answering, work through this:
<observation>What do I know for certain?</observation>
<hypothesis>What's my best guess and why?</hypothesis>
<test>What would disprove my hypothesis?</test>
<conclusion>Given the above, my answer is...</conclusion>
```
## 2. Persona + Goal + Anti-goal triple
大部分人只定 persona。要配「明確 goal」+「anti-goal」。Anti-goal 是 magic — 把 model 拉離 default failure mode。
**Weak**:
```
You are an expert editor.
```
**Strong**:
```
You are a sharp developmental editor at a top literary agency.
Goal: Help writers find structural weaknesses in their argument.
Anti-goal: Do NOT rewrite their sentences. Surface issues, don't fix them.
```
## 3. XML tags 取代 markdown(structured input)
Markdown ambiguous — `##` 可能 render 也可能 raw text。XML tags 是 unambiguous delimiter。在 structured extraction 任務上測過:XML 比 markdown header 少 ~28% 錯誤。
**XML 範本**:
```
<context>
{{paste your context here}}
</context>
<instructions>
- task 1
- task 2
</instructions>
<output_format>
JSON with keys: {{key1}}, {{key2}}
</output_format>
```
## 4. Contrastive examples(被低估的寶)
展示「不要什麼」和「要什麼」並排。Model 從對比學邊界、比只看 positive 強。一個 negative 常常贏三個 positive。
**範例**:
```
GOOD response: "The data suggests a 12% uplift in retention."
BAD response: "The data shows we did amazingly well and retention skyrocketed!"
Match the tone of the GOOD response — precise, qualified, no hype.
```
## 5. Prompt chaining > mega-prompt
3000-token mega-prompt 通常輸給 3 個 500-token 鏈式 prompt(每步餵下一步)。拆解。Model attention 有限、不要 10 個指令搶資源。
**Mega-prompt(弱)**:
```
分析這份報告、找出 3 個 issue、寫 executive summary、列 action items、寫 follow-up email、format 成 markdown ...
```
**Chained(強)**:
```
Step 1:分析這份報告、找出 3 個 issue。[輸入 → 輸出 issues]
Step 2:基於 issues、寫 executive summary。[issues → summary]
Step 3:基於 summary、列 action items。[summary → actions]
Step 4:format 成 markdown email。[全部 → email]
```
---
## 套用優先序
你正在寫的 prompt、按這順序檢查:
```
1. 有沒有 CoT 鷹架?沒有就加 <observation>/<hypothesis>/<test>/<conclusion>
2. Persona 有沒有 anti-goal?沒有就加「Do NOT do X」
3. 用 markdown 還 XML?structured input 一律 XML
4. 有給 negative example 嗎?沒就加「不要這樣寫 → 範例」
5. 是不是 mega-prompt?拆 3 步以上
```
5 個一起 stack、effect 不是相加是相乘。把方括號 [ ] 內的變數換成你的內容,丟進 ChatGPT / Claude / Gemini。
六個月在 Claude / GPT-4 / Gemini 上用人工 rater A/B 測 200+ prompt 後寫的。包含 persona+constraint stacking / anti-example / role reversal QA / cognitive scaffold / emotional priming / uncertainty CoT / steelman first。
一年的 role-play system prompt + 14-step framework 後總結:真正改變品質的是 5 個單行 prompt。沒有 role、沒有 markdown、沒有「you are an expert」。