01 · Intercorp · AI Engineer
Evals before vibes: fixing a prompt that drifted
AI Engineer · 2024 — now
Before: 45.6%. After: 100%.
Problem
I own the production LLM system that generates curriculum-aligned lesson plans for teachers in Peru, Colombia and Mexico, running on Gemini 2.5 Pro through Vertex AI. A lesson plan is only useful if it follows the structure its national curriculum defines, section by section.
Measured against that structure in production, only 45.6% of the responses conformed. Some responses were also bloated, spending tokens on text nobody had asked for. The cure for that is not a better-sounding prompt. It is a way to measure one.
Approach
I built a set of test fixtures and an LLM-as-judge rubric that scores every output on 5 dimensions and 19 items. Each prompt change now produces a number that can be compared with the last one, instead of an impression.
- 01a number per change
- 02the same set each run
- 0319 items in 5 dimensions
- 0445.6% prod → 8/8 fixtures
- Every prompt change got a semantic version, so it shipped as a release with a number rather than an edit in place.
- The same set of test fixtures ran against each new version.
- An LLM-as-judge rubric scored every output on 5 dimensions and 19 items.
- Each score was compared with the last version's: structural conformance went from 45.6% in production to 8 of 8 test fixtures passing, and the dashboard showed what each version cost.
Prompts became versioned artefacts with semantic versions, so a change is a release with a number rather than an edit in place. In the same system, the unit-generation engine I shipped keeps checks that do not need a model out of the model: deterministic guardrails validate the structure and detect truncated output without a single extra LLM call. And every call reports its tokens, cost and latency, so a change that improves quality but doubles the bill is visible on the dashboard before it becomes a surprise.
Result
Structural conformance went from 45.6% of production responses to 8 of 8 test fixtures passing after the fix.
The lasting change is in how prompts ship. A new version is a measured release rather than an opinion: the fixtures say whether it is better, and the dashboards say what it costs.
- Gemini 2.5 Pro
- Spring AI
- LLM-as-judge