Cómo escribir indicaciones de expertos para ChatGPT (GPT-4) y otros modelos de lenguaje |  de Nabil Alouani |  noviembre de 2023

Una guía para principiantes para impulsar la ingeniería con LLM

—

Imagen del autor vía Midjourney.

Prompt Engineering es una forma elegante de decir: “Escriba cada vez mejores instrucciones para un modelo de IA hasta que haga exactamente lo que desea”.

Escribir indicaciones es un poco como andar en bicicleta. No necesitas un doctorado. en física mecánica para aprender a mantener el equilibrio. Un poco de teoría puede ayudar, pero la parte más importante es la prueba y el error.

Considere esta guía como la “parte de teoría” que lo ayudará a prepararse para andar en bicicleta con IA. Encontrarás una lista de técnicas ilustradas con explicaciones, ejemplos y plantillas que puedes probar en tus modelos favoritos.

La guía se centra en ChatGPT (GPT-4), pero todas las técnicas que se comparten a continuación se aplican a otros modelos de lenguajes grandes (LLM) como Claude y 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
∘…