Skip to the document
Madhuopen lab

AI Insights: Latency & Cost Optimization · part 5 of 17

adopted24 July 2026cost: ~$6 (phase total ~$16 running)

Grounding the prompt: feed the model the facts

Current-year tax facts (pulled from the tax handouts) + eligibility gate + coverage instruction

The question

Is Qwen's 5–6 a capability ceiling, or a missing-information problem?

adopted

Qwen jumped 5 → 8/10, level with GPT-5.1. The gap was facts and rules, not model weights.

Qwen quality5 → 8 / 10≈ GPT-5.1's 8.7
Insights per answer6coverage instruction fixed under-generation
Eligibility violations0was the top failure raw
Wall / TTFT / cost8.5 s / 111 ms / $0.0087

What was added

Two additions to the prompt, no model change. First, the correct current-year tax numbers, extracted by build_facts.py from the internal tax handout library (116 PDFs with current and prior-year columns: tax facts & figures, HSA/IRA/retirement limits, W-4, standard-vs-itemized) into a compact facts_block.txt. Second, an up-front statement of which credits this client is not eligible for (computed from the return data), plus a coverage instruction so a single call generates the full 6–8 insight set.

Result

Result
VariantQualityInsightsEligibility violationsNotable
Qwen, raw production prompt5 / 102–3severalstale 401k limit, invented credits
Qwen + facts + gate + coverage8 / 1060cites correct current-year $24,500 401k limit
GPT-5.1 + same additionsnudged up0grounding helps the paid model too
RAGgroundingeligibility gateprompt engineering