Drug Identity in Medical AI: How RxNorm and NDC Stop Hallucinations

RxNorm and NDC give drugs a stable identity. Learn how coded drug data grounds medical AI against drug-class confusion and pharma hallucination.

Prometheus BioJune 23, 20267 min read

A language model that confidently invents a drug name, or quietly swaps a medication for its near-twin in a different therapeutic class, is not making a small mistake. It is failing at the most basic question in pharmacology: which drug are we actually talking about? The fix is not a bigger model. It is grounding the model in data where every drug already has a stable, machine-checkable identity — and in U.S. healthcare, that identity is carried by RxNorm and NDC codes.

This article explains what those two coding systems are, why "drug identity" is genuinely hard, how identity failures show up as hallucinations in medical AI, and why coded, normalized drug data is the durable antidote.

The drug-identity problem, from first principles

Ask a clinician, a pharmacist, an insurer, and a manufacturer to name a single product and you may get four different strings: a brand name, a generic ingredient, a "what's on the bottle" label, and a billing code. The same molecule appears as acetaminophen and paracetamol; the same pill ships under a dozen brand and store labels; the same brand spans tablets, capsules, syrups, and a half-dozen strengths.

Free text makes this worse. "Tylenol," "tylenol PM," "APAP 500," and "acetaminophen 500 mg oral tablet" all gesture at overlapping but non-identical things. Until you can collapse those surface forms onto one canonical concept — and distinguish the ones that only look alike — you cannot count, compare, deduplicate, or reason about medications reliably. That collapsing step is drug normalization, and it is the prerequisite for everything downstream, from analytics to model training.

RxNorm: a normalized name for a clinical drug

RxNorm is a standardized clinical-drug vocabulary maintained by the U.S. National Library of Medicine (NLM). Its core job is to give every clinical drug a single normalized identity regardless of which vendor, EHR, or brand string it arrived as.

The unit of identity is the RxCUI — a concept unique identifier. One RxCUI represents one clinical drug concept (for example, a specific ingredient at a specific strength in a specific dose form), and it stays the same no matter which manufacturer made it or which source system reported it. RxNorm also models drugs at multiple levels of specificity, from active ingredient up to a fully packaged product, and links the synonyms and brand names that point at each concept.

The practical payoff: RxNorm is what lets you say two records are "the same drug" with defensible precision, and what lets you walk up from a messy string to an ingredient or down to a dispensable product on purpose rather than by guesswork.

NDC: the identity of a physical package

The National Drug Code (NDC) answers a different question. Where RxCUI names the clinical concept, NDC identifies the actual marketed product on the shelf. It is a three-segment code — labeler (manufacturer), product (strength, dosage form, formulation), and package (size and type) — administered in connection with the FDA's NDC system.

Two wrinkles matter for anyone building data pipelines. First, format: NDCs appear in 10-digit form in some sources but are normalized to an 11-digit, no-dash format (commonly padded 5-4-2) for HIPAA transactions and claims. Mishandle the leading-zero padding and you create phantom "new" products that are really the same item. Second, granularity: a single RxNorm clinical drug concept typically maps to many NDCs (one per package size or labeler), while a given NDC is expected to roll up to a single RxNorm concept. That many-to-one relationship is the bridge that lets you connect what was dispensed (NDC) to what it is (RxCUI).

RxNorm vs NDC — and the class layer on top

So the short version of RxNorm vs NDC: RxNorm is the normalized clinical concept; NDC is the specific physical package. You need both. NDC tells you the exact product in the supply chain; RxNorm tells you that ten different NDCs are, clinically, the same thing.

Crucially, these codes don't sit in isolation. RxNorm and related NLM resources (such as RxClass) link drug concepts to therapeutic classes drawn from sources like the Anatomical Therapeutic Chemical (ATC) classification. That makes a clean chain possible:

> NDC → RxCUI → ingredient → drug class

Once a drug is coded this way, "is this a beta-blocker?" or "do these two records share a mechanism of action?" become lookups against a maintained relationship graph, not judgment calls. This is exactly the structure that grounds a model — and it's verifiable public knowledge, not anyone's proprietary secret.

Drug-class confusion as an LLM failure mode

Here is where ungrounded models break in a specific, characteristic way. Drug names are dense with near-collisions, and an LLM's instinct is to produce a plausible-sounding token, not a verified one.

Three patterns recur:

  • Sound-alike / look-alike substitution. A model nudges hydroxyzine (an antihistamine) toward hydralazine (a vasodilator), or metoprolol toward metformin. The strings are close; the pharmacology is not.
  • Class generalization. Asked about one statin, a model attributes a property of the class — or of a different statin — to the specific drug, blurring real differences in metabolism or interactions.
  • Confident fabrication. Prompted for an NDC or a brand, the model emits a well-formatted but nonexistent code, because "looks like an NDC" is easier to satisfy than "is a real NDC."

None of these are exotic. They are the expected output of a system optimizing for fluent continuation over factual identity. And in a pharmacology context, swapping a drug for its near-twin or inventing an identifier is precisely the kind of error that sounds right and is dangerous.

This is an explainer about data and model behavior, not medical advice; clinical decisions should always involve a qualified professional.

How coded drug data grounds models against hallucination

Coding doesn't make a model smarter in the abstract — it changes what the model is allowed to say and what it can be checked against.

At training time, data where every medication carries an RxCUI and NDC teaches the model on disambiguated identities instead of ambiguous strings. "Acetaminophen 500 mg oral tablet" and its synonyms map to one concept, so the model learns the real boundaries between drugs rather than memorizing spelling coincidences.

At inference / retrieval time, the same codes become guardrails. A retrieval-augmented or tool-using system can resolve a mention to an RxCUI, fetch the authoritative NDCs and drug class, and constrain or validate the answer against that record. An invented NDC fails the lookup. A class claim can be checked against the actual ingredient-to-class mapping before it reaches a user.

At evaluation time, codes give you a ground truth to score against. You can measure whether a model resolved a mention to the correct RxCUI, not merely whether its prose read well — turning "did it hallucinate the drug?" into a measurable, codeable question instead of a vibe.

The throughline: identity has to be carried in the data. A model can only avoid drug-identity hallucinations if the corpus it learns from and the references it checks against already encode identity unambiguously.

For real-world evidence used in regulatory contexts, coding and provenance standards go beyond what any single article can cover; treat this as background, not regulatory guidance.

Key takeaways

  • RxNorm gives a drug a normalized clinical identity (RxCUI); NDC identifies the specific physical package. You need both, and the many-NDC-to-one-RxCUI bridge links what was dispensed to what it is.
  • Watch NDC formatting — the 10- vs 11-digit, leading-zero issue silently fractures the same product into "different" ones.
  • The chain NDC → RxCUI → ingredient → drug class turns risky judgment calls into verifiable lookups against maintained, public vocabularies.
  • Drug-class confusion is a signature LLM failure mode — sound-alike substitution, class generalization, and fabricated codes all flow from optimizing fluency over identity.
  • Coded data grounds models at every stage — cleaner training signal, retrieval guardrails that reject invented identifiers, and a real ground truth for evaluation.

Closing

Drug identity is the kind of unglamorous infrastructure that decides whether a medical AI system is trustworthy or merely articulate. RxNorm and NDC already provide the vocabulary; the harder work is delivering longitudinal clinical data where that identity is consistently encoded, normalized, and class-mapped end to end. That is the category of ground truth Prometheus Bio focuses on — coded, de-identified data built so models can be checked against reality, not just sound like it.