1 Introduction to prompt programming and DSPy
This chapter covers
- The concept of prompt programming
- The DSPy framework
- A comparison of prompt programming to prompt engineering
- The limitations of prompt engineering
The initial phase of building LLM based applications has an almost intoxicating effect. You can write a prompt asking to summarize an article and get it done in an instant. However, when inspecting the summary it might miss the most important fact. So you try to change the prompt and check again. This time it misses a different fact. Does this hit-and-miss process sound familiar?
LMs can be sensitive to the specific prompts we give them; even slightly different prompts can elicit different responses, and some may be much more effective than others. So, when developing LM-based applications, we often have to test and evaluate many variations before we can identify high-qualityrompts. This is typically a trial-and-error process, and usually difficult and time-consuming.