Chat GPT prompting techniques

Mykyta Prus ๐Ÿ‡บ๐Ÿ‡ฆ
3 min readAug 7, 2023

--

Robot sit on bench and reading book
Photo by Andrea De Santis on Unsplash

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

--

--

Mykyta Prus ๐Ÿ‡บ๐Ÿ‡ฆ

๐Ÿ‘จโ€๐Ÿ’ป Web Developer at Ekreative on military leave ๐Ÿช–| Endurance Enthusiast ๐Ÿƒโ€โ™‚๏ธ๐Ÿšดโ€โ™‚๏ธ | Silent preacher ๐ŸŽค๐Ÿ™๐Ÿคซ