Sub topic 6
Data and Feedback Loops
Assume you know how software features are planned and shipped, understand the basic idea of machine learning and large language models, and can read short Python snippets. This chapter focuses on one question: can you obtain enough useful data to build, evaluate, and improve an AI feature?
Data is more than a pile of examples
An AI feature needs data for at least three different jobs:
- Development data helps you discover whether a model can perform the task.
- Evaluation data measures quality against examples that the model did not use while being developed.
- Feedback data shows how the feature behaves after launch and where it needs improvement.
The data must match the real task. For example, support tickets may contain labels such as billing, bug, or account access. If most historical tickets are simple billing questions, the data may not represent rare but important account-security cases.
Check these properties before choosing an AI approach:
| Property | Question to ask | Common problem |
|---|---|---|
| Coverage | Does the data represent real users and edge cases? | Rare cases are missing |
| Quality | Are labels or answers accurate and consistent? | Reviewers disagree |
| Volume | Are there enough examples for development and testing? | Results are unstable |
| Freshness | Does the data reflect current products and policies? | Old behavior misleads the model |
| Permission | Can the data be used for this purpose? | Privacy or contractual limits |
A large dataset with inaccurate labels can be less useful than a small, carefully reviewed dataset. Separate evaluation examples before tuning prompts, rules, or model settings. Otherwise, you may measure memorization instead of generalization.
Design the feedback loop
A feedback loop connects user outcomes to future product improvements. A typical loop is:
Do not treat every click as positive feedback. A user may accept a suggestion because correcting it takes too much effort. Capture signals that better represent success, such as:
- an employee accepting or editing a generated response;
- a user completing the intended task;
- a corrected classification;
- a support escalation after an incorrect answer;
- a reviewer marking an output unsafe or incomplete.
Record enough context to investigate errors, but avoid collecting unnecessary personal information. Define retention rules and access controls before launch.
Start with a measurable baseline
You can often test data readiness with a simple non-AI method. For example, compare a keyword classifier with an AI classifier on the same labeled examples:
def accuracy(predict, examples):
correct = sum(
1 for text, label in examples
if predict(text) == label
)
return correct / len(examples)
examples = [
("please refund my order", "billing"),
("the app crashes on launch", "bug"),
("my invoice amount is wrong", "billing"),
]
def keyword_baseline(text):
if "refund" in text or "invoice" in text:
return "billing"
return "bug"
print(accuracy(keyword_baseline, examples))The baseline reveals whether the task is already easy and whether the labels are usable. An AI system should improve a meaningful outcome, not merely replace a few lines of rules.
When feedback is sparse
Some features produce too few explicit corrections to learn quickly. High-risk actions may also need human approval, which limits automatic feedback. In that case, create a review queue and sample outputs regularly. Track performance by user group, language, task type, and severity rather than relying only on one average score.
Exercise
A team has 50,000 historical support tickets but no reliable labels and no way for agents to correct predictions. Is this enough data to justify an AI classifier?
Show answer
No. The volume is promising, but the team needs trustworthy labels and a feedback path before it can evaluate or improve the classifier.