Anthropic 的即时工程互动教程
Anthropic's Prompt Engineering Interactive Tutorial

原始链接: https://github.com/anthropics/courses/tree/master/prompt_engineering_interactive_tutorial

本课程旨在帮助您为AI助手Claude设计有效的提示。 完成后,您将掌握如何创建清晰、直接的提示,同时避免常见的陷阱。 您将深入了解克莱尔的能力和局限性,并制定适合各种场景的提示。 该课程包括九章,每一章后面都有实践练习。 各章涵盖的主题包括有效构建提示、提供清晰的说明、分配角色、分离数据和指令、格式化输出、逐步思考(预知)、利用示例、避免幻觉以及为不同行业构建复杂的提示。 第一章重点介绍基本提示结构的设计。 后续章节将深入探讨特定方面,例如确保清晰度、提供详细说明、组织任务以及根据个人情况或上下文优化输出。 练习部分提供了制作各种类型提示的实践经验——聊天机器人、法律服务、金融服务、编码——让您有机会在现实世界中应用新学到的知识。 最后,附录提供了有关链接提示、工具、搜索和检索策略以及超越标准提示的额外资源。 整个课程鼓励按顺序完成课程,为您提供多种机会来完善和提高您的技能。 首先,请转到“基本提示结构”一章。 祝你好运!

用户利用名为 Whisper 的语言模型将挪威语音频文件翻译为英语文本。 为了提高可读性,他们在进一步分析内容之前使用清理步骤处理了初始原始输出。 在本例中,文本讨论了使用两个不同尺寸的蛋糕模具烘烤蛋糕。 用户试图确定当从较大的模具(30 厘米)切换到较小的模具(24 厘米)时,蛋糕配方必须缩小多少。 为了解决问题,用户首先将问题分类为数学计算或方程。 然后,他们将问题转换为 Octave/Matlab 编程语言语法,以找到配方所需的调整量。 不幸的是,由于数据不足,如果不做出某些假设(例如两个蛋糕模具具有一致的高度),程序就无法提供明确的解决方案。 在对有关 LC 电路的不同且模糊的数学问题尝试相同的过程后,该模型准确地识别出自己无法在不缺少电感 (L) 等重要组件的情况下提供响应。 总之,虽然已经取得了进展,但在理解复杂问题、处理歧义和跨不同领域进行概括方面仍有改进的空间。 Whisper 等语言模型仍然需要微调才能有效处理不同的场景。
相关文章

原文

Course introduction and goals

This course is intended to provide you with a comprehensive step-by-step understanding of how to engineer optimal prompts within Claude.

After completing this course, you will be able to:

  • Master the basic structure of a good prompt
  • Recognize common failure modes and learn the '80/20' techniques to address them
  • Understand Claude's strengths and weaknesses
  • Build strong prompts from scratch for common use cases

Course structure and content

This course is structured to allow you many chances to practice writing and troubleshooting prompts yourself. The course is broken up into 9 chapters with accompanying exercises, as well as an appendix of even more advanced methods. It is intended for you to work through the course in chapter order.

Each lesson has an "Example Playground" area at the bottom where you are free to experiment with the examples in the lesson and see for yourself how changing prompts can change Claude's responses. There is also an answer key.

Note: This tutorial uses our smallest, fastest, and cheapest model, Claude 3 Haiku. Anthropic has two other models, Claude 3 Sonnet and Claude 3 Opus, which are more intelligent than Haiku, with Opus being the most intelligent.

This tutorial also exists on Google Sheets using Anthropic's Claude for Sheets extension. We recommend using that version as it is more user friendly.

When you are ready to begin, go to 01_Basic Prompt Structure to proceed.

Each chapter consists of a lesson and a set of exercises.

  • Chapter 1: Basic Prompt Structure

  • Chapter 2: Being Clear and Direct

  • Chapter 3: Assigning Roles

  • Chapter 4: Separating Data from Instructions

  • Chapter 5: Formatting Output & Speaking for Claude

  • Chapter 6: Precognition (Thinking Step by Step)

  • Chapter 7: Using Examples

  • Chapter 8: Avoiding Hallucinations

  • Chapter 9: Building Complex Prompts (Industry Use Cases)

    • Complex Prompts from Scratch - Chatbot
    • Complex Prompts for Legal Services
    • Exercise: Complex Prompts for Financial Services
    • Exercise: Complex Prompts for Coding
    • Congratulations & Next Steps
  • Appendix: Beyond Standard Prompting

    • Chaining Prompts
    • Tool Use
    • Search & Retrieval
联系我们 contact @ memedata.com