Home Artificial Intelligence Write Expert Prompts for ChatGPT (GPT-4) and Other Language Models Table of contents

Write Expert Prompts for ChatGPT (GPT-4) and Other Language Models Table of contents

Write Expert Prompts for ChatGPT (GPT-4) and Other Language Models
Table of contents

A beginner-friendly guide to prompt engineering with LLMs

Towards Data Science

Nabil Alouani


Image by writer via Midjourney.

Prompt Engineering is a flowery strategy to say, “Write higher and higher instructions for an AI model until it does exactly what you wish.”

Writing prompts is a bit like riding a motorbike. You don’t need a Ph.D. in mechanical physics to learn the way to keep your balance. A little bit of theory will help but a very powerful part is trial and error.

Consider this guide because the “little bit of theory” that can enable you prepare for riding the AI bike. You’ll find a listing of techniques illustrated with explanations, examples, and templates you’ll be able to test in your favorite models.

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

  What's on this guide?

💡 Why do you have to care about Prompt Engineering?
💡 Why prompt is engineering harder than you're thinking that?
💡 You do not need prompt ideas, you would like problems
💡 Be careful for AI hallucinations

🟢 The Basics of Prompting
🟢 Specify the context (also called "Priming")
🟢 Specify the specified format
🟢 Use
∘ use placeholders as parameters
∘ use placeholders as instructions
🟢 Specify the style/tone
🟢 Specify the length of the specified response
🟢 Specify the target market
🟢 Many-Examples Prompting
🟢 Temperature Control
🟢 Zero-Shot Prompting (no examples)
🟢 Few-Shot Prompting (several high-quality examples)
🟢 Zero-Shot/Few-Shot - The straightforward 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


Please enter your comment!
Please enter your name here