2.1 概览

本章主要总结了 LLM Prompt Engineering 相关的技术、原则、模版 和 工具。 参考资料:

  1. Prompt Engineering Guide
  2. Learn Prompting
  3. Prompt Engineering Institute

1. Techniques

Techniquedescription
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

Principledescription
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

componentsdescriptionnessesary?
Instructiona specific task or instruction you want the model to perform.Yes
Contextexternal information or additional context that can steer the model to better responses.Optional
Inputthe input or question that we are interested to find a response forOptional
Outcomethe type or format of the output.Optional
{.table .table-bordered .border-secondary}

3.2 Advanced Template

componentsdescriptionnessesary?
RoleSpecify ChatGPT’s role.Yes
Instructiona specific task or instruction you want the model to performYes
Contextexternal information or additional context that can steer the model to better responses.Optional
Examplegive examples to illustrate the input and outcome, or examples of probolem solving process.Optional
Inputthe input or question that we are interested to find a response forOptional
Outcomethe type, format or length of the output.Optional
{.table .table-bordered .border-secondary}

4. Tools

Tooldescription
OpenAI Playground
Google Bard
Anthropic Claude
Microsoft Guidance
Langchain Prompt
{.table .table-bordered .border-secondary}
最后更新于