How to talk to AI
We're finally in the age where we can talk to machines. This newsletter aims to help you be good at it.
Why prompt engineering?
Large language models (LLMs) like ChatGPT are a major technology breakthrough that will impact all aspects of our lives. With AI now capable of passing the Turing test with flying colors, mastering these tools will be a new super power. The key to unlocking their potential lies in understanding how to communicate effectively with these models.
The foundation of this communication is the prompt: the input you provide to the model. The quality of the output you receive is often determined by the quality of the input you provide. Since we are interacting with machines, knowing how to create the most effective prompts is essential.
In this newsletter, I will share experiences on how to engineer prompts. This is a rapidly moving space, which is why a newsletter format seems like a great format. My goal is to share with you what I’m learning, as I use LLMs on a daily basis, both personally and professionally.
Who you are
I assume you're interested in using LLMs in your daily life and are comfortable using ChatGPT. We'll occasionally explore programmatic approaches to prompt engineering, but even if you don't code, you should still find value in the content.
While I can't commit to a specific posting schedule, I anticipate sharing updates at least once a week, possibly more frequently depending on my discoveries.
Two types of posts
How we interact with this new kind of AI will change dramatically in the coming weeks, months, and years, and there will be much to talk about from a general point of view. This content should be as broadly available as possible. I’ll also have a paid subscription, where posts will focus more on the concrete suggestions and tips on how to use this technology to the greatest benefit of what you’re trying to achieve.
Let’s start with an example.
Better English, but in your style
I’m not a native English speaker. While my English is generally good, it occasionally contains mistakes. LLMs can improve texts, but if not used carefully, they may completely rewrite them, potentially losing the original 'voice' of the author. Perhaps you don’t care, but I do. We all write in different styles, and I’d like to keep mine.
Let’s take a text I recently drafted as an example:
Autonomy refers to the idea the people should be able to make informed and voluntary decisions with respect to their health. We have previously discussed the idea of informed consent - this is the key principle underlying the development of informed consent. Participants of research studies should understand what is being researched, what they are asked to do, any risks or benefits, and they should be able to make this decision without any outside influence. They should also be able to revert that decision later on if they decided to do so.
A first idea could be to ask ChatGPT to simply rephrase the text, under the assumption that ChatGPT’s English is perfect. Going to ChatGPT with the following prompt:
Please rephrase
gives us the following output:
Autonomy embodies the notion that individuals should be capable of making well-informed and voluntary choices concerning their health. In previous discussions, we touched on the concept of informed consent, which serves as the foundational principle for its implementation. Participants in research studies should be aware of the research focus, their expected tasks, potential risks or benefits, and should make decisions free from external interference. Additionally, they should retain the option to reverse their decision at a later point if they wish to do so.
I’ve highlighted all the changes in bold. You will notice that the text is still saying the same thing. But my voice is gone.
The alternative prompt that I’ve found to be very useful is to simply ask, “is this text in correct English?”. Given this prompt, the answer is as follows:
Yes, this text is in correct English. However, there is a slight repetition in mentioning the idea of informed consent. Here's an alternative version with improved flow:
Autonomy refers to the idea that people should be able to make informed and voluntary decisions with respect to their health. Informed consent, which we have previously discussed, is the key principle underlying this concept. Participants of research studies should understand the subject being researched, their expected tasks, any risks or benefits, and they should be able to make decisions without any outside influence. They should also have the option to reverse their decision later on if they choose to do so.
As you can see, there are far fewer changes, and they are more subtle. In addition, ChatGPT informs me that the English is in principle formally correct, but makes some suggestions for improved flow. I would probably accept most of these edits, if not all of them.
In short, never explicitly ask ChatGPT to rephrase, reformulate, or rewrite. Instead, ask if the English is correct, if anything can improved, and so on. I’ve found that these prompts make ChatGPT much more respectful of the original text.
This is important, because your style is yours, and it makes it unique. While I believe that it’s impossible to tell the difference between AI-generated and human-generated text with any meaningful accuracy, the “standard” style that ChatGPT uses seems quite convoluted, and void of personality. This is perhaps not surprising, as it has been trained on millions of text documents. Its standard output is almost certainly a bland mix free of any identify.
We’ll revisit style questions many times in the future. Being able to make ChatGPT express itself like you is important if you want it to write on your behalf.
Great piece! I totally agree that it's crucial to use these tools in a way that lets us keep our unique voice and tone.
Your post also inspired me to finally write a piece that I've been contemplating for a while now. Keep up the great work! ;)