10 Prompting Techniques My Deep Learning Exam Taught Me (That I Actually Use Now)
You already use prompting every day. You just don't know the names of what you're doing. Every time you type "fix this error" into ChatGPT or "refactor this function" into Cursor — that's a prompting technique. You're already doing it. You just haven't been told there are ten distinct ways to do it, and most of them are better than what you're doing right now. I had to study all of this for my…
1. Zero-Shot Prompting
Zero-shot prompting involves directly asking the AI a question without providing examples or additional context. For instance, asking "Can you recommend science-fiction books?" or "What does the useEffect cleanup function do in React?" This technique works well for general knowledge questions that the AI has been trained on. However, it may struggle with niche or domain-specific queries that require context from the user's own codebase or experience.
2. Few-Shot Prompting
Few-shot prompting requires presenting the AI with 2-5 examples of the desired output. After showing these examples, the AI can then apply the observed pattern to a new input. For example, when converting Celsius to Fahrenheit, providing examples like "0°C → 32°F, 25°C → 77°F" allows the model to infer the conversion formula and apply it to solve "100°C → ?".
Similarly, in commit message formatting, showing similar commit messages helps the model learn the expected prefixes, casing, and level of detail. Few-shot prompting is useful for consistent formatting, style matching, and repetitive transformations, especially when the same task needs to be performed multiple times.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.