Prompt Engineering

Prompt Engineering (提示工程), Chain-of-Thought Prompting


初級入門(免費課程)

Prompt Engineering

aka In-Context Prompting

  • Basic Prompting
    • Zero-shot
    • Few-shot
  • Instruction Prompting
  • Self-Consistency Sampling
  • Chain-of-Thought (CoT)
  • Automatic Prompt Design
  • Augmented Language Models
Blog: [LLM 各種技巧 Prompt Engineering 大總結 指南](https://medium.com/@cch.chichieh/llm-%E5%90%84%E7%A8%AE%E6%8A%80%E5%B7%A7-prompt-engineering-%E6%8C%87%E5%8D%97-6ac4201a4cbe)

生成式AI導論

【生成式AI導論 2024】第3講:訓練不了人工智慧?你可以訓練你自己 (上) — 神奇咒語與提供更多資訊


【生成式AI導論 2024】第4講:訓練不了人工智慧?你可以訓練你自己 (中) — 拆解問題與使用工具


【生成式AI導論 2024】第5講:訓練不了人工智慧?你可以訓練你自己 (下) — 讓語言彼此合作,把一個人活成一個團隊


神奇的咒語

不是對所有的模型都有用

1. 要語言模型思考: “Think about it Step-by-Step”

Paper: Chain-of-Thought Prompting Elicits Reasoning in Large Language Models


2. 要語言模型解釋: “Explain it”

Paper: Can Large Language Models Be an Alternative to Human Evaluation?


3. 對語言模型情緒勒索: “This is very important to my career”

Paper: Large Language Models Understand and Can be Enhanced by Emotional Stimuli


4. 對語言模型下原則性指導 (Principled Instructions)

Paper: Principled Instructions Are All You Need for Questioning LLaMA-1/2, GPT-3.5/4

  1. 對它說話不用客氣, 對它有什麼要求直說無妨
  2. 給它明確的指示, 直說要它做甚麼, 不用跟它說不做什麼
  3. 跟它說如果做得好,會給它小費$xxx
  4. 跟它說做不好, 它會得到處罰
  5. 跟它說要保證它的答案是沒有偏見的, 而且要避免使用任何刻板印象 …

5.直接問語言模型給更強大的咒語 (Forward Generation Template)

  • Let's think step by step
  • Take a deep breath then work on this problem step by step

6. 輸入額外範例

In-Context Learning

Paper: Language Models are Few-Shot Learners


7. 拆解任務 (Recursive Reprompting and Revision)

Paper: Re3: Generating Longer Stories With Recursive Reprompting and Revision
Paper: Joint Prompt Optimization of Stacked LLMs using Variational Inference


8. 要語言模型去使用工具

Paper: AnyTool: Self-Reflective, Hierarchical Agents for Large-Scale API Calls



9. 自動提示比手工編寫的提示好

Paper: The Unreasonable Effectiveness of Eccentric Automatic Prompts
Blog: 要求AI模仿《星際爭霸戰》能提升效能,但還是用「自動優化」以魔法打敗魔法最有效


10. 要語言模型摘要文章/論文後寫出簡報/文章

收集, 啟發, 輸出

  • 一段一段分析文章中提供了什麼解決方法
  • 如何解決我提出的需求與問題?
  • 根據問題, 詳列摘要重點
  • 改寫成精簡但精采的簡報大綱

Paper: Constitutional AI: Harmlessness from AI Feedback


Chain-of-Thought Prompting

Blog: How to Make ChatGPT Smarter: Chain of Thought Prompting

Chain-of-Thought Prompting

  1. Zero-shot COT Prompting

  2. Automatic Chain-of-Thought (Auto-CoT)


Chain of thought and ReAct — SQL Agent



This site was last updated December 15, 2024.