AISArchitecture

Prompt-only vs pipeline + AI: code computes, AI explains

It's tempting to upload a big spreadsheet to an AI chat and ask for a dashboard. It's fast. The catch: run it again and the totals can change. Here's the setup that keeps the number the same tomorrow.

The short version
  • An LLM is great at reading, writing and explaining. It is not a calculator you can audit.
  • Ask it to total a big file twice and you may get two different answers, even when it writes code for you.
  • The fix: a backend pipeline does the math. Then the AI explains numbers that are already checked. Code computes, AI explains.
The 25-second version (no sound)
Fig 1 · Same file. Same answer?

Pipeline + AI
Prompt-only shortcut
01

File

Tap any box to see what it does. Switch between the two paths above.

Why the totals change

An LLM is great at reading, writing and explaining. It is not a calculator you can audit.

Ask it to total a big file twice and you may get two different answers. Even when the chat writes code for you, it can write different code each run. Sometimes it only reads part of the file. Sometimes it guesses what a column means, and guesses wrong.

The line For a quick one-time look, prompt-only is fine. For a number someone will make a decision on, it isn't.

The fix is old-fashioned: a pipeline

  1. Load the file the same way every time.
  2. Validate it. Missing columns, duplicates and wrong types get caught before anything else runs.
  3. Store the clean data, then compute the numbers in code. Same input, same output, every run.
  4. Serve the results through an API. Then the AI explains: it summarizes, charts and answers questions on numbers that are already checked.
  5. Monitor it. The same input should always give the same answer. If it doesn't, you hear about it before anyone uses the number.

Side by side

Prompt-only

file → AI chat → answer Fast, but the answer can change.

Pipeline + AI

file → load → validate → store → compute → API → AI explains A bit more setup, and the answer is the same tomorrow.

The AI still does the part it's great at. It just isn't the thing doing the math.

My rule: code computes, AI explains. Where do you draw that line in your work? Tell me on LinkedIn.

Further reading

The post is an explainer in my own words. These go deeper on the two halves of it.

  1. Defeating Nondeterminism in LLM Inference Horace He · Thinking Machines Lab · Sep 2025 · why the same prompt can come back different, even at temperature 0
  2. Pandera documentation Open-source Python data validation for dataframes · one way to do the Validate step in code
AIS

← All breakdowns

Detailed breakdowns of AI and data architecture, diagrams included.

Previous breakdown

BI-ready vs AI-ready: does your architecture have a way back?

Same data. Different architecture. One arrow changes three things.

Next breakdown

Your eval score might be lying: the grader can be the bug

A score jumped from 66.1% to 87.9%, partly by fixing broken graders.