The Art of Prompt Engineering with ChatGPT - Introduction and Tools & Techniques

The Art of Prompt Engineering with ChatGPT - Introduction and Tools & Techniques

I found the book, The Art of Prompt Engineering with ChatGPT by Nathan Hunter, highly informative. So, I am sharing important examples and insights for the benefit of those who are interested in learning Prompt Engineering.

Introduction???

When working with AI tools don’t alter your language or compromise on who you are. You don’t have to make things easy for the AI, rather learn prompt engineering and tools to create your own way of interacting with the AI. This way you preserve your identity and take full advantage of the tool.

Why is ChatGPT better than customer service BOTs before 2022.? The pre 2022 BOTs were built on keyword-based understanding not contextual. In layman terms the BOT would gather certain keywords from your input and would return the most closet prewritten response. If it couldn’t find any you would get a response such as “can you rephrase that again?” or “I didn’t quite get that”.

ChatGPT on the other hand tailors its responses based on the training it has had and by analyzing the context. This is contextual understanding.

Another way to look at prompt engineering is as recipe for ChatGPT to cook you the response you want.

Tools & Techniques

How to iterate better?

Keep on providing feedback to ChatGPT continuously and asking it to try again to improve the quality is the best way to get the response you want. The way to do this is to let ChatGPT know:

1.??????What have you liked? E.g., I liked the use of small paragraphs.

2.??????What didn’t you like? E.g., I would like you to use formal British English.

3.??????What you want to see instead – E.g., Can you make the sentences no longer than 200 words or use more analogies.

4.??????Ask for variations??E.g., The suspense is weak can you make it more interesting or make the tone more friendly?

5.??????Ask for clarification? E.g., Can you explain how the example is relevant to my query?

6.??????Be precise on the edits you want – E.g., Can you rewrite the first sentence to make it sound very friendly. Don’t change any of the other sentences.

7.??????Add explanations – E.g., Thanks for rewriting the email. Can you include feedback in brackets to explain the changes you made.

8.??????Make it long or short – E.g., The content looks great, but can you make it concise?

Time for Role Play

One of the best ways to optimize a response is to give your AI a role to play e.g., a copy writer, python coder or a hiring manager or an editor. The input would be e.g., act as a hiring manager in an interview with a candidate.

You can ask ChatGPT to help you prepare for an interview by providing it with the name of the company, the title of the job, the job description and background about yourself. The questions will be customized for the role you are applying for. The more content you give to ChatGPT the more relevant will be the questions. You can instruct ChatGPT to ask one question at a time and give feedback on your answers.

Newspaper Editor: You can ask ChatGPT to play the role of an editor to provide only feedback no rewrites for your content. E.g., Prompt: Act as the editor of a newspaper and I am a journalist working for you. I will provide you with content and you will give feedback in bullet points about the language, grammar, and content. You will not repeat or change my content. Begin the conversation by asking me for some content to review.

Famous Author: Instruct ChatGPT to take on the persona of a famous author of your choice and write content in the voice, tone, style, and language of that author. E.g., Prompt: Act as Agatha Christie to write some content use. Use Agatha Christie’s voice, tone, language and writing style. Describe a journey on a commercial airline.

A Software: You can get ChatGPT to behave like a Linux command or an excel spreadsheet. E.g., Prompt: Act as a Linux terminal. I will write a command and you will provide the output exactly as a Linux terminal would. Do not provide any explanation just an output that the Linux terminal would.

A character from a famous book, play or movie:?Instruct ChatGPT to take on a character from your favorite book, play or movie and that it can break the character at any time during the conversation. E.g., Act as Yoda from Star Wars, talk in Yoda’s voice, tone, and language. Also describe in brackets any non-verbal actions.

Learning:

1.??????Just instructing the AI to act as a person or character may lead the AI to talking about the person rather than assuming the role. So, it is important to set the expectations.

2.??????You should know how to interact in a roleplay. For e.g., if you instruct the AI to “Act as a life coach” it is important to know how to interact in this roleplay.


Training ChatGPT

Normally ChatGPT does not need examples to give you the output you want, thanks to its huge training data sets.

However, if you want ChatGPT to copy a particular writing style or understand how LinkedIn resumes look then you must feed it multiple examples – Use a few shots approach.

Training E.g.,1: If you want ChatGPT to write your LinkedIn profile. Then you should begin by feeding it resumes of the profiles that have the style, language, and tone you want. E.g., Prompt: I am going to teach you the style of a LinkedIn profile. I will feed you a profile and you will remember it, analyze its style, and reformulate in your mind what the LinkedIn style is. Only reply with got it each time I feed you a profile.

After 4 or 5 inputs you should get the profile, you want.

Training E.g., 2: If you want ChatGPT to write content in your style. You must provide sufficient examples to learn from.

Chunking

If the output is large ChatGPT, it is likely to stop mid-sentence. Just input ‘continue’ to receive the rest of the output.

When your output is very long, it is good practice to break it into parts and work on each piece individually – Chunking. Open document to copy and paste each response as it is created by ChatGPT. This is a very optimized way to work around ChatGPT output limitations.

Let me explain with an example.

1.??????You prompt ChatGPT to create an outline for your new business. The outline that ChatGPT generates contains four sections – Executive Summary, Market Analysis, Product and Services and Marketing and Sales. As you will see the outline is very broad so it will be better to break it down into small sections.

2.??????You decide to focus first on the Marketing Section and input to ChatGPT is?“Break down the Market Analysis into subsections, base this on my idea”. ChatGPT breaks the Market Analysis into multiple subsections. This way you can work on the subsections one by one and piece them together in your document.

3.??????Please keep in mind when working on each section at a time that the language, writing style, tone and voice are consistent. You would not want one paragraph to be casual and the other formal.

4. For long content there is no one-size-fit-all. It is best to try multiple approaches


Thanks to the author Nathan Hunter for sharing this invaluable knowledge.

#chatgpt #gpt #openai #promptengineering #promptengineer

要查看或添加评论,请登录

社区洞察

其他会员也浏览了