Skip to content
beginner Phase 1 · AI Engineering Landscape

AI Engineering vs ML Engineering

How LLM-powered product work differs from classical model training workflows.

30m
0 problems
Topic Progress 0%

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.

  1. Prompting — change the instructions, the message structure, or the few-shot examples, then rerun.
  2. Retrieval — change which documents or records land in the context window, because most factual errors are missing context rather than a weak model.
  3. 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.

The Practices Both Roles Share

Strip away the tooling names and the two roles fail in the same ways and defend against them with the same three practices.

Data hygiene. An ML engineer rejects rows with impossible values before training so the model never learns from garbage. An AI engineer strips customer identifiers out of prompt payloads before the request leaves the building and pulls only the fields the feature needs, as covered in Responsible AI Foundations. Same instinct: the quality and the legality of the input decide the quality of everything downstream.

Testing discipline. ML work asserts on metrics computed from a held-out split (Train, Validation, and Test Splits). AI work asserts on parsing, formatting, and behavior over fixed cases with the model mocked out (Testing AI Code). Neither role ships a change that was only eyeballed.

Monitoring. The ML engineer watches feature distributions and prediction error for drift (Production Monitoring and Drift Detection). The AI engineer watches latency, error rate, spend per request, and eval pass rate over live traffic. Different charts, identical purpose: detect degradation before a customer files the ticket.

Failure modes show up when teams blur the boundary:

  • A team labels an LLM bug a "model problem," schedules a fine-tune, and ships nothing for six weeks while the actual fix was one retrieval change.
  • Model output is concatenated into a query with no schema check, so a malformed string becomes a runtime error. That fix belongs in JSON Handling and Pydantic Models, not in a prompt.
  • Classical ML predictions reach the UI with no confidence threshold, so a low-certainty guess renders as a fact.

In an interview, the fastest signal you can send is naming which side of the boundary a problem sits on before you propose a fix. "This is a data problem, so I would not touch the model first" is a senior answer; a tool-list answer is not.

Quiz

1. A support assistant invents an order status that was never in the retrieved documents. Where does the fix most likely belong?

Question 1 options

2. Which of these is ML engineering work rather than AI engineering work?

Question 2 options

3. Why does a prompt change need a fixed evaluation set rather than a few hand-picked examples?

Question 3 options

4. An ML engineer and an AI engineer are both worried about silent quality decay in production. What do they do about it?

Question 4 options

Flashcards

Question

What separates AI engineering from ML engineering in one sentence?

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?

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?

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.

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?

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.

Related Reading