Going without sleep might give you the munchies in pretty much the same way that weed can, researchers believe.

Previous research has linked poor sleep health with unhealthy patterns of eating, but researchers are still working to understand the biological mechanism behind this link. A new study recently published by eLife reports that sleep deprivation can boost certain compounds within the body’s endocannabinoid system (ECS), which can lead to increased cravings for fatty, high-energy snacks. Sound familiar?

The ECS, which is found in all mammals, plays a major role in regulating biological processes, including sleep, hunger, and temperature regulation. This system involves endocannabinoids, naturally-produced compounds that bear some resemblance to phytocannabinoids found in weed, in addition to cannabinoid receptors. These receptors respond to the brain’s own endocannabinoids as well as phytocannabinoids like CBD and THC.

In the study, 25 participants were asked to get seven to nine hours of quality sleep for one week. The next week, half of the subjects were randomly assigned to only sleep for four hours a night, while the other half kept a regular sleep schedule. Researchers then allowed the subjects to feast on a buffet-style assortment of food, and kept track of exactly what food choices the subjects made.

The study reports that the sleep-deprived group chose fattier, more high-energy foods than the well-rested cohort. Sleep deprivation did not seem to increase subjects’ overall hunger level, but only their specific choice of foods. “Importantly, effects of sleep deprivation on dietary behavior persisted into the next day (after a night of unrestricted recovery sleep), with a higher percentage of calories consumed,” the researchers wrote.

Gallery — Wait, Aren’t These Real Food Products?

The research team also exposed subjects to a variety of food scents and non-food scents and used fMRI scans to examine their brain activity during the trial. Researchers found that the sleep-deprived subjects reacted much more strongly to the food odors than the well-rested subjects. Subjects’ blood levels were also tested, and researchers discovered that the sleep-deprived subjects had higher levels of 2-oleoylglycerol, a molecule that is part of the endocannabinoid system.

“Taken together, our findings show that sleep-dependent changes in food choices are associated with changes in an olfactory pathway that is related to the ECS,” the study concludes. “This pathway is likely not restricted to sleep-dependent changes in food intake but may also account for dietary decisions more generally. In this regard, our current findings may help to guide the identification of novel targets for treatments of obesity.”

Last year, researchers discovered that exposure to cannabis vapor made receptors in the hypothalamus – a part of the brain containing many cannabinoid receptors – more sensitive to hunger hormones. Neither of these studies is entirely conclusive on its own, but the results will eventually help scientists more fully understand the interaction between hunger, cannabis, and the endocannabinoid system.