开源项目 GitHub Topic rag 2026-07-06T12:02 正文 ok 451 words

Prompt Engineering 指南

英文标题:📦 dair-ai/Prompt-Engineering-Guide

这份全面更新的提示工程指南汇集了与大型语言模型(LLM)提示工程、上下文工程、RAG 和 AI Agent 相关的最新论文、学习资料、讲座、笔记与工具。指南提供了 Web 版本,同时推出自定进度的动手课程,全球学习者已突破 300 万。内容涵盖提示技术、应用与工具,并提供了本地运行说明与学术引用格式,是研究人员和开发者高效构建 LLM 应用的实用知识库。
打开原文相关 5.6 · 机会 5
media8.9 KB media51.4 KB

中文

Prompt engineering(提示工程)是一门相对新兴的学科,专注于开发和优化提示,以便在各种应用和研究话题中高效地使用语言模型(LM)。提示工程技能有助于更好地理解大型语言模型(LLM)的能力与局限。研究人员通过提示工程来提升 LLM 在问答、算术推理等一系列常见和复杂任务上的表现;开发者则利用提示工程设计出稳健且有效的提示技术,与 LLM 及其他工具对接。

鉴于大家对基于 LLM 的开发抱有极大兴趣,我们创建了这份全新的提示工程指南,其中汇整了与 LLM 提示工程相关的最新论文、学习资料、讲座、参考文献和工具。

🌐 Prompt Engineering Guide(Web 版)

🎉 我们激动地宣布,DAIR.AI Academy 正式推出全新的提示工程、RAG 和 AI Agent 课程。立即加入!

这些课程旨在与这份指南互补,提供更加动手实操的学习体验,助您掌握提示工程、上下文工程和 AI Agent。

使用优惠码 PROMPTING20 即可额外享受 20% 折扣。

祝您 Prompt 愉快!


  • 🎓 我们现已在 DAIR.AI Academy 推出自定进度的提示工程课程。立即加入!
  • 🎓 全新「面向 LLM 的提示工程」课程正式发布!点此注册!
  • 💼 我们现在提供多项服务,包括企业培训、咨询和演讲。
  • 🌐 现支持 13 种语言!欢迎更多翻译贡献。
  • 👩‍🎓 2024 年 1 月学习人数突破 300 万!
  • 🎉 我们已推出新的 Web 版指南,点此访问
  • 🔥 2023 年 2 月 21 日登上 Hacker News 榜首
  • 🎉 首场提示工程讲座已上线,观看地址

您也可以在我们的新网站 https://www.promptingguide.ai/ 上查阅最新指南。


我们已发布一节 1 小时的讲座,全面概览提示技术、应用和工具。


在本地运行指南

若要在本地运行本指南(例如检查新翻译是否正确实现),您需要:

  1. 安装 Node >=18.0.0
  2. 安装 pnpm(如果系统中尚无)。详情参见此处。
  3. 安装依赖项:pnpm i next react react-dom nextra nextra-theme-docs
  4. 执行 pnpm dev 启动指南
  5. 通过 http://localhost:3000/ 浏览指南

一些曾展示我们的地方:


如果您将本指南用于工作或研究,请按以下方式引用:

@article{Saravia_Prompt_Engineering_Guide_2022, author = {Saravia, Elvis}, journal = {https://github.com/dair-ai/Prompt-Engineering-Guide}, month = {12}, title = {{Prompt Engineering Guide}}, year = {2022} }

MIT 许可证

如果您觉得这里缺少了什么,请随时发起 PR。我们始终欢迎反馈和建议,只需提一个 issue 即可!

English / 原文

Sponsored by

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.

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, lectures, references, and tools related to prompt engineering for LLMs.

🌐 Prompt Engineering Guide (Web Version)

🎉 We are excited to launch our new prompt engineering, RAG, and AI Agents courses under the DAIR.AI Academy. Join Now!

The courses are meant to compliment this guide and provide a more hands-on approach to learning about prompt engineering, context engineering, and AI Agents.

Use code PROMPTING20 to get an extra 20% off.

Happy Prompting!


  • 🎓 We now offer self-paced prompt engineering courses under our DAIR.AI Academy. Join Now!
  • 🎓 New course on Prompt Engineering for LLMs announced! Enroll here!
  • 💼 We now offer several services like corporate training, consulting, and talks.
  • 🌐 We now support 13 languages! Welcoming more translations.
  • 👩‍🎓 We crossed 3 million learners in January 2024!
  • 🎉 We have launched a new web version of the guide here
  • 🔥 We reached #1 on Hacker News on 21 Feb 2023
  • 🎉 The First Prompt Engineering Lecture went live here

Join our Discord

Follow us on Twitter

Subscribe to our YouTube

Subscribe to our Newsletter


You can also find the most up-to-date guides on our new website https://www.promptingguide.ai/.


We have published a 1 hour lecture that provides a comprehensive overview of prompting techniques, applications, and tools.


Running the guide locally

To run the guide locally, for example to check the correct implementation of a new translation, you will need to:

  1. Install Node >=18.0.0
  2. Install pnpm if not present in your system. Check here for detailed instructions.
  3. Install the dependencies: pnpm i next react react-dom nextra nextra-theme-docs
  4. Boot the guide with pnpm dev
  5. Browse the guide at http://localhost:3000/

Some places where we have been featured:


If you are using the guide for your work or research, please cite us as follows:

@article{Saravia_Prompt_Engineering_Guide_2022,
author = {Saravia, Elvis},
journal = {https://github.com/dair-ai/Prompt-Engineering-Guide},
month = {12},
title = {{Prompt Engineering Guide}},
year = {2022}
}

MIT License

Feel free to open a PR if you think something is missing here. Always welcome feedback and suggestions. Just open an issue!