Skip to content
←INDEX / 提示詞庫
TUTORIAL/ChatGPT / Claude / Gemini/進階

真的有效的 5 個 prompt engineering 技巧(XML > markdown 28%)

AI engineer 跨 GPT-4 / Claude / Gemini 數百小時測試後的 5 個可量化技巧 — CoT 鷹架、persona+goal+anti-goal、XML 比 markdown 準 28%、negative examples 比 positive 強、prompt chaining 完勝 mega-prompt。

SakuyaPromptCraft 主筆 · 寫於 2026-05-14
AI 教學 / 腳本ChatGPT / Claude / Gemini進階預期輸出說明≈ 681 tokens · 實際用量依工具與輸入而異
Last reviewed2026-05-14Read~10 MIN

01PROMPT

# 真的有效的 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。

RUN站內試跑 / TRY IT
▶ 站內試跑

不用離開網站,直接看這組 prompt 跑出來長怎樣(AI 即時生成,扣 1 點)。

02CONTEXT / 使用情境

原作者是 AI engineer、跨 3 家 model 數百小時測試。這 5 個技巧不是理論、是「我測過真的有用」的可重複技術。XML 超越 markdown 28% 是 measurable claim,CoT scaffold 跟 anti-goal 跟 prompt chaining 都已被 Anthropic 官方建議書背書。可以套在任何既有 prompt 上、不用重寫。

03SAMPLE / 期待成果

同樣 task:mega-prompt 出 cheerleading 式 mediocre 回應;加完 5 個技巧之後出 precise / qualified / no-hype / structured / 有 reasoning trail 的回應。Structured extraction 錯誤降 ~28%、編輯類任務從「改 sentences」變「surface 結構問題」、debugging 從「pattern-match 答」變「test hypothesis 答」。

這是預期成果的文字說明。請查看本文實測說明,並以自己的輸入素材小規模試用。

04VARIABLES / 變數說明

01[task_description]

你要做的事 — 想 well-defined(解問題 / 寫 email / 改 code)

02[persona]

明示水準的 persona(experienced engineer / senior editor / 10-year veteran)

03[anti_goal]

那 persona 的常見 failure mode(會 rewrite 而不是 surface issue / 會 cheerleading 而不是批評)

05RESOLVER · 變數代入器0 / 3

填下面的欄位,上方 prompt 會即時替換 [方括號] 內容。填好後按「複製組好的 prompt」直接丟進工具。

修飾
Assembled · 填剩餘變數…
# 真的有效的 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 不是相加是相乘。
FAQ · 常見問題

「真的有效的 5 個 prompt engineering 技巧(XML > markdown 28%)」這組提示詞要怎麼用?

這組 prompt 專為 ChatGPT / Claude / Gemini 設計。把 prompt 內 3 個方括號 [變數] 換成你自己的內容,貼進 ChatGPT / Claude / Gemini 執行即可。難度中等,照變數說明填好後即可上手。

「真的有效的 5 個 prompt engineering 技巧(XML > markdown 28%)」是免費的嗎?

完整 prompt 免費開放閱讀,不用註冊;可保存瀏覽器收藏,登入後可一鍵複製與留言。

用 ChatGPT / Claude / Gemini 依這組 prompt 生成的成果可以商用嗎?

prompt 文字本身你可自由使用與修改。但 AI 生成物(圖/音樂/影片/文字)的商用授權,取決於你在 ChatGPT / Claude / Gemini 使用的方案與其官方服務條款,請以該工具的授權規範為準。

RELATED你可能也需要

PRO01
TUTORIALSuno v5.5FEATURED
r/SunoAI (anonymous studio engineer)2026-06-12

Suno 工程師思維:4 步驟做出不像 AI 的歌

5.0(1)

Studio engineer 視角拆解 Suno 致命弱點(油炸 vocals、高頻 artifact)+ 4 步驟 DAW workflow + Suno Studio 修音 prompt

高階
Read

免費02
TUTORIALClaude 4.5 SonnetFEATURED
r/ClaudeAI2026-05-14

5 個 6 月 stuck 下來的 Claude 每週 workflow

提案產生器 / 會議處理器 / 內容再利用 / 週五回顧 / 收工 reset — 試了 40 個只有這 5 個沒被丟掉、各省 30+ 分鐘 / 次。

進階
Read

PRO03
TUTORIALClaude 4.5 SonnetFEATURED
r/PromptEngineering2026-05-14

7 個跨 model A/B 測過的 prompt 技巧(不是 vibes)

六個月在 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。

高階
Read

免費04
TUTORIALChatGPTFEATURED
r/ChatGPTPromptGenius2026-05-14

5 個信任檢查單行 prompt(沒有 role-play)

一年的 role-play system prompt + 14-step framework 後總結:真正改變品質的是 5 個單行 prompt。沒有 role、沒有 markdown、沒有「you are an expert」。

入門
Read

免費 · 全文開放閱讀

完整 prompt 已經開放.

免登入閱讀全文、保存瀏覽器收藏;登入後可一鍵複製與留言討論。不用信用卡。

不想註冊?

留個 email,下次有新 prompt 會寄一封簡短摘要給你。退訂一鍵、不轉賣。

每週一期,新上架提示詞 + 模型測試心得。每封信底部都有一鍵取消訂閱。

或訂 RSS feed(30 秒一次的人味選擇)

COMMENTS · 討論區0 則
登入 後可留言。還沒帳號?註冊
目前沒有留言。第一個說說你的經驗。
EMBED · 嵌入 blog / Note一行 iframe HTML、貼進文章即顯示此 prompt 卡片+

適合:部落格、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>
預覽 embed →380px tall · responsive width
發現這個 prompt 過時 / 跑不動 / 有錯字? 回報給我們 →