How to Write Good Prompts (dylancastillo.co)

🤖 AI Summary
A pragmatic, no‑BS guide distills prompt engineering into six core principles to help practitioners get reliable results from LLMs: be clear and specific, provide examples, let models think (Chain‑of‑Thought), structure prompts with sections/delimiters, split complex tasks into smaller steps, and repeat instructions when context is long. The article emphasizes the practical distinction between system/developer prompts (set the model’s role and global rules) and user prompts (the task and context), recommends embedding few‑shot examples—often in the system prompt—and shows how structured JSON outputs and delimiters improve readability and repeatability. Technically useful tips include explicit Chain‑of‑Thought prompting (zero/few‑shot) and awareness that some providers expose full thinking tokens (e.g., Gemini, Claude 3.7+) while others return summarized chains; Anthropic reported up to ~30% gains from repeating instructions in long contexts. Advanced strategies covered are ES‑KNN exemplar selection, self‑consistency (marginalizing multiple CoT samples), and Thread‑of‑Thought for staged analysis. The author cautions against blindly using LLMs to write prompts—always review and iterate—and notes that these practices won’t magically fix a bad pipeline but will avoid common mistakes and substantially improve task reliability and engineering productivity.
Loading comments...
loading comments...