Evaluating Generative AI Use and Accuracy
AmazonSoftware Engineer · OnsiteLast updated
Tests a candidate's ability to assess when Generative AI is the right solution, choose appropriate architecture patterns (such as RAG or fine-tuning), and rigorously measure and improve model output accuracy in production.
Scenario
Your team at an e-commerce platform is tasked with building an internal automated assistant that answers merchant policy and catalog compliance questions for third-party sellers. Merchants currently submit thousands of compliance queries daily, and human support agents take hours to resolve them. You must determine if Generative AI (GenAI) is the right tool, design the high-level application pattern, and define a framework to evaluate and continuously improve output accuracy.
Tasks
- Suitability Assessment: Explain the criteria used to decide whether to use a Generative AI approach versus deterministic search, rule-based systems, or traditional NLP classifiers.
- Architecture Pattern: Propose an appropriate architecture (e.g., standard prompting, Retrieval-Augmented Generation [RAG], fine-tuning, or a hybrid). Justify your choice based on factors such as policy freshness, hallucination risk, and latency.
- Evaluation Strategy: Define both offline and online evaluation metrics for measuring factual accuracy and policy adherence. Detail how you would detect and measure hallucinations.
- Continuous Improvement: Describe an operational feedback loop to detect drift, capture low-accuracy responses, and update the system safely.
Expectations
- Specify exact evaluation metrics (e.g., faithfulness, answer relevance, context recall, ROUGE/BLEU limitations, human-in-the-loop audit sampling).
- Explain how you would prevent hallucinated policy interpretations from reaching sellers.
Hints
Hint 1
Consider how frequently merchant compliance policies change when deciding between fine-tuning model weights and grounding generation via Retrieval-Augmented Generation (RAG).
Hint 2
Differentiate between component-level metrics (retrieval precision/recall) and end-to-end generation metrics (faithfulness and factual correctness).
Hint 3
Incorporate automated evaluation frameworks (like LLM-as-a-judge or RAGAS) alongside human validation for low-confidence or high-impact policy answers.
Follow-up questions
- How would you handle conflicting guidance across historical policy documents retrieved in the context window?
- If the business requires an SLA of under 500ms p95 latency, how does that constrain your choice of model and retrieval pipeline?
- How would you design guardrails to detect adversarial prompt injections from merchants trying to bypass catalog restrictions?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.