Skip to main content

31 posts tagged with "machine-learning"

View all tags

Measuring the Wrong Half of Your RAG Pipeline

· 9 min read
Tian Pan
Software Engineer

Your RAG eval dashboard is green. Faithfulness is 0.91, answer relevance is 0.88, and the LLM-as-judge harness you spent two sprints building says the system is doing fine. Meanwhile, a user just asked a question whose answer sits in a document your retriever never surfaced, and your model wrote a confident, well-structured, entirely useless response about something adjacent. The judge scored it highly. It read well. It was grounded in the passages it did get. It just answered the wrong question with material that had nothing to do with what the user needed.

This is the quiet structural flaw in how most teams evaluate retrieval-augmented generation: they grade the essay and never check whether the student was handed the right book. A RAG system is two machines bolted together — a retriever that decides what the model gets to see, and a generator that decides what to do with it. Almost every eval harness in production measures only the second machine. The first one, the one that actually determines the ceiling on answer quality, runs unmonitored.

The ML Engineer You Hired Isn't the AI Engineer You Need

· 9 min read
Tian Pan
Software Engineer

A VP of Engineering decides the company needs to "do AI." There is already a machine learning team — three people who built the recommendation model, tuned the fraud classifier, and maintain a feature store. The obvious move is to point them at the new LLM initiative. They know the math. They've shipped models. How different could it be?

Six months later the prototype demos beautifully and dies in production. Nobody can say why the agent occasionally books the wrong meeting, the cost per request is four times the estimate, and there is no way to tell whether last week's prompt change made things better or worse. The ML team is frustrated because none of the tools they're good at — gradient descent, data pipelines, hyperparameter sweeps — apply to a model they can't retrain and can't see inside.

This is the most common org mistake in AI right now, and it comes from a reasonable-sounding assumption: that the craft of building models and the craft of building on models are the same job with a different label. They are not. They overlap less than "frontend engineer" and "backend engineer" do.

The Pager Doesn't Ring for a 3% Regression: On-Call for Statistical Failures

· 10 min read
Tian Pan
Software Engineer

Your on-call rotation was designed to catch a different kind of failure than the one that will actually take down your AI product. It watches for the service that stops responding, the latency curve that spikes, the error rate that crosses 1%. These are step functions: something was working, then it wasn't, and the discontinuity is loud enough to page a human at 3 a.m. The entire apparatus — thresholds, runbooks, escalation policies — assumes failure announces itself.

The failure mode that matters for a system with a model in the loop is the opposite. Last Tuesday your extraction pipeline was 94% accurate. This Tuesday it's 91%. Nothing crashed. Every request returned a 200. Latency is flat. The output is still well-formed JSON. But three percent of your users are now getting subtly wrong answers, and they will not file a bug, because the answer looks right. The pager stayed silent because there was nothing for it to fire on. By the time someone notices — usually a customer, usually angry, usually weeks later — the regression has been quietly compounding the whole time.

Your Synthetic Training Data Is Collapsing Toward the Mean

· 8 min read
Tian Pan
Software Engineer

You needed more training data, so you generated it. A model wrote a few thousand examples to fill the gaps in your dataset — edge cases, underrepresented intents, the long tail your real logs never covered. You spot-checked a sample. Each example looked fine: grammatical, on-topic, correctly labeled. You shipped the batch into your fine-tuning set and moved on.

Three rounds later, your model is worse at exactly the cases you generated data to cover. Not catastrophically worse — just quietly, uniformly mediocre. The rare intents that used to work sometimes now never work. The phrasing your users actually type gets misread. And nothing in your quality checks ever flagged it, because every individual example you generated really was fine.

The failure is not in any single example. It is in the distribution. Synthetic data, generated and re-generated without a reality anchor, contracts toward the mean — and the tails, which are the entire reason you reached for synthetic data, are the first thing to go.

Your Eval Set Is a Frozen Photograph of Traffic Your Users Already Left

· 10 min read
Tian Pan
Software Engineer

You shipped a model upgrade. The eval suite went from 87% to 91%. The release notes wrote themselves, leadership clapped, and then the dashboards that actually matter — user satisfaction, escalation rate, thumbs-down ratio — did nothing. Flat. Maybe slightly worse.

This is one of the most disorienting failure modes in AI engineering, because nothing is broken. The eval ran correctly. The numbers are real. The model genuinely improved on the 600 examples you tested it against. The problem is that those 600 examples are a photograph of traffic from the week you built the suite, and your users have spent the months since then walking out of frame.

When Your Test Set Leaks Into Fine-Tuning: The Contamination You Cause Yourself

· 9 min read
Tian Pan
Software Engineer

Everyone in AI knows the cautionary tale of benchmark contamination: a model vendor scrapes the open web, GSM8K and MMLU end up in the pretraining corpus, and the reported scores measure recall instead of reasoning. It is treated as somebody else's sin — the foundation lab's problem, an artifact you inherit. So you build your own held-out eval set, keep it in a private repo, and assume you are clean.

You are probably not. The most damaging contamination in a production AI system is rarely inherited. It is manufactured, in-house, by well-meaning engineers following a sensible-looking workflow. Your eval set leaks into your training pipeline through doors you built yourself, and the leak is silent: every dashboard turns green at exactly the moment your benchmark stops measuring anything real.

This is the contamination you cause yourself. It deserves more attention than the kind you inherit, because you are the only one who can detect it — and almost nobody audits for it.

The Retrograde Accuracy Problem: Why AI Features Degrade as Your Product Grows

· 10 min read
Tian Pan
Software Engineer

Your AI feature ships clean. Accuracy on the eval set: 91%. Latency: acceptable. The team is proud. Six months later, users are complaining that the feature feels "dumb," support tickets are climbing, and your aggregate metrics are quietly 8% worse than launch day. Nobody changed the model. The underlying data pipeline is intact. What happened?

This is the retrograde accuracy problem. As your product grows — new features, new user segments, new edge cases, new flows — the input distribution your AI sees in production quietly drifts away from the distribution it was trained on. No model update. No data pipeline failure. The product itself outgrew the model.

When to Reach for an LLM vs. a Simple Heuristic: A Four-Factor Framework

· 10 min read
Tian Pan
Software Engineer

A logistics company spent $800K and twelve months trying to use AI for route optimization. At the end of the engagement, their routes were marginally better than the heuristics they already had. Leadership rejected the next three AI proposals. A food delivery company faced the same route problem and solved it in a single night with a set of explicit business rules.

The expensive lesson both teams discovered: route optimization with real-time constraints, driver preferences, and time windows is not an AI problem — it's a combinatorial scheduling problem. The patterns you need to learn aren't hidden in data; they're explicit domain logic that someone in operations already knows.

This plays out across every industry. A 2025 MIT study found 95% of enterprise AI pilots delivered zero measurable impact despite $30–40 billion in combined investment. The dominant failure mode wasn't bad models or insufficient data. It was teams building AI solutions for problems where AI was the wrong tool.

Training Data Self-Poisoning: When Your AI Feature Corrupts Its Own Ground Truth

· 10 min read
Tian Pan
Software Engineer

Your recommendation model launched three months ago. Click-through rates are up 18%. Watch time is climbing. The dashboard is green. Leadership is happy.

And your model is quietly destroying the data it will use to train its next version.

This is training data self-poisoning: a feedback loop where a deployed AI feature shifts user behavior in ways that corrupt the interaction data the model was originally trained to learn from. The worst part is that your standard engagement metrics will tell you everything is fine — right up until they don't.

Fine-Tuning Data Saturation: When Adding Examples Makes Your Model Worse

· 9 min read
Tian Pan
Software Engineer

There's a pattern that repeats across almost every fine-tuning project that runs past the initial demo: the team hits a quality plateau, decides they need more data, adds 50% more examples, retrains, and discovers the model is either identically mediocre or measurably worse. The instinct to add data is correct for most software problems — more signal generally helps. But fine-tuning has a saturation regime that pre-training does not, and most practitioners don't recognize when they've entered it.

A 2024 study testing LLM fine-tuning on the Qasper dataset found that expanding the training set from 500 to 1,000 examples caused Mixtral's accuracy score to drop from 4.04 to 3.28 and completeness from 3.75 to 2.58. This wasn't a hyperparameter bug. It was data saturation: the model had begun memorizing distribution noise rather than learning generalizable patterns. The team added fuel after the engine had already flooded.

Personalization Profile Decay: When Your AI's Model of the User Stops Being the User

· 10 min read
Tian Pan
Software Engineer

Your AI personalization system learned who your users are. It built profiles, tuned embeddings, and delivered recommendations that felt uncannily accurate. Then, quietly, it started lying to you. Not with errors — with stale truths. The user who was obsessed with Kubernetes last quarter joined a startup and now needs to understand sales pipelines. The customer who bought baby gear for two years just sent the youngest to kindergarten. Your model still thinks it knows them. It doesn't. This is personalization profile decay, and it's the silent failure mode that teams discover only when users complain that their AI "doesn't get me anymore."

The First AI Feature Problem: Why What You Ship First Determines What Users Accept Next

· 9 min read
Tian Pan
Software Engineer

Most teams ship their boldest AI feature first. It's the one they've been working on for six months, the one that makes a good demo, the one that leadership is excited about. It fails in production — not catastrophically, just enough to make users uncomfortable — and suddenly every AI feature that follows inherits that skepticism. The team spends the next year wondering why adoption is flat even after they fixed the original problems.

This is the first AI feature problem. What you ship first establishes a precedent that persists long after the technical issues are resolved. User trust in AI is formed on the first failure, not the first success. The sequence of your launches matters more than the quality of any individual feature.