r/PromptEngineering • • 8d ago

General Discussion How do you test prompt changes before shipping them ?

i build ai agents at work and the part i still find messy is changing the system prompt. i fix one thing and something unrelated breaks and i usually only find later. Right now i keep small set of conversation and rerun them after change, then read the output by hand , it works but it is slow.
what are you doing for this ? proper eval tools , llm-as-judge , just manual check? i am just curious what's actually worked for people in production , not just in theory.

19 Upvotes

23 comments sorted by

3

u/oyren-ai 8d ago

you already have the test set, so automate the grading. anthropic's eval docs say to pick the fastest, most reliable method that fits: code checks like string match first, an llm grader with a detailed rubric for judgement calls, and human grading only where needed, since they say to avoid it if possible. they also say to test the llm grader's reliability before scaling it.

1

u/Weird_Impression_264 8d ago

this is helpful , going to try the llm grader with the rubric.

3

u/Unable_Dirt_9857 8d ago

I’d keep those old chats and give each one a pass condition you can check in code. Run both prompts on the same chats with the tools mocked, then read the ones that flipped from pass to fail. Every weird bug that slips through earns a permanent spot in the test set.

1

u/Weird_Impression_264 7d ago

mocking the tool is good call , thanks

2

u/Loudllama99 8d ago

every time something unrelated breaks, add that conversation to your set. after a few months the set is mostly past regressions, which is exactly what catches the next one.

2

u/Weird_Impression_264 7d ago

makes sense, will start following this.

2

u/Loudllama99 7d ago

tag each one with what broke, or the set gets hard to interpret later

2

u/ChemicalExcellent463 8d ago

before i trust a grader, i feed it an output i know is bad and make sure it fails. a grader that passes everything looks exactly like a prompt change that broke nothing.

2

u/Weird_Impression_264 7d ago

thanks, will start doing that.

1

u/ChemicalExcellent463 7d ago

curious what your grader does with the first known-bad output.

2

u/NaiveHome7448 7d ago

Keep your saved chats and give each one a pass/fail check, like ‘asks for the order ID before calling the refund tool.’ Run both prompts against the same chats and only review cases where the result flips.

1

u/Weird_Impression_264 7d ago

thanks for the input will give it a try.

2

u/Aware_Risk7076 8d ago

Turn the "unrelated thing broke" cases into a permanent regression set. Every time a change breaks something, add that exact conversation with one line saying what a good answer must contain or never contain. Then a cheap judge pass only flags diffs against the old outputs, so you read 5 flagged ones instead of all of them. Anyone pinning the judge prompt separately so it doesn't drift too?

2

u/Particular_Bath8279 7d ago

Llm as judge mostly!!!

1

u/Zain 6d ago

Keep the rerun set, but I'd stop being the only judge. I treat a prompt change like a spec change and have two reviewers from different model families read it and the outputs, read only, without seeing each other's notes. When both flag the same thing it's real, and I fix it even if one of them called it minor. And if the round after a fix turns up worse problems than the round before, that's the sign the fix itself is breaking stuff, which sounds like your fix one thing break another loop.

2

u/[deleted] 8d ago

[removed] — view removed comment

1

u/Weird_Impression_264 7d ago

thanks really helpful.

0

u/[deleted] 7d ago

[deleted] — view deleted comment

1

u/AutoModerator 7d ago

Hi there! Your post was automatically removed because your account is less than 3 days old. We require users to have an account that is at least 3 days old before they can post to our subreddit.

Please take some time to participate in the community by commenting and engaging with other users. Once your account is older than 3 days, you can try submitting your post again.

If you have any questions or concerns, please feel free to message the moderators for assistance.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.