Files
Obsidian/Record/DL/CoT Prompt.md
2024-09-29 21:04:22 +08:00

17 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## Standard Few-shot Prompt
Prompt: `Q(question) + A(answer)`
## Few-shot CoT
思维链提示,就是把一个多步骤推理问题,分解成很多个中间步骤,分配给更多的计算量,生成更多的 token再把这些答案拼接在一起进行求解。
Prompt: Q + A(r(rationale) + a(answer))
Answer: LLM同样会给出理由和答案。
## Zero-shot CoT
通过 `Let's think step by step` 可以让 LLM 生成回答问题的思维链。我们可以将 Zero-shot CoT 看作一个 pipeline我们先使用 `Let's think step by step` 让 LLM 尽可能生成一些思考过程,然后将生成的 rationale 和 question 拼接起来,重新配合一个指向 answer 的 Prompt 来激励模型生成答案。
Output: (Q + (Q + Let's think step by step LLM) + The answer is) | LLM
## Self-consistency
自洽性,使用多数投票(majority vote)的方式来提升最终回答的准确性。不同于之前的方法,本方法会生成多个思路链,最后取多数答案作为最终答案。
## LtM
Least-to-Most prompt(最少到最多提示过程),进一步将问题分解为子问题,然后逐个解决。主要分为以下两个阶段:
- 分解问题
将问题分解为子问题:使用 "To solve {Q}, we need to" 来让 LLM 生成子问题。
- 解决问题:
根据生成的问题的依赖顺序依次解决问题。将问题及子问题输入 LLM 进行求解每次解决后将子问题及答案作为下一步骤的输入。