Two Tickets, One On-Call Queue
A retail team opens two tickets on the same morning. Ticket one: the weekly demand forecast is off by 18% for one SKU family, and the buying team wants to know whether to retrain. Ticket two: the support assistant told a customer their order shipped when it had not, and the support lead wants the bot fixed before Monday.
Both tickets get filed as "the model is wrong," but they belong to different professions. The forecast is classical ML engineering: a model trained on structured rows (history, price, seasonality) that outputs a number, where the fix lives in features, labels, and retraining. The support answer is AI engineering: a general-purpose language model that was never trained on your order system, wired into the product by prompts, retrieved context, and output checks. Nobody retrains it. The fix lives in the application code around it.
Where the boundary sits
| ML engineering | AI engineering | |
|---|---|---|
| Raw material | Structured rows: tables, time series | Text, documents, conversation |
| Model lifecycle | You train, version, and deploy the model | A provider ships the model; you call it |
| Unit of work | A feature, a label, a training run | A prompt, a retrieval step, an eval case |
| Typical failure | Drift, leakage, bad labels | Missing context, loose prompt, unvalidated output |
| The artifact you ship | A serialized model behind an API | Code that composes model calls |
The distinction matters most when something breaks at 2 a.m. A drifting forecast needs retraining plus monitoring of feature distributions. A fabricated shipping status needs a grounded retrieval path, a refusal for questions the system cannot answer, and a validation step before the UI renders any text. The wrong fix is expensive in both directions: retraining a language model to repair a wiring bug burns GPU budget and ships nothing, while patching a prompt over a leaking training set guarantees the bug returns next quarter.
Where LLM Work Actually Goes
Scan an LLM product team's job postings for "train models" and you are usually looking at a research group, not the team shipping features. The daily work of AI engineering is a three-station loop.
- Prompting — change the instructions, the message structure, or the few-shot examples, then rerun.
- Retrieval — change which documents or records land in the context window, because most factual errors are missing context rather than a weak model.
- Evaluation — rerun a fixed set of representative inputs, so a prompt edit is a measurement rather than an opinion.
The evaluation station is what keeps the other two honest. A minimal version:
def score_batch(cases, ask):
passed = 0
for question, expected in cases:
answer = ask(question) # your own call into the model
passed += expected.lower() in answer.lower()
return passed, len(cases)
cases = [
("What is our return window?", "30 days"),
("Do you ship to Norway?", "yes"),
("Can I change my address after ordering?", "support"),
]
print(score_batch(cases, ask=prompt_v3)) # (2, 3) -> v3 fails the address question
print(score_batch(cases, ask=prompt_v4)) # (3, 3)
Three cases is a demo. A working loop holds 50 to 300 labeled inputs and runs on every prompt change. Across a real week it looks like this: prompt v3 scores 154 out of 200 (77%), you rewrite the instruction that forces the model to quote its source, prompt v4 scores 171 out of 200 (85.5%). That is a change you can defend in code review. "It reads better" is not.
Training still appears in two places: fine-tuning a small model for a narrow, high-volume task, and training an evaluator for judgment calls you make hundreds of times a day. Both come after the loop works. They are optimizations you earn, not the starting point.
Quiz
1. A support assistant invents an order status that was never in the retrieved documents. Where does the fix most likely belong?
2. Which of these is ML engineering work rather than AI engineering work?
3. Why does a prompt change need a fixed evaluation set rather than a few hand-picked examples?
4. An ML engineer and an AI engineer are both worried about silent quality decay in production. What do they do about it?
Flashcards
Question
What separates AI engineering from ML engineering in one sentence?
Click to reveal answer
Answer
ML engineers train and deploy models on structured data for narrow predictions; AI engineers compose existing foundation models into application features.
Question
What is the day-to-day iteration loop for LLM feature work?
Click to reveal answer
Answer
Prompting, retrieval, and evaluation: change instructions or context, rerun a fixed eval set, and compare pass rates before merging.
Question
Where does the fix live when a language model states something your data never said?
Click to reveal answer
Answer
In the application layer: retrieval quality, refusal rules for uncovered questions, and output validation. Not in retraining.
Question
Name the three practices both roles share in production.
Click to reveal answer
Answer
Data hygiene (clean, minimal inputs), testing discipline (assert on held-out metrics or fixed behavioral cases), and monitoring (drift charts vs eval pass rate, latency, and cost).
Question
What is the risk of mislabeling a wiring bug as a model-quality problem?
Click to reveal answer
Answer
You schedule an expensive fine-tune that cannot fix the defect, while the one-line retrieval or validation fix waits. The bug ships again.
Revision Notes
Key Takeaways
- 1. The boundary is drawn by who owns the fix: weights and data versus the code composing model calls
- 2. LLM feature work is an eval loop, not a training pipeline; training is an optimization earned later
- 3. A prompt change without a fixed eval set is an opinion, not a change
- 4. Data hygiene, testing, and monitoring are shared practices with role-specific artifacts
- 5. Name the side of the boundary before proposing a fix; it is the fastest seniority signal in a review or interview
Interview Tips
- • "How would you fix a chatbot giving wrong answers?" — separate the causes first: missing context, prompt drift, or genuine model limits, then pick the cheapest fix for the cause you named
- • Expect "would you fine-tune here?" — answer with the conditions: only after prompting and retrieval are exhausted, with a labeled set and an eval to prove the win
- • Describe your eval setup concretely: case count, what a pass means, and the before/after numbers of a real prompt change
- • Be ready to say what you monitor post-launch: eval pass rate on live samples, latency, error rate, and cost per request alongside classic drift checks
Cheat Sheet
AI Engineering vs ML Engineering
Decision rule: Who owns the fix?
- Input data, labels, features, drift -> ML engineering (retrain, re-split, re-monitor)
- Prompt, context, tool wiring, output validation -> AI engineering (change the app layer)
Side-by-side:
| ML Eng | AI Eng | |
|---|---|---|
| Input | structured rows | text, documents, chat |
| You ship | a trained model | code composing model calls |
| Primary failure | drift, leakage, bad labels | missing context, loose prompt, unvalidated output |
| Test | metric on held-out split | behavior on fixed cases, model mocked |
| Watch in prod | feature/prediction drift | eval pass rate, latency, error rate, $/request |
Iteration loop: prompt change -> retrieval change -> rerun fixed eval set (50-300 cases) -> compare pass rates -> merge or revert.
Cost of a wrong fix: retraining a foundation model to patch app logic burns budget and time; patching a prompt over a data leak guarantees recurrence.
Continue Learning
Before You Start
- No prerequisites listed.