8 Advanced prompt engineering

 

This chapter covers

  • Examining the workings behind large language models
  • Creating advanced prompts to make the most of ChatGPT
  • Chain-of-thought prompting to enhance ChatGPT’s reasoning capabilities
  • Extracting structured information from ChatGPT with prompt chaining

In previous chapters, we learned that prompt engineering is crucial in harnessing the full potential of language models. We also explored a few prompting techniques to improve the quality of ChatGPT’s responses: zero-shot, one-shot, and few-shot. These methods utilize different levels of example-based guidance to help the model understand and respond to queries more effectively.

However, the journey doesn’t end here. While zero-shot, one-shot, and few-shot prompting are useful in guiding language models toward your desired outcome, the complexity of real-world problems often demands more nuanced strategies. Language models often struggle when attempting to perform tasks related to logic and reasoning as you will see later in this chapter, and example-based approaches alone are insufficient in guiding the model towards the desired outcome.

In this chapter, you will learn a few more advanced prompt engineering techniques that will expand the scope of ChatGPT’s capabilities, helping you accomplish tasks that language models might otherwise fail to do. These advanced techniques are crucial when tackling tasks that involve complex reasoning and creative problem-solving.

8.1 The workings behind Large Language Models

 
 

8.1.1 Next Token Prediction

 
 
 
 

8.1.2 Transformer architecture

 
 
 

8.1.3 Limitations in reasoning

 
 
 
 

8.2 Chain of Thought prompting

 
 
 

8.2.1 An example of Chain of Thought prompting

 
 
 

8.2.2 Types of Chain of Thought prompting

 
 
 

8.2.3 Limitations of Chain of Thought prompting

 
 
 

8.2.4 When to use Chain of Thought prompting

 

8.3 Prompt chaining

 
 
 
 

8.4 Summary

 
 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest