Design an LLM chatbot: training data, rewards and deployment
I was asked this
No reports yet. Sign in to say where you were asked it.
An AI system design interview question asked in Amazon's system design round, last asked Jan 2026. It tests llm, alignment and rlhf.
Design a chatbot built on a large language model, and walk through its whole lifecycle. Go deep on three areas: how you build the training data, how you design the rewards that align the model, and what deploying it to real users involves. The users and domain are open, so settle them first: they drive every later choice.
Requirements
- Functional: multi-turn conversation in the chosen domain and languages; helpful answers; refusals where they belong; optionally tools or document access.
- Non-functional: a latency target for the first token and for full replies, a serving cost budget, safety requirements at launch, privacy of user data.
Clarifying questions
- A general assistant, or a chatbot for one domain or task? Who uses it?
- Do we start from a pretrained base model, an instruction-tuned model, or from scratch?
- Which languages and conversation lengths? Does it need tools or documents?
- What are the latency, cost and safety requirements at launch?
Part 1: training data
Which datasets each training stage needs and where each comes from: human-written demonstrations for supervised fine-tuning, preference comparisons for the reward model, safety and refusal examples, model-generated data, and logged user conversations. How you control quality: annotator guidelines, agreement checks, filtering, deduplication, decontamination against evaluation sets, coverage of multi-turn and safety cases, and privacy handling.
Part 2: reward design
Where the reward signals come from (a learned preference model, programmatic checks for things a program can verify, safety and format signals) and how they are combined. How the reward model is trained and validated. How reward hacking shows up and what controls it (a KL penalty to the reference model, held-out human evaluations, ensembles, rule checks).
Part 3: deployment
Follow one message from arrival to streamed reply: serving efficiency (batching, caching, model size and quantization), input and output safety filters, fallbacks, abuse prevention and rate limits, pre-launch evaluation, staged rollout, monitoring, and the loop that brings production feedback back into training data.
What a strong answer covers
- Requirements set before the design, with later choices tied back to them.
- Data, reward and deployment decisions that support one another rather than three separate essays.
- Explicit trade-offs between helpfulness and safety, and between quality and serving cost.
- Evaluation at every stage: offline benchmarks, human preference tests and online metrics.
Follow-ups
- The reward model's scores keep rising during training, but human raters prefer the new checkpoint less often. What is happening, and what do you do?
- How do you use production conversations to improve the next version without violating user privacy?
- How would you add retrieval over a document store to reduce made-up answers, and how does that change the training data?
- How do you decide whether a smaller distilled model is good enough to replace the large one?
Where it's asked
- Amazon · System design · Last asked Jan 202655 min · Design discussion
What it tests
llm · alignment · rlhf · serving
No official answer yet. Draw yours on the right; publish it and it shows under Community.
Nothing published yet. Publish your canvas and it shows here for others to open and remix.
