Improving Taralli food calorie tracking accuracy from 17% to 76% with DSPy evals
The initial zero-shot calorie tracking system produced wildly inaccurate outputs — including tens of thousands of kcal for common foods — because the model misinterpreted quantity fields, resulting in only 17% accuracy.
The naive zero-shot GPT-4o mini approach with structured outputs achieved only 17% accuracy, with common failure modes including wrong calorie totals and missing food groups.
After applying DSPy's BootstrapFewShotWithRandomSearch optimization with Gemini 2.5 Flash, tracking accuracy improved from 17% to 76%, and the optimized model was integrated into the production app for all users.
Frequently asked questions
What did this team achieve with this AI workflow?
After applying DSPy's BootstrapFewShotWithRandomSearch optimization with Gemini 2.5 Flash, tracking accuracy improved from 17% to 76%, and the optimized model was integrated into the production app for all users.
What tools did this team use?
gpt-4o-mini, DSPy, W&B Weave, Pydantic, FastAPI, Gemini 2.5 Flash, o3, Gemini 2.5 Pro, openrouter.
What results were reported?
Initial tracking accuracy (gpt-4o-mini zero-shot): 17.24%; Gemini 2.5 Flash zero-shot accuracy: 24.1%; optimized tracking accuracy after DSPy: 75.9%; Tracking accuracy improvement end-to-end: improve tracking accuracy from 17% to 76% (source-reported, not independently verified).
What failed first in this deployment?
The naive zero-shot GPT-4o mini approach with structured outputs achieved only 17% accuracy, with common failure modes including wrong calorie totals and missing food groups.
How is this quality assurance AI workflow structured?
User submits food description → LLM generates structured nutrition output → Log inputs and outputs via Weave → Build golden dataset → Evaluate predictions with metric → DSPy few-shot prompt optimization → Deploy optimized API endpoint → Data flywheel for continuous improvement.