How to Write Expert Prompts for ChatGPT (GPT-4) and Other Language Models | by Nabil Alouani | Nov, 2023


Harness the Potential of AI Tools with ChatGPT. Our blog offers comprehensive insights into the world of AI technology, showcasing the latest advancements and practical applications facilitated by ChatGPT’s intelligent capabilities.

A beginner-friendly guide to prompt engineering with LLMs

Nabil Alouani

Towards Data Science

Nabil Alouani


Image by author via Midjourney.

Prompt Engineering is a fancy way to say, “Write better and better instructions for an AI model until it does exactly what you want.”

Writing prompts is a bit like riding a bike. You don’t need a Ph.D. in mechanical physics to learn how to keep your balance. A bit of theory can help but the most important part is trial and error.

Consider this guide as the “bit of theory” that will help you prepare for riding the AI bike. You’ll find a list of techniques illustrated with explanations, examples, and templates you can test on your favorite models.

The guide focuses on ChatGPT (GPT-4), but every single technique shared below applies to other Large Language Models (LLMs) like Claude and LLaMA.

  What's in this guide?

💡 Why should you care about Prompt Engineering?
💡 Why prompt is engineering harder than you think?
💡 You don't need prompt ideas, you need problems
💡 Watch out for AI hallucinations

🟢 The Basics of Prompting
🟢 Specify the context (also called "Priming")
🟢 Specify the desired format
🟢 Use <placeholders>
How to use placeholders as parameters
How to use placeholders as instructions
🟢 Specify the style/tone
🟢 Specify the length of the desired response
🟢 Specify the target audience
🟢 Many-Examples Prompting
🟢 Temperature Control
🟢 Zero-Shot Prompting (no examples)
🟢 Few-Shot Prompting (several high-quality examples)
🟢 Zero-Shot/Few-Shot - The simple version

💡 In-context Learning vs. Chat History

🟡 Chain of Thought Prompting
Zero-Shot Chain of Thought
Few-Shot Chain of Thought
🟢 Role Prompting
🟢 Knowledge Generation Prompting
Knowledge Generation Prompting and ChatGPT Plugins
🟠 Knowledge Integration Prompting*
Knowledge Integration* and Microsoft Edge
🟠 Directional Stimulus (DS) Prompting
🟡 Recursive Criticism and Improvement (RCI) Prompting
🟡 Self-Refinement Prompting
🟡 Reverse Prompt Engineering
🟡 Prompt Revision
🟡 Program Simulation Prompting
🟠 All-In-One (AIO) Prompting*
🟢 Template for All-In-One (AIO) Prompting
🟢 More examples of All-In-One Prompting*
Dolores, the Email Muse

Discover the vast possibilities of AI tools by visiting our website at to delve deeper into this transformative technology.


There are no reviews yet.

Be the first to review “How to Write Expert Prompts for ChatGPT (GPT-4) and Other Language Models | by Nabil Alouani | Nov, 2023”

Your email address will not be published. Required fields are marked *

Back to top button