Non-Technical Guide to Prompt Engineering
10 tips to get you started with prompt engineering
Hey — It’s Hussein 👋
First, you may have noticed that this week’s newsletter is going out on Thursday instead of Wednesday. This is going to be the schedule in the future.
I am leading several workstreams at Arta Finance, many of which are approaching big releases soon. I need the extra weeknights to prepare and find time to write an article. 😅
On to today’s topic: Non-technical ChatGPT prompt engineering
I’m calling it non-technical because my focus is on using the ChatGPT App or Website not the playground or API. However, the same principles apply!
Before we begin… a big thank you to:
What is prompt engineering?
The most basic definition of prompt engineering (or prompt design) is the ability to tell an AI like ChatGPT what you want and get the results you expect. You do this by crafting prompts that give the AI the best chance of success.
You can take this further by not only getting expected results but also deciding on how you are getting responses, how long it takes to get a response, what is the cost of the interaction with the AI, how to fine-tune the model, expand on its knowledge, feed it more information and more.
All of that is considered prompt engineering.
Getting started with prompt engineering
To get you started with prompt engineering. Here’s a list of 10 tips to get started with prompt engineering.
We’ll start with simple techniques and get more advanced as we go.
1. Give specific requests
We’ve talked about this one before. Give the AI details and background on your requests and ask for specifics for the best results. For example:
Give the AI context about your request. The more relevant details, the better.
Ask for a specific style or tone (see my list of ChatGPT Styles and Tones for ideas).
Ask for a specific length in response.
Ask for a specific format or provide a template to follow. Do you prefer paragraphs? Bullet points? Lists?
✨ Pro Tip: If you find yourself asking for the same style, tone, length, and format again and again, put those in your custom instructions.
2. Give the AI a role or persona
Start by asking ChatGPT to take on a role or persona and to confirm that the request is clear, then proceed with your request.
3. Clearly define sections of your prompt
Help the AI separate your questions from examples and materials you are giving to it by defining and using quotes or tags.
4. When possible, break up the prompt into multiple prompts or define steps in the prompt
When you ask the AI to do too much in the same prompt, it will sometimes get confused and cause hallucinations. Instead, either break up the prompt into multiple prompts and work on them one at a time or give the AI steps to follow inside of your prompt.
5. Give an example of what you are looking for
When you use the OpenAI Playground or API, you have the ability to give GPT example requests and responses. This is called “few-shot” prompting. The same can be achieved in ChatGPT directly. This allows you to demonstrate to the AI how to respond to a request.
6. Control the scope of where an answer comes from
If you have a specific block of text (or document that you upload with Advanced Data Analysis) that you want to ask ChatGPT questions about. You can control the scope of where ChatGPT can find the answer by specifying it and asking it not to give a response from somewhere else.
✨ Pro Tip: if you are using Advanced Data Analysis, then instead of referring to an article in triple quotes, ask ChatGPT to refer to the document you uploaded.
PS: this is the entry into a concept called Embeddings, which is a way to provide GPT with large sets of data to focus on. If you have questions on this, reply. Happy to chat.
7. Ask for citations when accuracy is critical
Take step 6 further by also asking ChatGPT to cite where in the article or document it found the relevant information. This comes in handy when dealing with legal documents and contracts.
8. Chain your prompts
If you are having a long conversation with GPT that’s been going on for a while, you are going to hit “memory” limits, and you’ll notice that GPT will start forgetting parts of your conversation.
Every few prompts, add a summary of what is relevant to you from the conversation to make sure it keeps going.
See my article on prompt chaining for more on this.
9. Give ChatGPT time to think
Sometimes, you can get much better results for a problem if you ask ChatGPT to work through the problem step by step instead of giving you an answer right away.
10. Ask ChatGPT if it missed aything
Sometimes GPT will give an answer, and if you give it a moment to review its answer, it can provide even more details.
After you receive a response, use this prompt:
Take prompt engineering further
These tips are an introduction to prompt engineering and are meant to be used in the ChatGPT mobile app or website. You can take prompt engineering much further by using the OpenAI Playground or the GPT API.
With the API you can also take advantage of workflow chaining, fine-tuning, embeddings, vector database, integrations and much more.
I’m curious if anyone has tried the “talk and listen” features of ChatGPT yet. I’ve tried it a couple of times but don’t have an actual use case for it just yet. If you have one, let me know.
There is a rumor that OpenAI is working with Jony Ive (former Apple Chief Design Officer) on a new phone powered by GPT. Who knows, maybe with that around, the voice capabilities will come in handy. I am sure it will be better than Siri.
See you next week — Hussein ✌️
P.S. If you’d like to sponsor, reply. 5.5k founders and entrepreneurs are waiting for you.
P.P.S If you live in or visit San Diego, sign up here to be notified of tech and founder mixers I organize in the area. Would love to meet you there.
How did you like today's newsletter?