Sleep usually leaves people feeling rested and refreshed, but for the patients of clinical neurologist Guy Leschziner, their non-waking moments are generally anything but peaceful. One realizes that she’s been taking her motorcycle out for a ride while fast asleep only after her landlady asks her where she went. Another moves around in his sleep, acting out his dreams — and terrifying his partner in the process. Still others suffer from insomnia, sleep deprivation, and night terrors.

Leschziner describes their cases and how they inform the growing world of sleep research in his recent book, The Nocturnal Brain: Nightmares, Neuroscience, and the Secret World of Sleep. “These cases are interesting in two separate ways — the first is just simply the drama of the stories, the human experiences of these patients,” Leschziner says. “But also, when one looks at the extremes, it informs us as to the normal as well. By seeing these patients and seeing where the problem is in the brain, we understand something about how our brains regulate sleep.”

The Verge spoke with Leschziner about what makes for a good night’s sleep, what’s going on in the brain when we dream, and how sleep disorders could provide a window into other health issues.

This interview has been lightly condensed and edited for clarity.

You write a lot about abnormal sleep and the patients that you’ve encountered in your practice. I’d like to start off by asking about the opposite: what does a normal good night’s sleep look like?

Sleep — as well as being an objective experience — is also a subjective experience. From an objective perspective, a good night’s sleep is viewed as having a sufficiently consolidated night’s sleep, divided into one or two tranches. If one looks at the population, seven to eight hours is seen as the optimal amount of sleep. But for each individual, the subjective experience of sleep is somewhat different. There could be people who wake up several times a night, but wake up feeling refreshed and able to feel normal during the day. Whereas for other people, what is apparently and objectively a good night’s sleep, can make them feel extremely tired and unrefreshed. So there is this kind of disparity between the objective physical manifestation of sleep and the subjective experience.

“sleep — as well as being an objective experience — is also a subjective experience.”

If you’re going to bed at roughly the same time, waking up at roughly the same time, feeling refreshed during the day, and then able to fall asleep at the same time on a regular basis, then you’re probably getting enough sleep for you.

As someone who studies sleep, how do you feel about the increasing use of sleep tracking devices?

I don’t think there is anything intrinsically wrong with tracking your sleep. But you have to ask yourself “Well, why am I tracking my sleep?” If you are tracking your sleep because you know you’re not getting enough sleep, then you probably don’t need a tracker to tell you that.

I think the big danger is if you’re tracking your sleep because you have insomnia, or because you feel that you’re getting a very, very poor night’s sleep, despite spending a lot of time in bed. When individuals who have a degree of anxiety related to their sleep get data that may or may not be accurate, that reinforces their prejudices about their sleep, and therefore can feed into that sleep-related anxiety and can actually make things like insomnia a lot worse.

One of your patients, John, reported experiencing very vivid dreams and actually started moving while they were asleep. What is the connection between what they’re seeing and experiencing in their dreams and their physical motion while asleep?

Normally, while we’re dreaming, we’re completely paralyzed. The only muscles that really maintain any degree of movement to them are the muscles that move our eyes — that’s where the term rapid eye movement comes from — and also the muscles that allow us to breathe. Obviously, if we stop breathing, from an evolutionary perspective that would not be a good idea.

“Normally, while we’re dreaming, we’re completely paralyzed.”

So there are mechanisms in the brain, that when REM sleep is switched on, generate this paralysis. But in individuals like John, that mechanism of paralysis goes awry. When he enters into dreaming, he is not paralyzed and therefore he is basically acting out the movements that he’s making in his dreams.

Unsurprisingly, dreams play a large role in your book about sleep — what is our current understanding of why we dream?

We know that the stage of sleep most associated with dreaming, rapid eye movement sleep [REM sleep], is something that changes through life. Even before we’re born, we’re probably spending around a third of every 24-hour period in this stage of sleep. But that begs the question: if we’re inside our mother’s womb, what are we dreaming about? What could possibly be the function of the actual dream experience? The likelihood is that dreaming, or REM sleep in particular, has different functions at different stages of life.

When we are very early in development, either as a fetus or maybe as a neonate, it’s probably about developing certain pathways that are responsible for consciousness. Later on in life, it appears that dreaming may be particularly important for learning, but it also seems to be important for the regulation of emotions.

“That may well be what dreaming is — it’s the refinement of our understanding of the world.”

Now, if one looks at the brain like some sort of supercomputer, what we do is we take in a whole load of information, and we interpret it according to our experience of the world. [Our brains essentially] create a predictive model — we can fit what we experience into that model and generate predictions out of it. But we’re constantly accruing information during every waking hour, which all feeds into our picture of the world around us. That means that our model of the world around us has to be constantly tweaked.

That may well be what dreaming is — it’s the refinement of our understanding of the world. I think that explains, for example, why we dream about certain events a long time in the past, but also certain events we’ve experienced during the course of that day. It’s the amalgam of all our experiences being reinterpreted in the context of this model that we’ve created of our external environment.

A recurring theme in your book is that some sleep disorders are potentially a window into more serious health issues — can you tell us more about that?

We’re beginning to understand that sleep is important in the regulation of pretty much all physiological processes that occur within our bodies. There is a growing field of research that is looking to see whether or not sleep disruption, sleep deprivation, or other conditions like sleep apnea may give rise to conditions like dementia. We know that poor sleep and sleep apnea are both associated with cognitive decline, and there is increasing evidence that they may actually be risk factors for dementia. Now, we’re not there yet, but this is quite an exciting area. Because if we can demonstrate that — for example — sleep apnea confers a high risk for dementia, that’s a potentially modifiable risk factor.

The reason why [sleep] might be particularly important to dementia is that we know that there are a series of channels within our brain called the glymphatic system, and the function of the glymphatic system is to remove toxins and metabolites from the brain. In deep sleep, those channels open up by about 60 percent. The [idea] is that if you sleep, the brain is more efficient in flushing out these toxins.

When we’re talking about those channels opening up by about 60 percent, that’s quite a large percentage, but what is the actual size of these channels that we’re talking about?

They’re microscopic. In fact, for many years, we didn’t even know that they existed — they’ve only really been discovered in the last decade or so.

Sounds like there’s quite a lot of research still to be done.

What’s so exciting about sleep medicine is that we have this thing that we do for eight hours a night, on average, so we spend a third of our lives sleeping. And yet, until the past few years, we’ve really had very little inkling as to what it’s all about. Things have moved dramatically forward over the last couple of decades. But there’s still so much to learn.