news

How to get ChatGPT to give you exactly what you want, from a prompt engineer: ‘Think about giving instructions to a child'

[CNBC] AI prompt engineer’s best advice to get exactly what you want: ‘Think about giving instructions to a child’
Klaus Vedfelt | Getty Images

As "smart" and capable as any of the latest AI models might be, they're not mind readers. In order to get the results you're looking for, the tool has to understand what you want. That means being clear, organized, and precise. 

As a prompt engineer, and now a prompt director at an AI startup, the best piece of advice I can give you for writing good prompts is this: Think about giving instructions to a child.

You're talking to a smart kid. One who wants to make you happy and do what you're asking. But the bottom line is, this kid doesn't know everything you do about your task or business. They're limited by their lack of context and previous experience, and it's your job to provide that context.

Get organized

Generative AI models are getting better at handling complex problems, requests, and language. But just because you can send a garbled paragraph of rules and demands doesn't mean you should

DON'T MISS: How to use AI to be more productive and successful at work

Think about how you'd ask a child to do something a little advanced for their age. You could ask a toddler to pick up their toys, make sure everything is back in the right spot, remember to get the toys from the other room, oh and don't forget the puzzle pieces have to be back in the box.

But you'd probably get better results with this set of directions:

I need you to go pick up your toys. That means all your toys, from everywhere in the house. They all need to be back in the correct boxes or in the spot where you got them, not just tossed in your room or in the toy chest.

Putting some thought into how you've laid out your prompt so that the model has a clear objective pays off, particularly as the tasks get more complicated.

Break it down into a list

Any time you have several steps, rules, or guidelines you want the model to follow, think about creating a list instead of rambling on in paragraph form. This keeps you and the model organized. Here's what that might look like with our favorite kiddo: 

I need you to pick up your toys. Here are the steps I want you to follow:

  1. First, go get your toys from the other room so everything is in one place.
  2. Sort all your game and puzzle pieces so they're back in the right boxes.
  3. Put the boxes back on the shelf.
  4. Put any larger toys back in the toy chest.
  5. Make sure any stuffies you're not sleeping with are back on the shelf.
  6. Double check under the bed to make sure you haven't missed anything.
  7. Let me know when you're done, and we can have dessert!

The list is longer, but makes the prompt super easy to follow. It also asked the child to double check their work. Including an instruction like this tends to get more accurate responses from generative AI models.

At work, your prompt might look like this: 

I need you to create a summary and list of action items from our meeting transcript. It must include:

  1. An overview of the major points of discussion
  2. Risks identified
  3. An exhaustive list of action items, including the task owner if clear from the transcript

Be careful to include all the necessary details, and double check that you have not missed any action items before outputting your response.

Use examples and references

If you have examples of what you want the model to do — like using a particular style or tone — include them in your prompt. It could look like this:

Create an Instagram announcement for our new store. This location is much bigger, and we have extended hours from 10 a.m. to 10 p.m. during our grand opening month. Use an exciting tone to reach our main audience, adults with young children. Our ads work best when they sound like Toys "R" Us ads did.

You can experiment to see whether your example provides enough information for the model to create the response you're looking for. 

Combine strategies

You can also use a mix of the above strategies. For example:

I need to write my speech for our annual company event. It should sound like Steve Jobs, if he ran a much smaller company. Here's what it needs to do step by step:

  1. Recognize everyone's hard work.
  2. Praise Jo and Sam for closing the big deal at the end of the year.
  3. Acknowledge the stiff competition from other companies.
  4. Preview our revenue goals for next year and motivate the team to hit them.

The more comfortable you get with generative AI, the more you might be tempted to rely on the model to organize your thoughts for you. And that's even a strategy you could use — prompt the model to organize your prompt for you!

But in the long run, you'll get better results from more complex tasks if you prepare an organized prompt with instructions as clear as ones you'd give to a child.

Kelly Daniel is a leader in AI prompt engineering with extensive experience implementing AI solutions for enterprise businesses. As Prompt Director for Lazarus AI, she develops prompting techniques and new applications for LLMs and cutting-edge technologies like agentic models. She is an instructor in CNBC's online course How to Use AI to Be More Successful at Work.

Want to up your AI skills and be more productive? Take CNBC's new online course How to Use AI to Be More Successful at Work. Expert instructors will teach you how to get started, practical uses, tips for effective prompt-writing, and mistakes to avoid. Sign up now and use coupon code EARLYBIRD for an introductory discount of 30% off $67 (+ taxes and fees) through February 11, 2025.

Copyright CNBC
Contact Us