When a patient walks into an emergency room, the words written about them in that medical chart can shape how every future doctor sees them. But what happens when those words carry hidden judgment? Researchers at George Mason University are using artificial intelligence to find out—and they say the technology could help make medical records fairer for everyone.

Nurse scientist Teenu Xavier and her team wanted to know whether large language models, or LLMs—computer programs trained on massive amounts of text—could spot stigmatizing language in clinical notes. Think of terms like "addict," "noncompliant," "failed treatment," or "obese person." These words can reinforce bias and affect the care a patient receives long after that single appointment ends.

The results, published in the journal JAMIA Open, showed that AI can indeed identify judgmental language—but the settings matter enormously. The researchers tested several different AI models and found that their accuracy varied widely depending on factors like the model's size, how unpredictable its answers were allowed to be, and even what kind of medical note it was reading.

One striking example: the largest AI model could correctly spot stigmatizing language 94 percent of the time, but it was only right 47 percent of the time when deciding something was NOT judgmental. The smallest model did the opposite—it nailed "not stigmatizing" 99.7 percent of the time but missed almost all the actual stigmatizing language.

There was one finding that held true across every model tested: giving the AI an example of stigmatizing language improved its accuracy. Every single time.

"Simply selecting an LLM is not enough when used for clinical documentation," Xavier said. "Careful attention must be paid to settings and prompting before these tools can be reliably used in health care environments."

The type of medical note also made a difference. Emergency room notes were categorized correctly 69 percent of the time—the highest accuracy. Plan of care notes were the hardest, with only 56 percent accuracy. The researchers found that long, complex notes full of medical details sometimes confused the models, which mistook straightforward descriptions of difficult illnesses for judgmental language.

Still, Xavier sees real promise. With the right setup, AI tools could flag biased language before it reaches patients, helping doctors communicate more fairly and building trust between patients and providers. She calls for more collaboration between health care workers and AI developers to create tools that truly serve patients.

The road to fairer medical records may run through code—but only if humans guide it carefully.