Chat GPT prompting techniques
Intro
Chat GPT became a new norm in the IT world and not only. Iโm using Chat GPT in my day-to-day life to accomplish different goals but most of them are related to work. In this article, Iโll share a few prompting techniques which can boost your productivity.
Table Content:
- The core elements of a good prompts
- Adding meaningful context
- Separating instructions from content
- Ask before answering prompting
- Perspective prompting
The Core Elements of A Good Prompt
Here is an example of a well-designed prompt:
Role I want you to act as a javascript console.
Goal I will type commands and you will reply with what the javascript console should show ().
Constraints I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when I need to tell you something in english, I will do so by putting text inside curly brackets {like this}.
My first command is console.log(โHello Worldโ);
Adding Meaningful Context
What kind of context you should add? Here is a list of tips for providing good context:
- Prefer short, focused sentences
- Add important keywords & avoid unnecessary information
- Define the target audience
- Control tone, style & length of the output
- Control the output format (text, JSON, unformatted markdown)
Separating Instructions From Content
Here is a prompt example:
You are an AI assistant that good at summarizing articles.
"""
...some long article with a lot of text
"""
Summarize the above article. Provide summary in bullet list format.
Ask-Before-Answer Prompting
There is a more advanced technique, but it can be sometimes pretty useful.
Here is a prompt example:
You are an experienced AI running coach.
I want you to help me prepare for the 10k run by building a training plan for me.
Before answering, I want you first ask for any extra information that helps you produce a better answer. If you got no questions, please provide answers instead
Perspective Prompting
Perspective prompting looks almost similar to role prompting. I found one difference when we can write prompts for people with two different perspectives.
Conclusion
I share prompting techniques that I use the most, but we have so much more of them. You can even ask chatGPT to make a list of useful prompting techniques for you.
Here is an example:
Hope this article helps you to use chatGPT in a new and more efficient way.
Happy Coding ๐ค
Resources
- Great udemy course which helps me to write this article and have a lot of cool stuff about chatGPT and not only.
- GitHub repo with good prompt examples