Alistair McCormick

Back to writing

Removing misinformation in AI content

I run the backend department for the retention squad at my company. Before AI, that meant building the tools, cache, and publishing pipelines so our editors could get recipes out through search, homepage rails, and feeds.

Now the scope has grown. We publish thousands of recipes for home cooks, and we are building systems to manipulate that content in new ways: translations into American English and French, "make it vegetarian" adaptations, blended methods, dietary labels, tagging, semantic vectors, and different modes of cooking.

As the backend engineer leading this work, I'm not just building for cost and scale; I'm trying to keep misinformation to a minimum. People rely on our app to feed their families, make healthy meals, stick to their budgets, and not waste good ingredients on a bad dish. If an AI gets a blog summary slightly wrong, someone shrugs. If it tells someone that rice can sit out for hours before being stored, someone can get sick.

Every AI feature can fail in the same way. The model sounds confident, the output looks fine, and it quietly makes something up: a quantity that was never in the recipe, misinformation on storing a reipe, or a food safety tip our content team never wrote.

None of our safeguards are perfect yet, and we simply generate too much content to get editor reviews on all of it. So we use four plain habits to keep things grounded and incrementally improve over time:

1. The model reshapes facts. It doesn't supply them.

Anything that's a fact, like an allergen, a quantity, a cooking time, or a safety instruction, comes from structured data or from a recipe our content team wrote. The model's job is to reword and reorganize that material, not to know it.

Dietary labels don't use AI at all. Every ingredient in our system has known dietary data, and code calculates a recipe's labels from those ingredients. If the system is unsure, it claims less. Wrongly saying a recipe contains gluten costs us a slightly shorter search result; wrongly saying it doesn't can cost someone their week.

Generated content is also tied to the recipe version it came from. If an editor changes the ingredients or the method, old adaptation tips stop being shown so they can't drift away from the dish. And for complex features, the model prepares structured data once when a recipe publishes, never live per user, so the same input always gives the same output.

2. Code checks the model's work

Every generation comes back as JSON against a strict schema, never as free text. Code checks the JSON; if it fails, we retry once, and if it fails again, it doesn't ship.

Before a recipe publishes, simple rules check the basics: does every ingredient have a quantity, and does every step only use listed ingredients? We also have an AI reviewer score each recipe, though an AI score can jump ten points between runs on an unchanged recipe. Hard rules block bad recipes on their own; the AI score only nudges.

If automated rules give a low score, we retry with a stronger model. If it still fails, we save it in a disabled state and flag it for a person to review. Any change to a prompt also runs against a set of reference outputs written by our food team before it can merge.

3. People make the risky calls

Reviewers who approve hundreds of fine outputs a day eventually stop actually reading them. Instead, we put editors where they add the most value. When tagging ingredients across our catalog, a model ran a dry run and an editor settled the borderline cases once.

Editors can also rewrite any translation or adaptation. Their edit is marked as manual so automatic regenerations won't overwrite it, and if a major upstream change ever forces an overwrite, the team gets an alert. When we first launched adaptations, they could only be triggered manually by an admin so the food team could inspect real outputs before we wired them into publishing.

4. Measure what actually happens

Every AI call writes to an audit table logging what ran, which model ran it, what it cost, and how it scored. We also built our content system so any AI feature can be A/B tested against a version without it, and every recipe response gets a completeness check right before it is sent to the user so stale cache data never slips through. (We wrote up our first experiment in Your AI content needs a control group.)

What went wrong anyway

Our most interesting failures weren't the model hallucinating, but bugs in the code around a correct answer:

  • The base recipe that made chicken tacos vegan. Our dietary logic initially only checked a recipe's immediate ingredients, missing that a taco recipe built on a pulled chicken base wasn't vegan. We fixed it by traversing the full chain of base recipes, and stripping labels if a base can't be found.
  • Correct labels, stale translations. Recalculating dietary labels updated the original recipes, but translated copies kept the old labels because a labels-only change didn't trigger a new translation. A fact has to be right everywhere it's copied.
  • "Blocked" that didn't block. Early on, our validator marked recipes as failed after they had already been saved and published. A safety check has to sit where the publishing decision actually gets made.

None of this is glamorous. Most of the work in "AI content" turns out to be data modeling, validation, and cache invalidation. The more of the system you can make boring and predictable, the less room the model has to be confidently wrong.