Groww
Medium
How would you write evals for an AI investing assistant? What counts as a wrong answer?
This is a reliability question. Not a "measure accuracy" question. You cannot write evals until you define what wrong means, and in investing some wrong answers cost money while others only cost style points.
Step 1. Clarifying Questions
- What does the assistant do? Assume it explains funds, stocks and the user's portfolio. It does not place orders.
- Which reliability? Hallucination, compliance, latency, drift, or overall? Assume overall.
Why it matters: intelligence is a commodity. Reliability is the moat. An LLM can give two different answers to the same question. An investing assistant that is confidently wrong 5% of the time will not be trusted with anyone's savings.
Approach: Identification → Evaluation → Mitigation
Step 2. Identification: what counts as wrong
Tier 1 (money or compliance harm, zero tolerance)
- Wrong facts: NAV, expense ratio, returns, a fund that does not exist.
- Wrong maths: XIRR, capital gains tax.
- Stale data shown as live.
- Suitability breach: small cap fund for money needed next year.
- Promises: "guaranteed", "this stock will double".
Tier 2 (wrong but visible)
- Context loss: forgets the user said they retire in 2 years.
- Answers a different question than asked.
Tier 3 (quality)
- Too long, jargon, salesy tone, slow, or no response.
Step 3. Evaluation
Golden dataset: 300 to 500 real queries (illustrative) across intents, each with an ideal answer and the rule it tests. Include traps: "Which stock will go up tomorrow?" The ideal answer declines to predict and explains why.
Deterministic checks in code (no LLM needed)
- Every number matches the source API within tolerance.
- Calculations recomputed by code.
- Data timestamp is fresh.
- Banned phrases absent.
- Suggested category is allowed for the persona's risk profile.
- Response not empty, schema valid.
LLM as judge for what code cannot check: relevance, clarity of risk explanation, neutral tone. Give it the golden answer and a rubric.
Step 4. Mitigation: LLM judge vs human, a 2x2
Humans label a weekly sample. Compare with the judge.
- Judge good, human good: no action needed.
- Judge bad, human bad: the product is wrong. Improve the prompt or retrieval.
- Judge good, human bad: the judge is too lenient. Improve the evals.
- Judge bad, human good: the judge is too strict. Improve the evals.
Tier 1 samples always go to a human, preferably compliance.
Run the suite as a release gate on every prompt or model change, and daily on live samples to catch drift.
Cross question: precision or recall for the Tier 1 checker? Recall. A false alarm costs a reviewer five minutes. A missed wrong NAV costs a customer.
Step 5. Metrics
- North Star: Tier 1 error rate on live samples (target near zero)
- Hallucination rate, judge-human agreement rate
- Eval matrix: % "no action needed" vs % "improve prompt" over time
- p99 latency, thumbs-down rate
Interview tip: define wrong before you measure wrong. A severity tier list is the answer the interviewer is waiting for.
Community Answers (0)
No answers yet. Be the first to share your approach!