Skip to content
Back to Journal
AI Engineering

When Structured AI Output Looks Right but Isn't

A routine test of my Pharma Complaint Copilot exposed a subtle failure: missing information appeared as structured data. A reflection on validation, uncertainty, and building reliable AI workflows.

Manufacturing date: True.

That was one of the values I encountered during an end-to-end test of Pharma Complaint Copilot, an AI-assisted pharmaceutical complaint-review application I built.

The input was a synthetic packaging complaint. The application extracted the supplied information, generated a structured draft, and presented everything for review.

The workflow appeared to be functioning.

But manufacturing date, expiry date, and affected quantity—details never mentioned in the source—had been populated with the literal value "True".

It wasn't an API failure or an obvious crash. It was incorrect information sitting inside an otherwise usable response.

That distinction matters.

Structured outputs make LLM applications easier to integrate. Predictable JSON, schemas, and type validation help create consistent interfaces between models and backend systems.

But structure alone doesn't establish factual accuracy.

A value can fit into a response format without being supported by the input. Even a correctly formatted date would be unreliable if the original document never mentioned one.

In extraction workflows, the question isn't simply whether a field has a value. It's whether that value has evidence behind it.

Fortunately, the application includes a human-review stage before committing information to its complaint ledger.

I corrected the unsupported fields to empty or unknown, preserved the details actually supplied, and committed the synthetic record. The record remained accessible afterward.

That confirmed the review and persistence workflow for this test. It didn't mean the underlying extraction issue was resolved.

There's also an important debugging question still open: did these values originate in the LLM response, backend processing, or frontend handling?

Identifying that boundary is part of the work ahead.

My next priorities would be stronger field-level validation, explicit missing-value states, and regression tests using deliberately incomplete complaint narratives.

I'd also want extracted values to remain traceable to their supporting source text wherever practical.

The broader lesson extends beyond this particular application.

As AI models become easier to integrate, dependable product engineering increasingly depends on what surrounds them: validation, evidence, uncertainty handling, and meaningful human control.

Sometimes, the most accurate output an AI system can produce is an empty field.