DAIR.AI's Prompt Engineering Guide

Prompt Engineering Guide on Jun 6, 2023

Prompt engineering is a relatively new discipline for developing and optimizing prompts to efficiently use language models (LMs) for a wide variety of applications and research topics. Prompt engineering skills help to better understand the capabilities and limitations of large language models (LLMs). Researchers use prompt engineering to improve the capacity of LLMs on a wide range of common and complex tasks such as question answering and arithmetic reasoning. Developers use prompt engineering to design robust and effective prompting techniques that interface with LLMs and other tools. Prompt engineering is not just about designing and developing prompts. It encompasses a wide range of skills and techniques that are useful for interacting and developing with LLMs. It's an important skill to interface, build with, and understand capabilities of LLMs. You can use prompt engineering to improve safety of LLMs and build new capabilities like augmenting LLMs with domain knowledge and external tools. Motivated by the high interest in developing with LLMs, we have created this new prompt engineering guide that contains all the latest papers, learning guides, models, lectures, references, new LLM capabilities, and tools related to prompt engineering.

The guide includes: Introduction, LLM Settings, Basics of Prompting, Prompt Elements, General Tips for Designing Prompts, Examples of Prompts, Techniques (Zero-shot Prompting, Few-shot Prompting, Chain-of-Thought Prompting, Self-Consistency, Generate Knowledge Prompting, Tree of Thoughts, Retrieval Augmented Generation, Automatic Reasoning and Tool-use, Automatic Prompt Engineer, Active-Prompt, Directional Stimulus Prompting, ReAct, Multimodal CoT, Graph Prompting), Applications (Program-Aided Language Models, Generating Data, Generating Code, Graduate Job Classification Case Study, Prompt Function), Models (Flan, ChatGPT, LLaMA, GPT-4, LLM Collection), Risks & Misuses (Adversarial Prompting, Factuality, Biases), Papers, Tools, Notebooks, Datasets, Additional Readings.
🔎 There is a search interface on the page ([FlexSearch](https://github.com/nextapps-de/flexsearch)), and via [the GitHub repo](https://github.com/dair-ai/Prompt-Engineering-Guide/)
It is not focused on prompts for searchers of search systems, but it does include an example of a prompt for a search system backend, from [ReAct: Synergizing Reasoning and Acting in Language Models](https://react-lm.github.io/) [@yao2023react]
promptingguide.ai/about:
We borrow inspirations from many open resources like OpenAI CookBook, Pretrain, Prompt, Predict, Learn Prompting, and many others.