How to get the best out of your ChatGPT


Dear Reader,

I hope you are doing well. Welcome to this week's newsletter where I reflect on some of things I have been up to within the week.This week I will be providing only technical reflections and the focus is on how to get the best out of your ChatGPT.


Technical Reflections

How to get the best out of your ChatGPT

With the rise of Artificial Intelligence tools as ChatGPT and Bard, an increasing skill that many now need to develop is the skill of "asking the AI tool the right question in order to get the right answers." Those who have played with AI tools understand that it is designed to provide you answers but the nature, quality and robustness of the answers it gives is often dependent on how you ask the question. This has led to a new field associated with current and next milestones of the AI revolution called Prompt Engineering. I first saw this term in Colin and Samir's The Publish newsletter in an article they titled: ChatGPT prompts for creators.

As AI tools as ChatGPT and Bard are mainly neural networks based on machine learning, it is important that you are able to ask them the right command in order for them to extract/compose the right kind of response. These tools, although extremely intelligent, unfortunately cannot help you make up your mind on what you really want. They are not mind readers and so unless you ask the right query, they cannot give you the right answer.

This took me back to the commonly referred description of computers: "garbage in, garbage out." This is also true of AI tools - if you ask a garbage question, you will certainly retrieve a garbage answer. If you are able to 'craft' the right kind of prompt, then you will be able to harness the true value and usefulness of AI tools.

What makes a good AI prompt?

Therefore, since prompt engineering is absolutely important to retrieving the right information from AI tools, so the next question is how do I craft a good prompt. In otherwords, what are the features of a good AI prompt?

1. Specific and detailed

A good prompt must be specific with details of the outcome you want to get. A lot of time, people ask verse terse commands and that is not good for the AI tool. Since it needs to generate answers, you want to position your question within the context of the answer you want. So, the more details you can provide, the better the output you get. Here are a good and bad command

  • Bad prompt: "Teach me how to determine the young's modulus of a metal" - With this prompt, ChatGPT was not able to determine what stage the student is at. So, it went on to give details of the experimental procedure, plotting of graph and then eventually generating the Young's Modulus. It also gave a general (speculative) answer for all metails.
  • Good prompt: "Teach me how to determine the Young's Modulus of steel once I have completed the experiment and plotted the stress strain plot, under isothermal conditions." - This is a good prompt because it was specific (ask about steel) and gave details of what context the answer should be given (after experiments, under isothermal conditions, with stress-strain plots already there.)

2. Humanize the AI

The next feature is that your prompt should aim to bring some 'humanization' to the AI tool. That means that you should encourage the AI to 'act as' or 'behave as a human would' in generating a response. This is essential as it will then provide you answers as you would if consulting an expert in the field or asking for a direction from a stranger. Here are two examples

  • Bad Prompt: "Write a code for determining the area of an octagon" - The problem with this code is that the AI is not able to determine what level the code should be at. It also is not aware what type of code you want. It is not able determine if the octagon is regular or irregular one. The user have also not specified how exactly the octagon would be created i.e. does it require a user input or not, and if so, what input is required.
  • Good prompt: "As a final year student majoring in computational mechanics, write a detailed and fully commented extensive MATLAB code for calculating the area of an irregular Octagon with the user required to specify the edge length of only one of the sides" - All the problems of the first prompt is solved in the second prompt.

So, you could imagine asking the AI:

  • Good prompt: "As an Academic teaching an MSc course, write out a lecture plan for teaching Periodic Boundary Condition."

as against:

  • Bad prompt: "What is the lecture plan for teaching Periodic Boundary Condition."

3. Make it a conversation

It is very rare that a single question is enough for you to understand what you need. So, with humans, you keep asking question as you get answers until full understanding is achieved. The same applies with AI tools. They are this super-intelligient computational being and the only way you can benefit from their massive intellect is by asking repeated questions to gain better answers. So, the tip here is to make your prompts conversational.

  • Bad prompt: "Show me how to make a YouTube video" as against
  • Good prompt:
    • Prompt 1: "Show me how to make a YouTube video"
    • Prompt 2: "Thank you for that, now adapt the answers for making a video in Computational modelling"
    • Prompt 3: "Now specifically, what steps do I need to take making such computational modelling video based on ABAQUS software."
    • Prompt 4: "Thank you for the last answer. I want this video to be a YouTube Short rather than a long form video."

For every further prompt that you give, the AI tool will give you more specific and additional responses. This conversational tool is at the core of AI tools and you benefit the most from it if you follow this approach.

4. Spice up responses with emotions via emojis

Although AI tools are emotionless, despite their supreme inteliigence, it surprisingly can give 'emotional responses' characterized with emoji's. If you are of the emoji-bandwagon of users, then this is good news for you. For computational modelling issues, emoji's might not always be evident. So, I asked ChatGPT to define computational modelling with a few emoji's here and there and this is what it came up with. I thought it was fantastic.

5. Pitch perfect responses

One other feature of ChatGPT prompts is that you can adjust them so you get a pitch perfect response. This means that in prompting ChatGPT for answers, you can set the level of complexity you want from its output and it will do exactly that. For example, here are good prompts that you can used to get pitch perfect responses from ChatGPT

  • Prompt: Define crystal plasticity for a seven year old using 20 words
    • ChatGPT Response: "Crystals can bend and change shape like play dough."
  • Prompt: Define crystal plasticity for a professor emeritus of computational mechanics
    • ChatGPT Response: "Crystal plasticity is the study of how crystalline materials deform and flow under stress, using mathematical modeling and simulations."
  • Prompt: Define crystal plasticity for a commedian who has a fine arts background
    • ChatGPT Response: "Crystal plasticity is like molding clay, but with fancy scientific words and equations."
  • Prompt: Finally, define crystal plasticity so a COMSOL user can understand and select right material model.
    • ChatGPT Response: "Crystal plasticity is a material model that simulates how metals deform and flow under stress, accounting for the crystal structure and orientation, to accurately predict mechanical behavior in complex engineering simulations."

The exciting thing here is that you can ask the ChatGPT and similar tools to give you answers at a level you can understand.

Conclusion

We are at the early stages of the AI evolution and the prospect of what it can become is mind-boggling. The skill you need to be working on now is the skill for 'prompt engineering' so that everytime you engage with these colossal and supremely intelligent AI tools.


Thanks for reading thus far. I have dedicated this newsletter solely to AI and prompt engineering. I will revert back to my usual format in future.

Bye bye and catch you next week.

Thank you for reading this newsletter.

If you have any comment about my reflections this week, please do email me in a reply to this message and I will be so glad to hear from you.

If you know anyone who would benefit from reading these reflections, please do share with them. If there is any topic you want me to explore making a video about, then please do let me know by clicking on the link below. I wish you a wonderful week and I will catch up with you in the next newsletter.

Lets keep creating effective computational modelling solutions.

Michael


Connect with me on: Twitter | LinkedIn | Instagram | Tiktok | Mailing List

Other Links


Welcome to new subscribers: If you are one of the new faces joining the CM Videos Insider Group, then welcome. I am pleased you are here and please do click the link below to see and hopefully read previous newsletter articles from me. Thank you.