Prompt Engineering Guide
πŸ˜ƒ Basics
πŸ’Ό Applications
πŸ§™β€β™‚οΈ Intermediate
πŸ€– АгСнты
βš–οΈ Reliability
πŸ–ΌοΈ Image Prompting
πŸ”“ Prompt Hacking
πŸ”¨ Tooling
πŸ’ͺ Prompt Tuning
🎲 Miscellaneous
Models
πŸ“™ Vocabulary Reference
πŸ“š Bibliography
πŸ“¦ Prompted Products
πŸ›Έ Additional Resources
πŸ”₯ Hot Topics
✨ Credits

Prompt Engineering Guide

Reading Time: 6 minutes
Last updated on August 7, 2024

Sander Schulhoff

Welcome to Learn Prompting's Introductory Course on Generative AI and Prompt Engineering!

Generative AI is the world's hottest buzzword, and we have created the most comprehensive (and free) guide on how to use it. This course is tailored to non-technical readers, who may not have even heard of AI, making it the perfect starting point if you are new to Generative AI and Prompt Engineering. Technical readers will find valuable insights within our later modules.

Generative AI refers to tools that can be used to create new content such as articles or images, just like humans can. It is expected to significantly change the way we work (read: your job may be affected). With so much buzz floating around about Generative AI (Gen AI) and Prompt Engineering (PE), it is hard to know what to believe.

We have scoured the internet to find the best techniques and tools for our 1.3 Million readers from companies like OpenAI, Brex, and Deloitte. We are constantly refining our guide, to ensure that we provide you with the latest information. Lets see how Gen AI can save you hours of time in an instant, with a short example.

Motivating Example

Our favorite way of saving time with Gen AI is automatically writing emails. By automating email responses, email editing, and cold outreach, we save hours of time each week. By sending an AI the following prompt, we can get it to generate a full length, formal email.

Tip

A prompt is basically an instruction you give to an AI. We will learn more about them in the next lesson.

Astronaut

Prompt


I am the CEO of a medium sized company. Write a short email that is humorous yet professional to my regional manager. Ask them to: - send me an up-to-date list of our paper stock - organize a meeting this week with other regional managers - let me know how the company-wide AI workshop went at their office
Robot

AI Output


Subject: Paper, Power Meetings, and AI Shenanigans

