Prompt-Engineering-Guide is an open resource repository for prompt engineering, maintained by DAIR.AI, with the goal of providing systematic reference material for developing and optimizing prompts. According to the repository description, prompt engineering is a relatively new discipline for efficiently using language models (LMs) and serving various applications and research topics; mastering prompt engineering helps in understanding the capabilities and limitations of large language models (LLMs). Researchers use prompt engineering to improve the performance of LLMs on common and complex tasks such as question answering and arithmetic reasoning, while developers use it to design robust prompting techniques for interfacing LLMs with other tools.
Main capabilities and content organization The guide brings together the latest papers, learning guides, lectures, reference materials, and tools related to LLM prompt engineering. The content sections include: Introduction, LLM Settings, Basics of Prompting, Prompt Elements, General Tips for Designing Prompts, and Examples of Prompts; the techniques section covers Zero-Shot Prompting, Few-Shot Prompting, Chain-of-Thought Prompting, Self-Consistency, Generate Knowledge Prompting, Prompt Chaining, Tree of Thoughts (ToT), Retrieval Augmented Generation, Automatic Reasoning and Tool-use (ART), Automatic Prompt Engineer, Active-Prompt, Directional Stimulus Prompting, Program-Aided Language Models, ReAct Prompting, Multimodal CoT Prompting, Graph Prompting, and more.
Applications and prompt library The applications section includes Function Calling, generating data, generating synthetic datasets for RAG, handling diversity in generated datasets, generating code, a graduate job classification case study, and more. Prompt Hub organizes examples by task type, such as classification, coding, creativity, evaluation, information extraction, image generation, mathematics, question answering, reasoning, text summarization, truthfulness, adversarial prompting, and more. The models section covers ChatGPT, Code Llama, Flan, Gemini, GPT-4, LLaMA, Mistral 7B, Mixtral, OLMo, Phi-2, and model collections. In addition, there are sections on risks and misuse (adversarial prompting, factuality, bias), papers (surveys, methods, applications, collections), tools, Notebooks, datasets, and further reading.
How to use The repository provides a web version of the guide, and the latest guide can also be viewed at https://www.promptingguide.ai/ . To run the guide locally (for example, to check the correct implementation of new translations), you need to: install Node >=18.0.0; if the system does not have pnpm, install it first (see the relevant link for detailed instructions); install dependencies: pnpm i next react react-dom nextra nextra-theme-docs; start with pnpm dev; in http://localhost:3000/ Browsing. The project also released a lecture of about 1 hour, providing a comprehensive overview of prompting techniques, applications, and tools, along with a code notebook.
Courses, Services, and Community Under DAIR.AI Academy, courses on prompt engineering, RAG, and AI Agents are offered as a supplement to this guide, adopting a more hands-on learning approach; the announcement mentions that the code PROMPTING20 can be used to get an additional 20% discount (specific prices and terms are not yet provided). The project also provides services such as corporate training, consulting, and speaking, and supports 13 languages, welcoming more translations. The repository provides channels such as Discord, Twitter, YouTube, and Newsletter, and lists media outlets that have covered it, such as the Wall Street Journal, Forbes, and Markettechpost.
Applicable Scenarios and Limitations This resource is suitable for researchers and developers who want to systematically learn prompt engineering, as well as for people who need to design robust prompting techniques and build applications related to RAG and AI Agents. It can also be used as teaching and reference material. Note that the repository is mainly a guide and a collection of resources, and specific features and effects depend on the user's own implementation; details such as the fees, prices, and availability of services such as courses and training are not fully given in the materials and should be based on the latest official information. If used for work or research, the repository provides citation formats (see the repository description for the specific format); feedback and additions via PR or issue are welcome.