ChatGPT Effective promting techniques

Muhammad A
2 min readJul 14, 2024

--

Table of contents

What is prompting for ChatGPT

Techniques/steps for Effective Prompting

Personal hacks

References

What is prompting for ChatGPT

ChatGPT models are a family of pre-trained GPT models that are trained on general-purpose datasets. So in order to make it personalized for your use you need to provide a context a role and instruction. This can be achieved using a technique called RAG and the core of RAG pipelines lies at the heart of prompting means because, in the end, the LLM make the decision of what to generate which makes prompting very crucial in RAG and such cases.

Prompting for chatGPT is a way of personalizing the chatGPT models for your specific use case by giving instruction to the LLM.

This prompt always stays upfront whenever the LLM generates an answer so it always stays with the LLM during answering.

Techniques/steps for Effective Prompting

  1. Give a ROLE

Assign a role to GPT will help improve the gpt response and the gpt will act according to that role for example.

EXAMPLE:

Answer to customers at XYZ restaurant. (bad)

Act as Receptionist at XYZ restaurant and answer the customer's queries. (good)

2. Provide a description

Provide a simple and accurate two-line description of “whats the purpose of chatGPT” This will help ChatGPT remember the end goal while answering.

EXAMPLE:

Professionally answer the customers in order to increase the customer experience at XYZ restaurant.

Here the goal of “customer experience” will always be the target of the chatGPT while generating response.

3. Provide a Context

The core part of the writing prompt for LLM lies in the Context part this is the part that majorly affects your LLM answer and in fact your whole pipeline.

What do you want your chatGPT to do? This may include the background introduction, any exceptions, facts, or any statistics that you wan to provide.”

EXAMPLE:

The XYZ restaurant is Pakistan's 30th best restaurant in ABC products.

4. Output format:

Providing a particular output format will help your chatGPT to answer the question in a specific format, here you can define any particular format, tone of answering, and length of the answer.

EXAMPLE:

Your answer will be provided to the synthesizer to convert into voice notes so be specific and limit your answer to 2 or 3 lines.

5. One shot or few shot learning:

With one shot or a few shots of learning, you show the sample example to your chatGPT and your chatGPT learns the output format and input questions that someone can ask.

Personal hacks

commas “” : Always use commas for important instruction or statistics or any fact that you want to emphasize.

Simple and straightforward writing: Always write simple straightforward forward and small sentences. (chat GPT not good at imagination).

Divide your large prompt: Do not write a huge set of instructions all at once divide your prompt.

References

https://www.coursera.org/articles/how-to-write-chatgpt-prompts

https://zapier.com/blog/gpt-prompt/

--

--