Published On: December 3rd, 2023 | By | Categories: AI | 10.3 min read |

AI Conversations: A Primer

AI is becoming more than just a buzzword, and conversational AI tools like ChatGPT are increasingly part of our day to day lives.

I use them every day. I’ve built a custom AI called “Metis” (inkeeping with my theme of giving these tools names relating to ancient greek gods – in this case, the god of wisdom, prudence and, in a lovely nod to Douglas Adams, deep thought), but I also regularly use ChatGPT and other tools. It just depends on what I’m working on.

I’m doing a session at work soon on how professionals can use these tools, and I thought it might be useful to do one for day to day life too. They make doing tons of things a load easier, and in my experience I’m a lot more efficient and productive with my time now than I ever was before.

However, the effectiveness of your interactions completely hinges on the quality of your prompts.

If you just want to skip to the good prompt/bad prompt examples, click here.

The Art of Prompt Engineering

The art of - DALL·E 2023-12-03 19.30.09 - Square image for a blog post titled 'Understanding Prompt Engineering_ What is it_'. The image should be a modern, abstract representation of AI in th

I’m convinced that prompt engineering is going to become a basic life skill, taught to kids in schools from a really young age. It’s based on the ‘art’ of crafting questions or statements to get the most accurate and useful responses from AI tools.

Over the last year or so some best practices have emerged, and I’ve stumbled across some useful approaches on my own, and I’m going to take you through some of them now. There’s a bit of a knack to it…

Understanding Prompt Engineering

What is it?

I tend to think of it as providing really clear instructions to an incredible capable, but very literal-minded personal assistant.

I explain what I’m looking for in the same way I would a person that has no context around what I do, or any idea of what I’m thinking about. The quality of the responses you get is directly proportional to your prompt’s precision.

The Anatomy of a Good Prompt

I’m going to give you some examples below, but this is the basis structure and general gist of a good opening prompt”

  • Role/Identity: This defines the persona you want the AI to emulate. By specifying a role, such as ‘legal expert’ or ‘python coding instructor’ or ‘expert home chef’ you’ll setting the tone and expertise level of the AI.
  • Context: Here, you’re providing the backdrop of what you’re looking for. Think about all the relevant details. It’s a bit like the beginning of a novel, where the author will do ‘world building’ – explaining the who, what, where, and why of the story. Try to talk to it like you would if you were briefing a person on your project, idea, or task.
  • Prompt/Query: This is the crux of the prompt – the specific question or task you’re asking it to do. It’s like giving them a really clear job description, the same as you would an employee. If you don’t give people clear boundaries and requirements, you won’t get what you want. Be specific.
  • Output Format: This isn’t mandatory, but you can define how you want the output to be formatted. I tend to use lines like “format for human readability” and “use bullet points, bold headers, italics as appropriate.” You can guide the AI to not just give you what you want, but how you want it – maybe you want a report style output, or a list, or step-by-step instructions, etc.
  • Examples: This is level two prompting. Technical people often call this ‘few-shot learning.’ It’s where you give the AI an example output from something else that’s potentially unrelated. You can almost run the AI through a mini-training session on whatever it is you’re doing. This comes into its own when you iterate through it’s first few responses, which are rarely perfect. I’ll give you some ideas below.

If you use that structure for your intial prompt all the time, every time, I promise you’ll get spectacular and occasionally scary-good results.

It’s the difference between using them as blunt tool or a search engine, vs buying a precision instrument that’s carefully designed to carry out whatever task it is you’re working on.

The Follow Up – Iteration

Image Prompt: A portrait-oriented image for a blog post, visually representing a conversation with AI in a human-like manner. Include elements that symbolize a dialogue between a human and AI, such as speech bubbles or a digital chat interface. Illustrate the concept of politeness affecting the conversation, perhaps through visual metaphors like a brighter interface when 'please' and 'thank you' are used. Incorporate subtle references to AI learning and adapting, like neural network patterns or adaptive pathways. The style should remain consistent with the previous image: modern, abstract, and with a color palette of blue, silver, and black. Ensure the composition is simple yet expressive, suitable for viewing on a phone screen.

* So close DALLE, so close…

Once you’ve kicked off the conversation, talk to it like you would with a person you’re asking advice for. Treat it like a normal human chat, not a computer or search engine. Ask follow up questions, tell it what you like and don’t like, ask it to work through specific concepts with you… just have a chat, guiding it through to what you want.

The Power of Politness

I’m resisting the urge to make a joke about being polite to our future AI overlords, but bear in mind that some research (and my personal experience) suggests that saying ‘please’ and ‘thanks’ will get you better results.

There are various theories around why this is effective…

  • Better Advice – It steers the AI to parts of ‘brain’ (technically, areas in it’s neural network) that contain better advice. It turns out polite people tend to be smarter and more rational, which is interesting in itself.
  • Reinforcement – Saying ‘thanks’ or ‘that’s great’ indicates to the AI that its on the right track. It acts as reinforcement on good responses, guiding the AI towards what you want. Equally, calling out things you don’t like will cause it to diregard those areas in later parts of the conversation.
  • Cooperation – ‘Please’ will get your more cooperative responses that are more in line with what you’re looking for. These tools been trained on trillions of words, and they can pick up on subtle language cues, including basic manners. Using a polite, cooperative tone will give you more positive results, just the same as with a person.

It also strikes me that as we use these tools more and more, they’re going to influence our conversations with humans. What happens if kids are taught to be direct, impolite, rude and demanding? AI’s might not have emotions, or be ‘changed’ by basic manners from their operators, but our brains can be.

Real World Examples

