Pineal gland: the last part of the brain AI models don't replicate?
The pineal gland is the brain's clock and, to some, the seat of the soul. How it works and what AI borrowed from it: from neural networks that "sleep" to MRI scans.
This article in other languages:العربيةDeutschEspañolFrançaisItaliano日本語Polski简体中文
In this article
The pineal gland is a small gland in the middle of the brain that releases melatonin every night, telling the whole body that it’s night and time to sleep. AI models don’t replicate the pineal gland or an internal clock yet, but two of its functions do have AI counterparts: keeping time, and “sleep”, which in a 2022 Nature Communications study helped neural networks stop forgetting.
What’s inside the pineal gland?
According to the Endotext chapter by Josephine Arendt and Anna Aulinas, the human pineal gland weighs just 100–150 mg. It sits on the brain’s midline, attached by a short stalk to the roof of the third ventricle, and, interestingly, it lies outside the blood–brain barrier. Inside you’ll find, among other things:
- Pinealocytes, about 95% of the cells. These are the ones that produce melatonin.
- Glial cells (astrocytes and phagocytes), scattered between the pinealocytes.
- Calcium deposits, which show up in most people with age. They make the pineal gland a handy landmark on brain images.
Pinealocytes make melatonin from tryptophan, by way of serotonin. The key enzyme is AA-NAT (arylalkylamine N-acetyltransferase), whose activity rises at night and drops quickly once the lights come on.
How does the pineal gland know it’s night?
It can’t see light itself, at least not in mammals. The signal takes a detour (as Arendt and Aulinas describe):
- Some retinal ganglion cells contain melanopsin and respond to light independently of vision.
- The signal reaches the suprachiasmatic nucleus (SCN) in the hypothalamus, the master biological clock of mammals.
- In the light, the SCN blocks the signal from going further. In the dark, it lets it through, via the paraventricular nucleus of the hypothalamus, the spinal cord and the superior cervical ganglion.
- At the end, nerve endings release noradrenaline, which switches on melatonin production.
The most interesting part is that the SCN keeps time even in total darkness. The rhythm then strays from the standard 24 hours and “drifts”, and daylight corrects it every day. On top of that, the longer the night, the longer melatonin is released, which lets seasonal animals read the time of year from it.
There’s also a number for anyone who scrolls in bed: fully suppressing melatonin at night takes about 2,500 lux or blue light (460–480 nm), but less than 200 lux can already lower it and shift the rhythm. Ordinary home lighting is 100–500 lux ;)
Is the pineal gland a “third eye”?
In some animals, almost literally. In cold-blooded vertebrates the pineal gland is light-sensitive, and many lizards and the tuatara have a so-called “parietal eye”, which develops from the pineal complex and has a simplified retina. In a 2025 paper in Genome Biology and Evolution, researchers went through more than 60 lizard and tuatara genomes and found a new opsin, lepidopsin, that other vertebrates don’t have.
In mammals this light sensitivity is gone, and the pineal gland only learns about light through the eyes.
Why did Descartes put the soul in it?
Because he was looking for the place where everything comes together. As the “Descartes and the Pineal Gland” entry in the Stanford Encyclopedia of Philosophy describes, Descartes considered the pineal gland “the principal seat of the soul” because, in his view, it was the only part of the brain that isn’t doubled. If we see one thing with two eyes and think one thought at a time, the images from both sides have to merge somewhere.
Some of his anatomical assumptions were wrong (the pineal gland doesn’t hang freely in the brain’s ventricles), but the question of a single place where consciousness “lives” comes back in every debate about whether AI experiences anything.
Could AI replicate the pineal gland’s functions?
- The biological clock. As of today, a language model has no equivalent of the SCN. It doesn’t keep time between messages and only knows what day it is if someone puts the date in its context. Its “knowledge of the world” stops at its training data cutoff, a bit like a rhythm that no daylight ever corrects.
- Melatonin as a global signal. Melatonin doesn’t go to a single neuron; it circulates in the blood and changes the state of many organs at once. The closest thing in AI is settings that change the behavior of the whole model at once, such as the system prompt, but there’s plenty of room to take this mechanism further. That could bring interesting results for steering models and for AI safety.
- Bedtime. The pineal gland doesn’t sleep for us, but it helps set when we sleep, and sleep has turned out to be useful for neural networks too. LLMs that keep learning while they “sleep” are still a thing of the future, but who knows, maybe that’s the last missing link to a fully “conscious” AI?
Do neural networks need sleep?
According to Maxim Bazhenov’s team at the University of California, San Diego, yes. In the paper “Sleep-like unsupervised replay reduces catastrophic forgetting in artificial neural networks” (Tadros, Krishnan, Ramyaa, Bazhenov, Nature Communications 2022), the researchers added a “sleep” phase to training: the network was fed noisy input and learned without supervision, using a simple Hebbian rule.
The problem they were tackling is so-called “catastrophic forgetting”: a network trained on a new task overwrites what it knew before. After the “sleep” phase, the network recovered previously forgotten tasks, because old patterns replayed on their own, much like in the brain during sleep.
The link to the pineal gland is indirect: melatonin sets the time for sleep, while the study is about what sleep does to memory, but it’s probably the most concrete paper in which the biology of the night made its way into AI.
How does AI help study the pineal gland?
The other direction is simpler. FreeSurfer, a popular brain imaging analysis package from Massachusetts General Hospital, has shipped the mri_pglands_seg tool since version 8.1. It’s a U-Net neural network that automatically outlines the pineal gland and three parts of the pituitary gland on a (T1) MRI scan. Larson, Fischl, Greve and colleagues described it in “Human Brain Mapping”.
The pineal gland is small, so tracing it by hand on hundreds of scans is tedious. Automatic segmentation makes it possible to measure it in large studies.
FAQ
What does the pineal gland do?
It releases melatonin at night, in the dark. That’s how it tells the body what time of day it is and, in seasonal animals, what time of year. Its rhythm is set by the suprachiasmatic nucleus in the hypothalamus.
Is the pineal gland the third eye?
Not in mammals, because it doesn’t respond to light directly. In many lizards and the tuatara, the pineal complex gives rise to a so-called “parietal eye” with its own photoreceptors.
Does AI have a biological clock?
No. A language model doesn’t keep time on its own and only knows the date when it’s given in the context. Researchers have, however, tested a “sleep” phase in network training that helps networks hold on to tasks they learned earlier.