Prompt Engineering Fundamentals - Generative AI For Beginners (v1)
Tags: opensource, ai, beginners, thisweekinai
Published: 2024-03-01 02:30:14

---
title: Prompt Engineering Fundamentals - Generative AI For Beginners (v1)
published: true
description: Want to learn about #PromptEngineering from core concepts to best practices? Explore the https://aka.ms/genai-beginners open-source curriculum & skill yourself up with lessons and hands-on exercises.
tags: opensource, ai, beginners, thisweekinai
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dz3elf97v1vb5ts9vcwv.png
series: This Week In AI News
---

**3 Resources to Jumpstart Your Generative AI Journey:**

1. [Generative AI for Beginners Curriculum](https://aka.ms/genai-beginners) 
1. [Build Generative AI Apps Code-First With Azure AI](https://aka.ms/ai-studio/collection)
1. [Responsible AI Resources For Developers](https://aka.ms/rai-hub/collection) 

---

Welcome to the sixth post in my [This Week in AI News](https://dev.to/nitya/series/25819) series! Today, I want to talk about [Generative AI For Beginners](https://aka.ms/genai-beginners) - from prompt engineering to fine tuning. Let's dive in!

_I was out on vacation so this post and the next are being published together today instead of on their regular cadence. They are related though, so hope you find them useful_.

---

## Skilling Up on Generative AI

By now you've probably asked ChatGPT to answer a question, or asked Bing Create to generate an image, or asked GitHub Copilot to explain some code to you. These are all examples of _generative AI_ experiences driven by large language models (LLMs). 

But what exactly does an LLM do? And how does a generative AI solution differ from traditional AI/ML applications that we've built before? What are the **fundamental concepts** to know, and how can you **apply these concepts** to build real-world applications? 

These are some of the questions we tried to answer in the [Generative AI For Beginners](https://aka.ms/genai-beginners) curriculum that was released as an open-source series of _12 lessons_ (v1) last October. Each lesson covers a core topic and provides an assignment to help reinforce the ideas you learned.

![Gen AI For Beginners V1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/500ueokzqeciikx8xgws.png)

Since the launch, ~25K users have starred the repo, with many users also contributing issues, translations, fixes and suggestions to help us improve this. It is now the [#1 "generative-ai" repo](https://github.com/topics/generative-ai) on GitHub.

Today, I'll focus on the lesson I contributed to this curriculum - the chapter on [**Prompt Engineering Fundamentals**](https://github.com/microsoft/generative-ai-for-beginners/tree/main/04-prompt-engineering-fundamentals) - that sets the stage for the rest of the course.

---

## What Is Prompt Engineering?

Generative AI applications differ from traditional AI experiences in many ways - but a key aspect is their use of Large Language Models (LLM) to _understand natural language_. This allows users to engage with the applications using text inputs (or "prompts") in a conversational manner ("chat") that feels natural.

Understanding how prompts work is critical to building reliable applications that deliver quality responses to the user. The visual below shows how these concepts are connected - but what exactly does prompt _engineering_ mean, and why do we need it?

![Core Concepts](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o6d6b22sw9ol5py8x2f5.png)

---

## Review: Illustrated Guide

The lesson is structured in the following sections, taking you from core concepts to best practices for prompt engineering. Check out the illustrated guide below for more details on what each section covers: 

| Topic | Description |
|:---|:---|
|**Core Concepts** | explains key terms including _tokenization_, that are critical to prompt usage |
| **Core Challenges**| tells you why prompt _design_ is critical to getting better quality responses |
| **GitHub Copilot** | provides a real-world case study that illustrates prompt engineering examples |
| **Prompt Construction** | describes the components of a prompt, and how complex prompts are designed|
| **Primary Content** | highlights a number of prompt design patterns that improve quality of responses|
| **Advanced Techniques** | shows how to improve quality by having the model critique or explain itself. |
| **Best Practices** | wraps up the lesson by looking at the end-to-end application lifecycle and workflow |

![Prompt Engineering Sketchnote](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tlw4v4rsnhn6q86istn5.png)

---

## Watch: Lesson Walkthrough

Want to get a better sense of how the lesson maps to _applied usage_ of the concepts? Check out the slides in the presentation below, which walk you through the lesson with practical examples and hands-on exercises you can try out on Azure OpenAI or OpenAI playgrounds.

{% speakerdeck  46d725da232b45f591912d7d389c781e %}

The lesson also comes with a recorded walkthrough of the slides that serves as an instructor-guided walkthrough of the lesson.

{% youtube R3sHRPP2G7A %}

Finally, the lesson comes with an interactive assignment using the Jupyter Notebooks runtime. You will need an Azure subscription (with access to Azure OpenAI) or an OpenAI account (with a valid API KEY) to work through the exercises. The repository is setup for use with GitHub Codespaces - so you have a pre-built dev environment with no effort needed on your part.

---

## Summary & Next Steps

Once you complete the Prompt Engineering Fundamentals lesson (chapter 4), continue on to the _Advanced Prompting_ lesson (chapter 5) that walks you through techniques like _chain of thought prompting_. Then continue on to see how you can build different generative AI experiences - from chat applications to search, text and image generation. You can also explore _low code_ options and learn how to integrate external applications with _function calling_.

The v1 edition of the curriculum covered chapters 1-12. In my next post below, I'll explore the v2 edition (chapters 13-18) that was just released in February - and talk specifically about **Fine Tuning**, an approach that can help you improve the quality or cost of your generative AI application when prompt engineering alone is not effective enough. 

{% link https://dev.to/azure/fine-tuning-fundamentals-generative-ai-for-beginners-v2-3lf9 %}

Until then, [fork the repo](https://github.com/microsoft/generative-ai-for-beginners/fork) to your profile, and get started exploring the lessons!! Happy learning!

---

**3 Resources to Jumpstart Your Generative AI Journey:**

1. [Generative AI for Beginners Curriculum](https://aka.ms/genai-beginners) 
1. [Build Generative AI Apps Code-First With Azure AI](https://aka.ms/ai-studio/collection)
1. [Responsible AI Resources For Developers](https://aka.ms/rai-hub/collection)