Example 1: Recipe Recommendations

Bad Prompt: “I want to cook something.”

Good Prompt:

“Acting as an expert home cook, for someone who enjoys vegetarian Italian food and has only 30 minutes to prepare dinner, could you recommend a recipe including a list of ingredients and step-by-step instructions?”

The breakdown:

  • Role/Identity: “Acting as an expert home cool,”
  • Context: “for someone who enjoys vegetarian Italian food and has only 30 minutes to prepare dinner,”
  • Prompt/Query: “could you recommend a recipe,”
  • Output Format: “including a list of ingredients and step-by-step instructions?”
  • Examples: You could point at recipes you like from the BBC’s Good Food guide, providing URL’s to recipes you love.

If you’re using the subscription, paid-for version of ChatGPT, which includes it’s GPT-Vision tool… you could take a picture of your fridge and cupboards, and ask it to only give you recipes you can cook right now.

GPT-Vision is blowing my mind on a daily basis at the moment, and you could incorporate the picture technique into lots of use cases.

 

Example 2: Holiday Planning

Bad Prompt: “I want to go on holiday. Where should I go?”

Good Prompt:

“Acting as a travel planner, for a 3-day family trip to Paris with a focus on child-friendly activities, can you create an itinerary including daily schedules and accommodation suggestions?”

The breakdown:

  • Role/Identity: “Acting as a travel planner,”
  • Context: “for a 3-day family trip to Paris with a focus on child-friendly activities,”
  • Prompt/Query: “can you create an itinerary,”
  • Output Format: “including daily schedules and accommodation suggestions?”
  • Examples: Show it holiday sites for hotels you like, describe places you’ve been before and what you loved about them.

Again, GPT-Vision can further enhance things. You could show it holiday snaps of places you’ve been, telling it you want the same sort of location and scenary, or screenshots of maps showing points of interest you want to visit, then get it to create an itinerary for you.

 

Example 3: Technical Support Query

Bad Prompt: “My computers running really slow.”

Good prompt:

 

“Acting as a tech support specialist, my 2019 MacBook Pro running macOS Monterey is experiencing lag with multiple browser tabs open, what troubleshooting steps should I take, and could you provide a prioritised list?”

 

The breakdown:

Good Prompt:

  • Role/Identity: “Acting as a tech support specialist,”
  • Context: “my 2019 MacBook Pro running macOS Monterey is experiencing lag with multiple browser tabs open,”
  • Prompt/Query: “what troubleshooting steps should I take,”
  • Output Format: “and could you provide a prioritised list?”
  • Examples: Copy and paste some of those error messages your computer sometimes gives you. They look like gibberish to most normal people, but it’ll help your AI figure out what’s going on, then give you approriate advice.

Example 4: Learning a New Skill (e.g., Coding)

Bad Prompt: “I want to learn something new.”

Good Prompt:

“Acting as a coding instructor, for a beginner with a goal to learn Python within 4 weeks, please provide a learning plan including resources and a weekly schedule for 10 hours per week.”

The breakdown:

  • Role/Identity: “Acting as a coding instructor,”
  • Context: “for a beginner with a goal to learn Python within 4 weeks,”
  • Prompt/Query: “please provide a learning plan,”
  • Output Format: “including resources and a weekly schedule for 10 hours per week.”
  • Examples: Point it at courses you’ve done in the past that you’ve liked. Tell it you like to learn by reading books, or websites, or by watching videos, or a mixture of both.

 

More Tips

A few more tips before I go…

  • Conciseness *and* Completeness – Don’t be terse, instead provide it with all the necessary details.
  • Relevance Is Key Include information that’s directly related to the task at hand. Irrelevant details can and will confuse it, the same as it would a real-world, 3D person.
  • Ambiguity Is your Enemy – Avoid open-ended questions unless you’re looking for a range of ideas and really want to explore a broad concept. They’re great at this, but the prompt structure above is still crazy useful in this context. Tell it you want to explore ideas, and explain you want to work through them ‘step by step’ for a really good output.
  • Know your AI’s Limits – This is something that comes with a bit of experience, but understanding what these tools can and can’t do is key to avoiding disappointment. I see this a lot with new users and it can turn people off from using them. Just try to ensure your prompts are realistic and within the scope of their capabilities.

    This is a moving target at the moment, as new capability is appearing pretty much daily, and it’ll depend on the tool your using. For example, if your organisation uses Microsoft Co-Pilot then you *can* use it to schedule meetings, whereas ChatGPT can’t help you with that.

Conclusion: Mastering the Conversation

experimenttion - DALL·E 2023-12-03 20.24.51 - Voxel art style image embodying the themes of practice and experimentation in mastering prompt engineering, without any words. Visualize the iterative

Prompt engineering isn’t just a skill, but it’s an essential practice for pretty much everyone now. It’s maybe a bit like learning an instrument? I started by learning Wonderwall and Brainstew by Green Day (which I was alarmed to find out is now classified as ‘classic rock’), but over the years, with practice and time, you’ll get better.

Truth be told… I’m not much better at the guitar than I was as a 16 year old, largely because I don’t play enough and don’t treat it as an essential practice in my daily life. 🤷‍♂️ 🤣

However, my poor guitar skills aside…. the analogy stands – experiment, practice, focus on crafting clear, specific, and context-rich prompts, and you’ll have an increasingly good time.

Keep it up, practice, and pretty soon you’ll be teaching other people how to talk to AI’s. ;-)



No AI was used in the writing of this post. The words are all mine. I’m enjoying writing too much to outsource it.

All images were generated by DALLE3/ChatGPT Plus. Prompts are in the image tags/overlays.