2.1 概览
本章主要总结了 LLM Prompt Engineering 相关的技术、原则、模版 和 工具。
参考资料:
- Prompt Engineering Guide
- Learn Prompting
- Prompt Engineering Institute
1. Techniques
Technique | description |
---|
Zero-Shot Prompting | |
Few-Shot Prompting | |
Chain-of-Thought (COT) Prompting | |
Tree of Thoughts (ToT) Prompting | |
Generated Knowledge Prompting | |
{.table .table-bordered .border-secondary} | |
2. Principles
Principle | description |
---|
start simple and gradually interative | |
Write clear and specific instructions | |
Give the model time to “think” | |
{.table .table-bordered .border-secondary} | |
3. Templates
3.1 Basic Template
components | description | nessesary? |
---|
Instruction | a specific task or instruction you want the model to perform. | Yes |
Context | external information or additional context that can steer the model to better responses. | Optional |
Input | the input or question that we are interested to find a response for | Optional |
Outcome | the type or format of the output. | Optional |
{.table .table-bordered .border-secondary} | | |
3.2 Advanced Template
components | description | nessesary? |
---|
Role | Specify ChatGPT’s role. | Yes |
Instruction | a specific task or instruction you want the model to perform | Yes |
Context | external information or additional context that can steer the model to better responses. | Optional |
Example | give examples to illustrate the input and outcome, or examples of probolem solving process. | Optional |
Input | the input or question that we are interested to find a response for | Optional |
Outcome | the type, format or length of the output. | Optional |
{.table .table-bordered .border-secondary} | | |
4. Tools