2 Prompt engineering with ChatGPT
This chapter covers
- Structuring a good prompt to make the most of ChatGPT
- Distinguishing between zero-shot, one-shot, and few-shot prompts
- Examining role prompting and how can it help you become a ChatGPT power user
- Determining how to use ChatGPT’s Custom Instructions feature for a tailored user experience
This chapter will teach you the art of prompt engineering, allowing you to harness the full potential of LLMs. We will delve into practical examples and real-world applications of various prompt engineering techniques, and I encourage you to follow alongside the presented content. This hands-on approach ensures that you not only learn the theoretical aspects of prompt design but also its practical application. By the end of this chapter, you will have a strong enough understanding of prompt engineering to tailor ChatGPT’s responses to your specific tasks and use cases.
2.1 Structuring a good prompt
In the previous chapter, we briefly looked at a simple example highlighting the difference between a good prompt and a bad one. These four essential features define an effective prompt: clarity, specificity, instruction, and assumptions.