AI Chatbots Help Predict Preterm Birth From Big Data in Minutes

In a head-to-head test, AI chatbots turned massive pregnancy datasets into working prediction models in minutes, rivaling expert teams that spent months. The work hints at a faster path to tools that could help protect mothers and babies from preterm birth.

With a few carefully crafted sentences, artificial intelligence chatbots turned massive pregnancy datasets into working prediction models in minutes — rivaling expert teams that had spent months on the same task.

In an early test of how generative AI could speed up health research, scientists at UC San Francisco and Wayne State University found that several AI tools could build computer code to analyze pregnancy data far faster than traditional approaches, and in some cases match or even beat human-built models.

The project focused on one of the most urgent problems in maternal and newborn health: preterm birth. Babies born too early face a higher risk of death in the first weeks of life and long-term motor and cognitive challenges. In the United States, about 1,000 babies are born prematurely every day.

Researchers have long hoped that “big data” — huge collections of biological and clinical information — could reveal early warning signs of preterm birth and other complications. But turning that raw data into reliable prediction tools usually requires teams of highly trained data scientists and months or years of work.

The new study, published in the journal Cell Reports Medicine, suggests that generative AI could dramatically shorten that timeline.

Co-senior author Marina Sirota, a professor of pediatrics at UCSF and interim director of the Bakar Computational Health Sciences Institute (BCHSI), co-led one of three international data challenges, known as DREAM (Dialogue on Reverse Engineering Assessment and Methods), that laid the groundwork for the AI experiment. Her challenge focused on the vaginal microbiome, the community of microbes that live in the vagina, and how it might be linked to preterm birth.

To tackle the problem, Sirota’s group had previously pulled together microbiome data from about 1,200 pregnant women across nine studies, along with information on whether the women delivered early or at term. Other DREAM challenges, led by Wayne State’s Adi L. Tarca, used blood and placental tissue samples to improve how doctors estimate the stage of pregnancy, a key factor in deciding what care a patient needs.

More than 100 teams from around the world entered the DREAM competitions, building machine-learning algorithms to find patterns in the data that could predict preterm birth or more accurately date pregnancies. Most teams met the challenge goals within three months, but fully analyzing the results and publishing them took nearly two years.

Even assembling that much data was an achievement.

Co-senior author Tomiko T. Oskotsky, the co-director of the March of Dimes Preterm Birth Data Repository and an associate professor in UCSF BCHSI, emphasized the importance of collaboration.

“This kind of work is only possible with open data sharing, pooling the experiences of many women and the expertise of many researchers,” he said in the news release.

Despite all that effort, the sheer volume and complexity of the data remained a major bottleneck. So Sirota and Tarca decided to see whether generative AI could help.

They selected eight AI chatbots and gave them natural-language prompts — instructions written in everyday language, but tailored to the scientific task. The prompts asked the AI tools to write code that would analyze the same DREAM datasets and build prediction models, without any human writing or editing of the code itself.

The goals were the same as in the original challenges: use vaginal microbiome data to look for signs of preterm birth, and use blood or placental samples to determine how far along a pregnancy is.

Only half of the AI tools produced usable code. But the four that did were able to generate analysis pipelines and prediction models that performed on par with, and sometimes better than, the models created by the DREAM teams.

The time savings were striking. A junior research pair — a UCSF master’s student, Reuben Sarwal, and a high school student, Victor Tarca — used AI assistance to generate working code in minutes, for tasks that would typically take experienced programmers hours to days. With that boost, they and their collaborators were able to run experiments, check the results, and write and submit a scientific paper in just a few months. The entire generative AI project, from initial idea to journal submission, took about six months.

For Sirota, the implications go beyond this one study. She sees generative AI as a way to remove some of the most tedious and time-consuming steps in data science.

“These AI tools could relieve one of the biggest bottlenecks in data science: building our analysis pipelines,” she said. “The speed-up couldn’t come sooner for patients who need help now.”

The researchers stress that AI is not a replacement for human expertise. Scientists still have to design good questions, choose appropriate datasets, and carefully check the outputs. Generative AI can also produce misleading or incorrect results, so human oversight remains essential.

But by automating the first drafts of complex code, AI could open doors for many more researchers, including those without deep training in computer science.

“Thanks to generative AI, researchers with a limited background in data science won’t always need to form wide collaborations or spend hours debugging code,” added Tarca, a professor in the Center for Molecular Medicine and Genetics at Wayne State. “They can focus on answering the right biomedical questions.”

If that vision holds up, the impact could be far-reaching. Faster, more accessible data analysis might accelerate the search for biomarkers that flag high-risk pregnancies earlier, support the development of better diagnostic tests, and help clinicians tailor care to individual patients.

Beyond pregnancy, similar AI-assisted approaches could be applied to cancer, heart disease, infectious diseases and many other conditions where large datasets already exist but are underused because of limited analytic capacity.

For now, the UCSF and Wayne State team see their work as a proof of concept: with the right prompts and careful oversight, generative AI can help turn complex health data into insights much more quickly than before.

The next steps will likely include testing newer AI models, refining prompts to reduce errors, and exploring how to safely integrate AI-generated analyses into real-world research and, eventually, clinical decision-making.

The study also underscores a broader point: the combination of open data, collaborative science and powerful new tools like generative AI may be key to unlocking the full potential of biomedical big data — and to getting answers to patients and families faster when they need them most.

Source: University of California San Francisco