At 11 a.m. on the first Friday of the semester, Commons Dining Hall was filling up for lunch. Weary-eyed students trudged through the door. Some complained to their friends about shopping period. Others sat silently with their laptops and surfed Yale BlueBook. Most had big plates of food — salad, a lot of pizza, Yale’s creamy mac and cheese, vegetables soaked in oil, French fries.

Margaret Read, a research associate at Yale’s Rudd Center for Food Policy & Obesity, met me outside the dining hall. We walked in, set our winter jackets down, and headed to the servery. We hit desserts first. I’d be lying if I said I didn’t want to grab a chocolate-chip blondie (or maybe two). It had been a long week, and I was too tired to maintain my New Year’s resolution of healthy eating. Turns out there may be a scientific cause for my craving. A psychologist would say I was “ego-depleted.”

Recent research in psychology and behavioral economics points to ego depletion as a major factor in why people have trouble exercising self-control when it comes to food. We go to bed intent on eating healthily the next day. We wake up motivated to cook a simple breakfast and swap a burger for salad at lunch. But, after a stressful day of classes, at dinner we give in. Willpower is an exhaustible resource. And the more we dedicate to studying — the more we resist the urge to procrastinate, sleep in, or watch TV — the less we have left when we choose our food.

I asked Read to explain my late-morning craving for dessert. I was a college student drained by the first week of classes, she said. In a few weeks, I’d be a college student drained by midterms. “Whether or not you have a tendency towards stress eating is irrelevant,” Read said. As the semester gets busier, she continued, “You’re going to spend less time and mental energy on food.”

Experts who study decision-making claim that ego depletion has been supported by studies in the lab as well. Yale School of Management professor Ravi Dhar explained that even simple tasks can take a toll on willpower. In one study, subjects were asked to memorize either an eight-digit number or a three-digit number. The five extra digits made a difference: Subjects in the eight-digit group were more likely to choose indulgent food over healthy food because they had exerted more of a strain on their working memory. “When you pass around a plate of cookies early in the day, people can resist, but if you pass the plate around at 5 p.m. after school and work, everyone grabs one,” Dhar said.

Near the desserts in Commons is the pizza station. Read pointed out that pizza is appealing because it’s already a full meal in itself: there’s nothing that needs to be spread, tossed, or put together. “When you’re in a time crunch, you’re not going to scan the whole area,” Read said. “You’re also not going to spend time making a sandwich or creating an interesting salad.”

As we continued through the servery, Read noticed several aspects of the dining hall’s set-up that could help nudge students in a healthier direction. At the salad bar, she pointed out that the numerous fixings  —  the greens, the carrots, the cucumbers, the tofu — were easily reachable from both sides. A second salad bar was just ahead, past two buckets of bananas. Multiple stations give people multiple chances to eat healthily, Read said, as does putting healthy food in convenient places.

At the deli station at the end of the servery, Read was impressed by the signs showing ingredient lists and nutrition facts. Also displayed on a plate was the sandwich of the day: chickpeas, spinach, and tomatoes on a whole-wheat pita. It wasn’t your average college lunch staple, but Read appreciated that the dining hall was trying to offer new combinations. “You might not think of chickpea and spinach together, and adding that variety is important to a healthy diet,” she said. Displayed meals also save students the time of having to think up a creative combination themselves.

Overall, Read said, there are a number of things that the dining hall is doing well to nudge people in healthier directions. The bottom line, she added, is that unhealthy food options are always going to be there, and stress is always going to be a part of life. We’re always going to find frosted cupcakes appetizing, and there will never be a time when we can reserve all of our willpower for healthy eating. To a certain extent, we’re always ego-depleted.

The dining hall was much busier when we left. Whether we’re at the beginning, middle, or end of the semester, Commons is always going to be full of sleep-deprived, ego-depleted students who don’t think twice about that second blondie. Instead of giving in, Read suggests that we tune into our bodies before entering a dining hall. She advises us to ask, “What am I craving?” Walk a different path so that you bypass the desserts completely. And keep in mind that even though healthy eating might not seem like a priority during midterm week, it might just be your depleted ego talking.