flâneur — a map of the web's best reading

Prompt Like a Data Scientist: Auto Prompt Optimization and Testing with DSPy | by Julian Yip | Towards Data Science

towardsdatascience.com · 10,361 words · saved by 1 readers

LLMs are grounded in data science, but our approach to prompt engineering might strike us as unscientific: To address these issues, Stanford NLP has published a paper introducing a new approach with prompt writing: instead of manipulating free-form strings, we generate prompts via modularized programming. The associated library, called DSPy, can be found here. This article aims to show how this “prompt programming” is done, to go deeper in explaining what’s happening behind the optimization process. The code can also be found here. (Speaking of which, you might also find coaxing LLMs to output properly formatted JSON very unscientific too, I have also written an article about how to address this with Function Calling. Check it out !) towardsdatascience.com We will spend some time to go over the environment preparation. Afterwards, this article is divided into 3 sections: We are now ready to start! They are the building blocks of prompt programming in DSPy. Let’s dive in to see what the

Prompt Like a Data Scientist: Auto Prompt Optimization and Testing with DSPy | Towards Data Science Data Science Prompt Like a Data Scientist: Auto Prompt Optimization and Testing with DSPy Applying machine learning methodology to prompt building Julian Yip May 5, 2024 49 min read Share Drawn by the author LLMs are grounded in data science, but our approach to prompt engineering might strike us as unscientific: Manual prompt engineering which does not generalize well : LLMs are highly sensitive to how they are prompted for each task, so we need to handcraft long strings of instructions and dem

Explore this link on the map →

saved by

related reading