Learn how to automate rapid engineering and achieve significant performance improvements in your LLM workload
Automated prompt engineering (APE) is a technique to automate the process of generating and refining prompts for a large language model (LLM) in order to improve the performance of the model on a particular task. It uses the idea of prompt engineering, which involves manually creating and testing multiple prompts, and automates the entire process. As we will see, it is very similar to automated hyperparameter optimization in traditional supervised machine learning.
In this tutorial, we will go deeper into APE: we will first look at how it works in principle, some of the strategies that can be used to generate prompts, and other related techniques such as example selection. Then, we will move on to the practical section and write an APE program from scratch, i.e. we will not use any library like DSPy to do it for us. By doing that, we will have a much better understanding of how APE principles work, and we will be much better equipped to take advantage of frameworks that will offer this functionality out of the box.