Prompt Engineering: What to Know and Why It’s Important

Estimated read time 6 min read


In all likelihood, 2024 is going to be the year of AI. With ChatGPT dominating the headlines in 2023 and alternatives like Microsoft’s AI-powered Bing and Anthropic’s Claude popping up all over the place, it’s safe to say that AI — specifically AI chatbots and generative AI — will be front and center this year. 

If you’re hesitant dive into AI, you’re not alone. In 2023, the Pew Research Center found that 52% of Americans were more concerned than excited about AI becoming a part of their daily lives. 

Colorful AI Tips badge, with images of AI-related items Colorful AI Tips badge, with images of AI-related items

Zooey Liao/CNET

Speaking from my own experience, I was incredibly hesitant to even toy around with AI at the beginning of last year. However, once I did, I felt a bit more comfortable using AI chatbots

One thing that helped me become more comfortable with generative AI — which produces text and images by drawing on immense quantities of data — was making sure I was asking it well-constructed questions, or prompts. Much like learning how to ask the right Google search questions to get usable results, “prompt engineering” is the craft — and art — of creating detailed and focused prompts to get generative AI models to actually do what you want them to do. 

Back when Google first hit the scene, you didn’t become an expert in crafting effective search queries overnight, and the same will be true of prompt engineering. It will take time to become a master at building productive prompts for generative AI. If you want to get started with prompt engineering and learn about how to use the AIs in your life a bit more effectively, you’re in the right place. 

I’ve tested an AI use case on a couple of different AI generative models to give you the skinny on how to start on the road to becoming a competitive prompt engineer, no matter which AI model you’re using. For more, here’s what to know about AI on your phones and how Adobe is thinking about AI.

General queries won’t quite cut it

The first thing to know is that writing short, broad prompts will most likely not get you the results you want.

If you ask AI “How can I become fluent in German,” for example, you’ll get a much less focused and effective answer than if you prompt the AI with “I’m a college-educated adult who majored in English, has moderate fluency in Italian, and has taken a single semester of college-level German. I practice my German vocabulary and grammar for about 15 minutes every day. How can I become fluent in German?” 

To help me become a better AI prompter, I decided to prompt the generative AIs for information on something that I know fairly well, so I could assess how elaborating and specifying my prompts resulted in better responses. 

A popular prompt — and as a runner it’s one that I’m especially interested in — is to get help from generative AI to create a training plan for a marathon or half-marathon. 

To start, OpenAI suggests asking ChatGPT “Help me train for a half-marathon.” As I expected, this prompt makes sense as a starting place, but it’s not going to give specific results. ChatGPT, for example, gave me general tips for training such as setting goals and getting proper nutrition and hydration. Note: For this test, I used Red Ventures’ (CNET’s parent company) version of ChatGPT. And I compared the results with Anthropic’s Claude, which took the same general approach — no specific training programs.

screenshot-2023-12-22-at-8-41-41am.png screenshot-2023-12-22-at-8-41-41am.png

OpenAI gave me some basic running advice after I uses a basic prompt.

Screenshot Clifford Colby/CNET

While these aren’t bad places to start, it won’t take me all the way to the finish line of a marathon, which will require a specific program tailored to my fitness and experience, how long I have to train, how I typically like to train and even when and where I”ll be running my race. 

Narrowing your prompts may make a big difference, depending on which model you’re using

For help with prompt refinement, I turned to CNET’s sister site ZDNET for help. ZDNET suggests adding more details to help guide generative AI.

I tried ZDNET’s suggestion next: “I am a beginner runner and have never run a marathon before, but I want to complete one in six months. How can I prepare for a marathon?” In this example, I’m providing the AI with a bit more context to work with, such as a timeframe to train in and a level of experience. 

screenshot-2023-12-22-at-8-44-24am.png screenshot-2023-12-22-at-8-44-24am.png

I guess that’s a little more helpful.

Screenshot Clifford Colby/CNET

Unfortunately, with ChatGPT, the response wasn’t that substantially different. ChatGPT gave me slightly more specific advice, such as to focus on completing the marathon instead of setting a personal record and joining a running community for motivation during training. Inspirational, maybe, but still not hitting the mark.

When I gave Claude the same prompt, I got a bit more. It gave me a pretty bare-bones training program, suggested monthly training goals and even possible workouts I could incorporate into my training. Closer, but still not a full-blown training plan.

The more details, the better

It was time to take my prompt to the next level. In my next shot at an expanded prompt, I added lots of details like: running and training history, age, gender, road conditions and terrain for the marathon and training. 

screenshot-2023-12-22-at-8-47-53am.png screenshot-2023-12-22-at-8-47-53am.png

Now we are getting somewhere. Booking that London flight now.

Screenshot Clifford Colby/CNET

Success! What I got back was a good jumping-off point for a real program I could see myself using (with some tweaks of course). ChatGPT recommended a pretty detailed program, breaking down specific training targets and the pace I could be incorporating in new workouts by month. Claude broke the training plan into weeks, giving me specific workouts I could be focusing on each week, with mileage goals and the frequency I should be running each week. 

I’ll just note that these programs were still not perfectly tailored to me and how I would train, but they were close and I will have a strong starting point for my training. The proof is in the prompt — the more details I added, the more details I got back from ChatGPT and Claude. 

And one last tip: Whether you’re looking for a marathon training program or help preparing a meal, it’s always best practice to be critical of what AI suggests and to do your due diligence — such as checking with a doctor before starting on a strenuous exercise routine — before taking AI’s advice as fact. 

See also: what to know about photography in the age of AI and the biggest AI trends in cybersecurity

Editors’ note: CNET is using an AI engine to help create some stories. For more, see this post.





Source link

You May Also Like

More From Author

+ There are no comments

Add yours