12 Prompt Engineering Techniques
12 Prompt Engineering Techniques
Summarize
Chat With This Website
I’m currently the Chief Evangelist @ HumanFirst. I explore & write about all things at the
intersection of AI & language; ranging from LLMs, Chatbots, Voicebots, Development
Frameworks, Data-Centric latent spaces & more.
Least-To-Most Prompting
https://cobusgreyling.medium.com/12-prompt-engineering-techniques-644481c857aa 1/18
12/21/23, 3:52 PM 12 Prompt Engineering Techniques. Prompt Engineering can be described as… | by Cobus Greyling | Medium
Self-Ask Prompting
Considering the image below, it is evident that Self-Ask Prompting is a progression
from Direct and Chain-Of-Thought prompting.
The interesting thing about self-ask prompting is that the LLM reasoning is shown
explicitly and the LLM also decomposes the question into smaller follow-up
questions.
The LLM knows when the final answer is reached and can move from follow up
intermediate answers to a final answer.
https://cobusgreyling.medium.com/12-prompt-engineering-techniques-644481c857aa 2/18
12/21/23, 3:52 PM 12 Prompt Engineering Techniques. Prompt Engineering can be described as… | by Cobus Greyling | Medium
Source
Self-Ask Prompting
Self-Ask Prompting is a progression from Chain Of Thought
Prompting. Below are a few practical examples and an…
cobusgreyling.medium.com
Meta-Prompting
The key principle underpinning Meta-Prompting is to cause the agent to reflect on
its own performance and amend its own instructions accordingly.
Meta-Prompt
Meta-Prompt for building self-improving agents with a single
universal prompt.
cobusgreyling.medium.com
Chain-Of-Thought Prompting
https://cobusgreyling.medium.com/12-prompt-engineering-techniques-644481c857aa 3/18
12/21/23, 3:52 PM 12 Prompt Engineering Techniques. Prompt Engineering can be described as… | by Cobus Greyling | Medium
Intuitively we as humans break a larger task or problem into sub-tasks, and then we
chain these sub-tasks together. Using the output of one sub-task as the input for the
next sub-task.
Research has shown that sufficiently large language models can enable the
emergence of reasoning abilities when prompted in this way.
ReAct
With humans the tight synergy between reasoning & acting allows for humans to
learn new tasks quickly and perform robust reasoning and decision making. We can
perform this even when unforeseen circumstances, information or uncertainties
are faced.
Reasoning enables the model to induce, track and update action plans, while actions
allow for gathering additional information from external sources.
Combining these to ideas are named ReAct, and it was applied to a diverse set of
language and decision making tasks to demonstrate its effectiveness over state-of-
the-art baselines in addition to improved human interpretability and
trustworthiness.
cabbage, two onions, and three fridges. How many vegetables do I have?
The LLM should convert the input into a dictionary with entities and values
according to their quantities, while filtering out non-vegetable entities.
Finally, the answer is the sum of the dictionary values, below the PAL output from
the LLM:
Iterative Prompting
https://cobusgreyling.medium.com/12-prompt-engineering-techniques-644481c857aa 5/18
12/21/23, 3:52 PM 12 Prompt Engineering Techniques. Prompt Engineering can be described as… | by Cobus Greyling | Medium
Of late the focus has shifted from LLM fine-tuning to enhanced prompt
engineering. Ensuring that prompts are contextual, contains few-shot training
examples and conversation history.
Source
Sequential Prompting
Sequential prompting considers the possibility of building a capable recommender
with LLMs. Usually recommender systems are developed in a pipeline architecture,
consisting of multi-stage candidate generation (retrieving more relevant items) and
ranking (ranking relevant items at a higher position) procedures.
https://cobusgreyling.medium.com/12-prompt-engineering-techniques-644481c857aa 6/18
12/21/23, 3:52 PM 12 Prompt Engineering Techniques. Prompt Engineering can be described as… | by Cobus Greyling | Medium
Open in app
Search
Source
Self-Consistency
With Chain-Of-Thought reasoning a path of thought is generated which then in turn
is followed. And on the contrary, self-consistency leverages the intuition that a
complex reasoning problem typically admits multiple different ways of thinking
leading to its unique correct answer.
Source
Automatic Reasoning and Tool-use (ART) is a framework which also leverages frozen
models to generate intermediate reasoning steps as a program.
Generated Knowledge
The principle of generated knowledge is that knowledge can be integrated at
inference time. Showing that reference knowledge can be used instead of model
fine tuning.
https://cobusgreyling.medium.com/12-prompt-engineering-techniques-644481c857aa 8/18
12/21/23, 3:52 PM 12 Prompt Engineering Techniques. Prompt Engineering can be described as… | by Cobus Greyling | Medium
I’m currently the Chief Evangelist @ HumanFirst. I explore & write about all things at the
intersection of AI & language; ranging from LLMs, Chatbots, Voicebots, Development
Frameworks, Data-Centric latent spaces & more.
https://cobusgreyling.medium.com/12-prompt-engineering-techniques-644481c857aa 9/18
12/21/23, 3:52 PM 12 Prompt Engineering Techniques. Prompt Engineering can be described as… | by Cobus Greyling | Medium
Conversational AI Conversational UI
https://cobusgreyling.medium.com/12-prompt-engineering-techniques-644481c857aa 10/18
12/21/23, 3:52 PM 12 Prompt Engineering Techniques. Prompt Engineering can be described as… | by Cobus Greyling | Medium
Follow
I explore and write about all things at the intersection of AI & language; LLMs/NLP/NLU, Chat/Voicebots,
CCAI. www.cobusgreyling.com
Cobus Greyling
521 2
https://cobusgreyling.medium.com/12-prompt-engineering-techniques-644481c857aa 11/18
12/21/23, 3:52 PM 12 Prompt Engineering Techniques. Prompt Engineering can be described as… | by Cobus Greyling | Medium
Cobus Greyling
142 2
Cobus Greyling
https://cobusgreyling.medium.com/12-prompt-engineering-techniques-644481c857aa 12/18
12/21/23, 3:52 PM 12 Prompt Engineering Techniques. Prompt Engineering can be described as… | by Cobus Greyling | Medium
152
Cobus Greyling
1.3K 11
https://cobusgreyling.medium.com/12-prompt-engineering-techniques-644481c857aa 13/18
12/21/23, 3:52 PM 12 Prompt Engineering Techniques. Prompt Engineering can be described as… | by Cobus Greyling | Medium
Cobus Greyling
25 1
https://cobusgreyling.medium.com/12-prompt-engineering-techniques-644481c857aa 14/18
12/21/23, 3:52 PM 12 Prompt Engineering Techniques. Prompt Engineering can be described as… | by Cobus Greyling | Medium
1.7K 24
Lists
AI Regulation
6 stories · 226 saves
ChatGPT prompts
32 stories · 831 saves
ChatGPT
23 stories · 325 saves
https://cobusgreyling.medium.com/12-prompt-engineering-techniques-644481c857aa 15/18
12/21/23, 3:52 PM 12 Prompt Engineering Techniques. Prompt Engineering can be described as… | by Cobus Greyling | Medium
Shreyansh Shah
James Nguyen
https://cobusgreyling.medium.com/12-prompt-engineering-techniques-644481c857aa 16/18
12/21/23, 3:52 PM 12 Prompt Engineering Techniques. Prompt Engineering can be described as… | by Cobus Greyling | Medium
720 7
1.6K 13
https://cobusgreyling.medium.com/12-prompt-engineering-techniques-644481c857aa 17/18
12/21/23, 3:52 PM 12 Prompt Engineering Techniques. Prompt Engineering can be described as… | by Cobus Greyling | Medium
Trevor Lohrbeer
https://cobusgreyling.medium.com/12-prompt-engineering-techniques-644481c857aa 18/18