Skip to content

Commit 365ffe3

Browse files
committed
Chapter 4 Content Complete
1 parent 1c6dd56 commit 365ffe3

29 files changed

+243
-110
lines changed

.env.copy

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
OPENAI_API_KEY=

4-prompt-engineering-fundamentals/4.0-introduction.md

+26-17
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,39 @@ CODE CHALLENGE:
1111
If provided, should have an education focus - help show how the concepts can be applied to make the lives of teachers and students easier.
1212
-->
1313

14-
## 4.1 Introduction
14+
We know that _Generative AI_ is capable of creating new content (e.g., text, images, audio, code etc.) in response to user requests. It achieves this using _Large Language Models_ (LLMs) like OpenAI's GPT ("Generative Pre-trained Transformer") series that are trained for using natural language and code.
1515

16-
Our education startup is focused on ways in which we can [bring AI innovation to education](https://educationblog.microsoft.com/2023/06/collaborating-to-bring-ai-innovation-to-education) to support _administrators, educators and students_ with generative AI experiences. We're focusing on **personalized learning experiences** that can be activated with natural language (chat) interfaces so our users don't need any technical expertise to start using them.
16+
Users can now interact with these models using familiar interfaces & paradigms ("chat") without needing technical expertise or training. The models are **prompt-based** - users send a text input (or "prompt") with a request, and the AI responds with a text output (or "completion"). Users can then "talk to the AI" iteratively, in multi-turn conversations, to refine that prompt till the returned results meet their expectations.
1717

18+
Prompts are now the primary "programming interface" for generative AI apps. They tell the model what to do - setting model weights and influencing its resulting behaviors. **Prompt Engineering** is now a fast-growing field of study focused on the _design and optimization_ of these prompts to drive improved user experiences and response quality at scale.
1819

19-
By now, we're familiar with these two terms:
20-
- **Generative AI** - is a category of artificial intelligence capable of _generating new content based on pre-trained models_ - in response to a natural language input or "prompt".
21-
- **Large Language Models (LLM)** - are a type of generative AI trained on massive quantities of text data to execute natural language processing (NLP) tasks at scale.
2220

23-
In this lesson, we're going to introduce a third term - **Prompt Engineering** - that reflects a new field of engineering focused on _more effective prompt design_ with tools and techniques to guide LLMs to deliver more relevant and consistent results for our generative AI applications.
24-
- We'll define prompt engineering - and motivate the need to design better prompts.
25-
- We'll explore prompt usage with examples - and understand opportunities and limitations.
26-
- We'll explore design techniques - and iterate and validate prompts to meet expectations.
21+
## Learning Goals
2722

23+
In this lesson, we learn what Prompt Engineering is, why it matters, and how users can learn to craft more effective prompts for a given model and objective. We'll discuss best practices for prompt engineering, and learn to use an interactive sandbox (with Jupyter Notebooks and an OpenAI or Azure OpenAI API endpoint) to explore prompt engineering techniques interactively, with real examples.
2824

29-
## Learning Goals
25+
By the end of this lesson you will be able to:
26+
1. _Define Prompt Engineering_ - Explain what it is & why it matters.
27+
1. _Describe Prompt Components_ - Understand prompt structure & usage.
28+
1. _Learn Best Practices_ - Know basic prompt engineering strategies & tactics.
29+
1. _Apply Learned Techniques_ - Work through real examples in interactive exercises.
30+
31+
## Learning Sandbox
32+
33+
The key takeaway fromt his lesson is that **prompt engineering is more art than science**. The best way to learn is with a trial-and-error approach that combines your intuition and domain expertise, with the recommended techniques and model-specific optimizations. To help you, we introduce a _sandbox environment_ with three components:
3034

31-
By the end of this lesson we will be able to:
32-
- _Describe Prompt Engineering_ - what it is, and why it matters in generative AI apps.
33-
- _Analyze Prompt Examples_ - to understand best practices & limitations for prompt design.
34-
- _Apply Prompt Engineering Techniques_ - to iterate & validate prompts for response quality.
35-
- _Explore Prompt Engineering with OpenAI_ - using GitHub Codespaces & Jupyter Notebooks.
35+
- Jupyter Notebooks - Python-based prompt authoring & execution environment
36+
- OpenAI API key - Active service endpoint for the LLM (e.g., GPT-3.5, GPT-4)
37+
- Dev Containers - Consistent runtime in GitHub Codespaces or Docker Desktop
3638

37-
Once we get an understanding of prompt engineering fundamentals, we can then answer this question for our education startup:
39+
We provide _starter exercises_ to help you explore these techniques in practice. However, the real value of the sandbox is that you can author new prompts or modify existing ones, then test them interactively, to build your own intuition on effective prompt design.
3840

39-
_How can we engineer prompts to deliver a more reliable and consistent experience for our students, educators and adminstrators using our generative AI app?_
41+
## Our Startup
42+
Before we dive into the lesson, let's think about how this topic relates to our broader mission to [bring AI innovation to education](https://educationblog.microsoft.com/2023/06/collaborating-to-bring-ai-innovation-to-education). Our startup is building a suite of AI-powered applications to drive **personalized learning experiences** and we want to target three kinds of users: _administrators, educators and students_.
4043

44+
Think how these users can "program" our AI-powered applications by authoring prompts focused on accomplishing a specific task or objective. For example:
45+
- An administrator can ask the AI to _analyze curriculum data to identify gaps in coverage_. The AI can summarize results in text, or visualize them with code.
46+
- An educator can ask the AI to _generate a lesson plan for a target audience and topic_. The AI can build the personalized plan and deliver it in a desired format.
47+
- A student can ask the AI to _tutor them in a difficult subject_. The AI can act like a coach, guiding students with lessons, hints & examples tailored to their level.
48+
49+
And that's just the tip of the iceberg. Check out [Prompts For Education](https://github.com/microsoft/prompts-for-edu/tree/main) - an open-source repository curated by experts for use in education applications keeping both prompt engineering and responsible AI practices in mind. Once you complete the code challenge section of this lesson, find more prompts in the repo and try them out in that sandbox.

0 commit comments

Comments
 (0)