5 Principles for Writing Effective Prompts

How to get the most out of ChatGPT

Read time: 5 minutes

Hey there,

Welcome to all new readers who joined this newsletter after my recent LinkedIn post on prompt techniques (Hi! 👋 ).

Due to the overwhelming interest, I've decided to dive deeper into the topic and share my top 5 principles for writing effective prompts. I'll cover the originally planned topic for today, the updated "AI for BI Value Framework", next week.

Back to ChatGPT: When used correctly, it can really increase your productivity by 10x - I use it myself every day for writing, coding, or just getting through the day. However, many beginners throw a one-liner into the prompt and are disappointed when they get mediocre outcomes.

Let’s find out how to change that!

Prompt Engineering Is Real

I must admit, I was skeptical at first. I thought prompt engineering was just another buzzword.

After all, the whole point of ChatGPT is to make it easy to use without worrying too much about what you input.

But it turns out that what you input makes a big difference.

For most beginners, the first few rides with chatGPT are exciting, but then they quickly get frustrated because their answers are mediocre, repetitive, boring, and not useful. I had to learn my lessons here as well.

The problem is in the prompt. Most beginner prompts are simply

  • too vague

  • lack context

  • ask for too much

  • not structured properly

However, I don't believe you need to buy expensive prompt engineering courses or spend weeks on the Internet to figure it all out. In my experience, it comes down to a few basic principles that just need to be executed well.

Let's go through these principles step by step.

Principle 1: Make your prompt as specific as possible

If your prompt is not specific, your result will be mediocre per definition.

ChatGPT does not know what you want. It (luckily) doesn't know what's going on in your head.

Here's a bad prompt example:

Make this SQL code better.

This prompt is pretty poor.

ChatGPT does not know…

  • what you mean by "better"

  • what you're trying to achieve

  • what limitations you're working with.

So you have to tell it.

Here's an example of an improved prompt:

I'm using PostgreSQL and would like to optimize the following SQL query. My goal is to reduce the execution time and also to make it easier for other developers to understand. Please use comments where appropriate. Before you rewrite the code, please explain the steps you would take to optimize it.

The example above shows how a more specific prompt can help ChatGPT better understand your needs and goals, leading to more useful results.

Principle 2: Don't let ChatGPT do the thinking

Most people make the mistake of letting ChatGPT think for them. This is a huge mistake.

I know, it’s called Artificial Intelligence, but actually, it’s pretty dumb. It can only work with the information you provide it.

But it can execute like hell.

So you just have to tell it what to do.

Here is the deal:

YOU do the thinking.

ChatGPT does the doing.

So in your prompt, give ChatGPT the mental framework it should work with.

Bad example:

I want to develop a new Saas application. Give me some ideas.

Better example:

My goal is to build a new SaaS application. To do this, I need to build something that my users will find valuable. My ideal users are social media managers from companies with 5M+ - 50M annual revenue who primarily work with LinkedIn, Facebook, and Instagram. Please use the Jobs-To-Be-Done framework to outline the key features and benefits that would appeal to this target market.

By following principle 2, you can ensure that ChatGPT works within the mental framework you provide, leading to more useful and relevant results.

If you don't find the results helpful, you can either modify the framework or make the prompt even more specific to your needs.

Principle 3: Break large tasks into small pieces

That’s the most common mistake beginners make.

They put a huge task into the prompt like:

Write me an Airbnb clone web app

That’s too much all at once.

It literally takes hundreds of steps to get there.

For ChatGPT to be able to provide useful and relevant results, it's better to break the task into smaller pieces. This will allow ChatGPT to focus on each step and provide more targeted information.

For example, if your goal was really to build an AirBnB clone web app, you could ask ChatGPT to take the character of an experience software developer focused on web applications first (we want to be specific!) and then ask it to come up with an architecture for the web app.

Or you could ask it which steps to take in order to get to this goal.

This also allows you to control the process where needed.

This working mode is called chain of thought reasoning and that's where ChatGPT can be really good at as this thread shows:

Principle 4: Use structured prompt formats

This is something I just discovered very recently.

Using structured prompt formats can significantly improve the quality of results obtained from ChatGPT.

I used to write my prompts in regular text format, which also works pretty well.

However, these are hard to maintain once they become more complex. If you want to make changes, you need to go through the whole text which becomes hard to read.

A better approach is to provide the prompt in a JSON or YAML format as done in the example from this post:

PRO TIP: Minify the prompt to save some extra characters! (credits to Jonathan Besomi!)

Principle 5: Build your prompt library

There’s no way you can build a prompt like the one above from scratch in one go.

Building a prompt like this is work. It takes time. And with every iteration it (hopefully) gets a little better.

To be able to iterate, you need a library where you can store your most popular prompts so you don't have to start with a blank screen.

Hint: You will probably end up using chatGPT for the same tasks over and over again anyway.

So store prompts that worked well for you in a library.

This library doesn't have to be fancy. For example, I keep a simple Notion document where each template contains:

  • Title

  • Prompt

  • URL linking to the chat where I used the prompt

Whenever I improve the prompt, I update the library.

Simple as that.

That’s it!

I hope you found these principles helpful in getting the most out of ChatGPT. The key to mastering ChatGPT is to really get hands-on. I don't think you can master it by reading about it.

Try it out, try to improve, and see what other people are sharing online.

That's what I found to be the most effective tactic for me.

As always, thanks for reading.

Hit reply and let me know what you found most helpful this week—I’d love to hear from you!

See you next Friday - with my updated AI for BI Value Framework :)

–Tobias

Want to learn more? Here are 3 ways I could help:

  1. Read my book: Improve your AI/ML skills and apply them to real-world use cases with AI-Powered Business Intelligence (O'Reilly).

  2. Book a meeting: Let's get to know each other in a coffee chat.

  3. Follow me: I regularly share free content on LinkedIn and Twitter.

Reply

or to participate.