Skip to content
←INDEX / Prompt library
TUTORIAL/ChatGPT / Claude / Gemini/Intermediate

5 Prompt Engineering Techniques That Actually Move the Needle (XML Beats Markdown by 28%)

Five quantifiable techniques from an AI engineer's hundreds of hours testing across GPT-4, Claude, and Gemini: CoT scaffolding, persona + goal + anti-goal, XML being 28% more accurate than markdown, negative examples outperforming positive ones, and prompt chaining beating the mega-prompt.

SakuyaPromptCraft editor · Updated 2026-05-14
TutorialChatGPT / Claude / GeminiIntermediate
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 不是相加是相乘。

Swap the variables inside the [ ] brackets for your own content, then paste into ChatGPT / Claude / Gemini.

RUNTRY IT
▶ TRY IT ON-SITE

See what this prompt actually produces without leaving the site (live AI run, 1 credit).

02CONTEXT / Why it works

The original author is an AI engineer with hundreds of hours of testing across 3 model families. These 5 techniques aren't theory; they're repeatable methods that "I tested and they actually work." XML beating markdown by 28% is a measurable claim, and the CoT scaffold, anti-goal, and prompt chaining are all backed by Anthropic's own official guidance. You can apply them to any existing prompt without a rewrite.

03SAMPLE / Expected result

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

A description of the intended result. Check this entry's testing notes and try the prompt with your own inputs.

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 不是相加是相乘。
RELATED
PRO01
TUTORIALSuno v5.5FEATURED
r/SunoAI (anonymous studio engineer)2026-06-12

Suno Engineer's Mindset: 4 Steps to a Song That Doesn't Sound Like AI

5.0(1)

A studio engineer's breakdown of Suno's fatal weaknesses (fried vocals, high-frequency artifacts), plus a 4-step DAW workflow and a Suno Studio cleanup prompt.

Advanced
Read

Free02
TUTORIALClaude 4.5 SonnetFEATURED
r/ClaudeAI2026-05-14

5 Claude Weekly Workflows That Stuck After 6 Months

Proposal generator / meeting processor / content repurposer / Friday review / shutdown reset — out of 40 I tried, only these 5 survived, each saving 30+ minutes per run.

Intermediate
Read

PRO03
TUTORIALClaude 4.5 SonnetFEATURED
r/PromptEngineering2026-05-14

7 Cross-Model A/B-Tested Prompt Techniques (Not Vibes)

Written after six months of A/B testing 200+ prompts on Claude, GPT-4, and Gemini with human raters. Covers persona + constraint stacking, anti-examples, role-reversal QA, cognitive scaffolds, emotional priming, uncertainty CoT, and steelman-first.

Advanced
Read

Free04
TUTORIALChatGPTFEATURED
r/ChatGPTPromptGenius2026-05-14

5 trust-checking one-liner prompts (no role-play)

After a year of role-play system prompts and 14-step frameworks, here's the takeaway: the thing that actually moved the needle on quality was 5 one-line prompts. No roles, no markdown, no "you are an expert."

Beginner
Read

COMMENTS · 討論區0 則
登入 後可留言。還沒帳號?註冊
目前沒有留言。第一個說說你的經驗。