A new study used artificial intelligence (AI) to analyse health data from 2.2 million people in Denmark. The results are striking: poor sleep is closely linked to mental distress and the use of non-recommended treatments – especially among young adults.
A new mother lies wide awake, exhausted.
A nurse comes off a night shift and tries to calm her restlessness with a sedating allergy pill – just to get a few hours of sleep.
A 24-year-old student stares at the ceiling at four in the morning, wondering how to move on.
These are just a few glimpses of the poor sleep and rising distress that affect many people in Denmark in the first half of adult life – when education, work and family are meant to take shape.
Naja Hulvej Rod led the new study and convened the interdisciplinary research team behind the analysis. An epidemiologist at the Department of Public Health of the University of Copenhagen, she explains that the 16-to-45-year-old age span is important because it covers the phase of life when people establish themselves as adults and contribute to both the labour market and family life.
“There is plenty of research on children and older people, but far less on people in these mid-life years,” says Rod. “We are trying to change that with this study, which for the first time offers an overall picture of young adults’ sleep and how it interacts with mental and social well-being.”
A vast pool of data analysed through ChatGPT’s ancestor
The researchers used a form of AI called machine learning to detect patterns in the population’s sleep problems. The method examines not only single numbers but the sequence of events in people’s lives – for example, when diagnoses or prescriptions appear. The computer learns to recognise recurring patterns across large datasets – such as which factors often coincide among people who sleep poorly.
Instead of comparing single factors, the models examine the entire course of people’s lives – for example, the sequence of prescriptions, diagnoses or hospital admissions – to detect recurring patterns. In the study, the model identified complex links in health data from 2.2 million people in Denmark, including information on medicine use, diagnoses and hospital contacts.
Naja Hulvej Rod supervised the project overall, and Adrian G. Zucco analysed the results.
“We used an early version of the technology people now know from ChatGPT – a method that can find patterns when many factors show up at once in a person’s life,” says Zucco.
Zucco and colleagues found that sleep problems rarely occur in isolation. They often coincide with mental distress, the use of melatonin, older sedating antihistamines and other treatments that fall outside official recommendations.
“This shows us that reality for many young adults, has moved ahead of what the healthcare system anticipates in its guidelines.”
He hopes is that society will use these insights to guide those affected towards healthier paths.
Millions of lives turned into digital timelines
For the extensive analysis, the researchers drew on Denmark’s Prescription Registry, National Patient Registry and Psychiatric Central Research Register – databases that together comprise one one of the world’s most precise health information systems.
Instead of comparing a few variables across groups, as epidemiological studies typically do, the researchers viewed each person as a dynamic whole. They built a timeline for every individual’s contact with the healthcare system – showing, for instance, when someone received a prescription, or a diagnosis or was hospitalised.
These timelines were then translated into mathematical representations that allowed the model to recognise similarities between people even when their specific experiences differed. Using this type of machine learning, the model learned to group individuals with similar trajectories – enabling the team to analyse how sleep problems and other burdens interact as connected elements in a person’s life.
“What is interesting is not necessarily which diagnoses people receive, but when and how they occur relative to one another,” says Zucco. “By examining the whole sequence of a life, we obtain very different understanding than if we study one factor at a time.”
The model finds its own way through the data
The approach differs from classic analysis. The researchers set up no hypotheses in advance – instead, the computer explored the data and identified patterns and groups on its own. This exploratory, data-driven approach makes it possible to discover connections that traditional methods might overlook.
Once the groups were identified, the researchers examined their characteristics. For some mental disorders such as anxiety and depression appear before sleep problems; others display a more intertwined pattern involving pain and social strain.
“We found major differences in what types of burdens accompany sleep problems and in what order they occur. That is exactly the kind of insight this method can provide,” says Zucco.
Ultimately, the researchers mapped out a set of typical life-course patterns, offering a new understanding of how poor sleep fits into broader challenges – as key parts of complex, long-term illness trajectories.
The data clearky show a healthcare culture under strain. Many young people receive help in the form of prescriptions – often melatonin or older sedating antihistamines. Melatonin use is growing, and the analysis shows increasing reliance on older sedating antihistamines.
“Medication should be the last step. For this age group, first-line treatment is cognitive behavioural therapy,” says Zucco.
According to international guidelines – for example, the 2023 European Insomnia Guideline – first-line treatment is cognitive behavioural therapy, delivered in person or in validated digital formats.
From individuals to groups to society
To the researchers, the patterns reveal a larger story about what it means to be a young adult today. Rod describes three levels in which the pressure is felt: the individual, the group and society.
At the societal level, many systems interact. Education imposes performance demands early – grades, tests, and long school days. The labour market rewards flexibility but delivers unpredictability and blurred lines between work and leisure. And layered on top is a digital environment in which social media keeps channels open around the clock. Algorithms hold our attention, and screens rarely go dark.
“We saw the media quickly point to the mobile phones as the culprit. But this is not about a single thing,” says Rod. “It is about interaction - in which everything is turned up at once. School, work, social life and the digital world all pull in the same direction. This leaves little room for recovery.”
At the group level, family, friends and colleagues shape sleep habits. Behaviour is often contagious, and in communities marked by restlessness or busyness, short nights become the norm. Individuals react differently, but many try to hold daily life together by finding their own fixes – even when these do not align with clinical recommendations.
The researchers urge decision-makers to look up and see the bigger picture. The study shows how burdens accumulate and become embedded in people’s life courses – but it cannot fully explain the underlying mechanisms.
“We are not committing to a single explanation,” says Zucco. “We are documenting patterns to which others in society must respond.”
What comes next
The study has several methodological strengths. Machine learning enables entire life trajectories to be analysed and reveals patterns that might otherwise vanish in the noise. This approach enabled the researchers to determine how sleep problems are woven into complex life contexts and how these burdens evolve over time.
But there are limits. Registry data give a precise view of healthcare contacts but say less about social conditions, lifestyle and lived experience. To build a more complete picture, the researchers now plan to combine registry data with survey and population-study data, enabling them to monitor how sleep problems unfold in everyday life.
Future phases will focus on early life conditions and their long-term consequences – and on how sleep interacts with other symptoms and disorders from adolescence into adulthood.
The ultimate goal is to understand not just those who suffer but the reality in which they live – a world in which daily life rarely powers down, and sleep is vanishing for an entire generation, and society should ask how to change this.
