McKinsey & Company: What is prompt engineering?

Date: September 22, 2023

Prompt engineering is the practice of designing inputs for generative AI tools that will produce optimal outputs.​

Let’s say you’re making spaghetti marinara for dinner. Sauce from a jar is perfectly fine. But what if you buy your tomatoes and basil from the farmers market to make your own sauce? Chances are it will taste a lot better. And what if you grow your own ingredients from your garden and make your own fresh pasta? A whole new level of deliciousness.

Just as better ingredients can make for a better dinner, better inputs into a generative AI model can make for better results. These inputs are called prompts, and the practice of writing them is called prompt engineering. Skilled prompt engineers design inputs to interact optimally with other inputs in a generative AI tool. These inputs help elicit better answers from the AI model, meaning the model can perform its tasks better, such as writing marketing emails, generating code, analyzing and synthesizing text, engaging with customers via chatbots, creating digital art, composing music, or any of the other hundreds, if not thousands, of current applications.

Let’s look at an example. Say you want a generative AI model to help you promote an upcoming financial-planning workshop with the CFO of your organization, Acme Inc. You provide a generative AI chatbot with a simple prompt: “Write a social post advertising a class.” Here’s the output:

**Elevate Your Skills: Join Our Class!**
Unlock new knowledge, connect with experts, and embrace growth. Limited spots available—reserve yours now!
#LearnWithUs #SkillBuilding #ClassTime

It’s pretty generic and unlikely to generate much interest.

Let’s try again. This time, you make your prompt a little more specific: “Write a short social post advertising a financial-planning workshop with the CFO of Acme, Inc.” Here’s what the model gives you this time:

**Master Your Finances with the CFO of Acme, Inc.!**
Get ready to take charge of your financial future! Join our upcoming Financial Planning Workshop featuring the CFO of Acme, Inc. Gain insights, strategies, and expert advice to secure your financial success.
Limited spots available—don’t miss this exclusive opportunity. Reserve your seat today and pave the way to financial freedom!
#FinancialPlanning #ExpertAdvice #SecureYourFuture

It’s clear that the more specific output has a greater chance of achieving the result you’re after. By creating a more detailed, specific request to the AI chatbot, you’ve just engineered a prompt.

Generative AI has an important role to play in the future of business and society (as well as, maybe, helping you promote any upcoming workshops you may be involved in). But where does prompt engineering fit in? Read on to find out.

More ICT-DM Articles