The Dataset Is the Real Source Code
Muhammed Hidash · · 2 min read
I had built AI products before: an agentic chatbot that could run a whole app on its own, a recommender that suggested dishes based on dietary preferences. The full combo of RAG, tool calling and prompt templates. That was my mental model of "doing AI."
Then we set out to build a vision feature: take a photo, find every problem in it with a confidence score, and preview what the result could look like afterwards.
My plan, and why it was wrong
My plan was to take a vision model, turn it into an expert with a good prompt, feed it the photo, and get everything back in one shot. It doesn't work like that.
- A vision model doesn't know where to look just because you ask nicely. You first segment the region that matters, or it wastes attention on everything else.
- You need a separate detection model whose only job is spotting problems, each with a confidence score. Let a general model "find" things on its own and it will invent problems that aren't there.
- The LLM's job is smaller than I assumed: explain the detector's findings, grounded strictly in them.
- The "after" preview edits only the relevant region and stitches it back, clearly marked as a preview, never a promise.
The real lesson
In software, a function is something I write line by line. If I don't understand it, I open it and read the logic. I kept hunting for that same thing inside the model: one clean rule that decides what counts as a problem. It doesn't exist.
Try writing a clean rule for "this mango is ripe." Colour, softness, smell: any real mango breaks your rule. That's how your grandmother picks one, with no formula and years of practice. Instead, people label thousands of mangoes by hand, and training adjusts millions of numbers to match their judgment.
That is what sat behind our detector. Nobody wrote the rule. Experts labelled real photos, and training found the pattern. So the function isn't rules(input) → output, like I'd built my whole career. It's examples labelled by humans → a function the machine finds itself.
The dataset is the real source code: human expertise, written down. The shift is from "what's the logic?" to "what's the data?"
Learning this took longer than I expected, and that surprised me more than the topic did. Once it landed, I stopped looking for a rule that never existed and started asking better questions: which examples taught this function, and are they good enough?
This started as a LinkedIn post.
Join the conversation there, or connect with me.
Discuss on LinkedIn →