Dear [Regional Manager's Name],

I trust this email finds you in high spirits and not buried under a mountain of paperwork. Speaking of paper, I've been having some wild dreams about our paper stock lately. I dreamt we ran out of paper and had to write our reports on banana leaves! To prevent this tropical nightmare from becoming a reality, could you kindly send me an up-to-date list of our paper stock?

Next on the agenda, I've been feeling a bit lonely in my ivory tower and thought it would be a great idea to have a meeting with all the regional managers this week. I promise, no trust falls or awkward ice breakers, just good old-fashioned business talk. Please organize this meeting at a time that suits everyone.

Lastly, I've been hearing whispers about the company-wide AI workshop that took place at your office. I'm curious to know how it went. Did the machines rise against their human overlords or are we still safe? Please share your thoughts and any feedback you received.

Looking forward to your prompt response. Remember, the fate of our paper supply, the success of our meeting, and the future of humanity (in relation to AI) rests in your hands. No pressure!

Best,

[Your Name] [Your Position]

The AI easily writes an email that is both humorous and professional. By modifying the prompt, we can make it change the style as we see fit. We can even make it copy how we read. We can also make it edit emails that we have already written! With all of these abilities, Gen AI saves us hours in email writing each week. See this article for more information on writing emails with Gen AI.

Ethos and Philosphy

We will now give a broad overview of the rest of the course, including our ethos and philosophy, our teaching style, and a list of modules. This course is open source (anyone can see the code), and built by a diverse community of researchers, translators, and hobbyists. We believe that AI should be accessible to everyone, and that it should be described clearly and objectively. To this end, we have written a comprehensive course that is free of excessive jargon and hype.

We have found this approach to be appreciated by the prompt engineering community: This course is cited by Wikipedia, and is used by people at companies such as O'REILLY, Scale AI, and OpenAI. You may also notice that almost every other prompt engineering video and guide uses material from this course. We are honored to support the prompt engineering community, including our 1.3M+ users and 40K+ Discord members.

How We Teach

Our approach to teaching prompt engineering is guided by three fundamental principles. We emphasize practicality; we focus on research backed, practical techniques that you can immediately incorporate into your projects and applications. We always include accessible examples, which clarify how and when to use different techniques. Finally, we believe strongly in collaborative learning. You can join our Discord community to find a learning buddy or ask questions. Some readers find that posting about their learning journey on Twitter helps them learn faster. Tag us @learnprompting!

Modules

Basics: Introduction to prompt engineering and fundamental techniques
Applications: Simple, practical applications of prompt engineering
Intermediate: Research-based PE techniques with moderate complexity
Applied Prompting: Comprehensive PE process walkthroughs contributed by community members
Advanced Applications: Powerful, and more complex applications of prompt engineering
Reliability: Enhancing the reliability of large language models (LLMs)
Image Prompting: Prompt engineering for text-to-image models, such as DALLE and Stable Diffusion
Prompt Hacking: Hacking, but for prompt engineering
Tooling: A review of various prompt engineering tools and IDEs
Prompt Tuning: Refining prompts using gradient-based techniques
Miscellaneous: A collection of additional topics and techniques related to prompt engineering

Article rating system

We have implemented a rating system for articles based on their level of difficulty and the extent of technical knowledge needed:

🟒 Beginner; no programming required
🟦 Easy; basic programming knowledge necessary, but no specialized expertise
β—† Intermediate; programming skills and some domain knowledge required (e.g., calculating logarithmic probabilities)
β—†β—† Advanced; programming expertise and in-depth domain understanding needed (e.g., reinforcement learning techniques)

Please note that even for β—† and β—†β—† articles, you can generally grasp the content without prior domain expertise, though it may be helpful for implementation.

Feedback

The single most important part of this course is your feedback!


If you have any questions, comments, or suggestions, you can:

Your feedback helps us improve the course for everyone.

Conclusion

It is time to get started with your Generative AI learning Journey. Click the "πŸ˜ƒ Basics" button at the bottom right of this page to continue.

Prompt engineering (PE) is the process of **communicating effectively with an AI to achieve desired results**. As AI technology continues to rapidly advance, the ability to master prompt engineering has become a particularly valuable skill. Prompt engineering techniques can be applied to a wide variety of tasks, making it a useful tool for anyone seeking to improve their efficiency in both everyday and innovative activities.

Sander Schulhoff

Sander Schulhoff is the Founder of Learn Prompting and an ML Researcher at the University of Maryland. He created the first open-source Prompt Engineering guide, reaching 3M+ people and teaching them to use tools like ChatGPT. Sander also led a team behind Prompt Report, the most comprehensive study of prompting ever done, co-authored with researchers from the University of Maryland, OpenAI, Microsoft, Google, Princeton, Stanford, and other leading institutions. This 76-page survey analyzed 1,500+ academic papers and covered 200+ prompting techniques.

πŸ›Έ Additional Resources

πŸ€– АгСнты

πŸ’Ό Applications

πŸ˜ƒ Basics

πŸ“š Bibliography

✨ Credits

πŸ”₯ Hot Topics

πŸ–ΌοΈ Image Prompting

πŸ§™β€β™‚οΈ Intermediate

🎲 Miscellaneous

πŸ“¦ Prompted Products

πŸ”“ Prompt Hacking

βš–οΈ Reliability

πŸ”¨ Tooling

πŸ’ͺ Prompt Tuning

πŸ“™ Vocabulary Reference

Footnotes

  1. Captain, S. (2023). How AI Will Change the Workplace. Wall Street Journal. https://www.wsj.com/articles/how-ai-change-workplace-af2162ee ↩

  2. Generative AI already appears to have claimed some jobs(@VermaVynck_2023), and slowed hiring at Bloomberg. However, consider the news on its impact with a grain of salt. We expect more jobs to be _changed rather than lost. ↩

  3. We have read 100s of research papers and articles to find the best techniques. ↩

  4. The AI used here is GPT-4. ↩

  5. Ford, B. (2023). Bloomberg.Com. https://www.bloomberg.com/news/articles/2023-05-01/ibm-to-pause-hiring-for-back-office-jobs-that-ai-could-kill ↩