Cracking the Code of the Anxious Mind

Paul Sharp treats the brain like a computer to understand why we get stuck in doom loops — and how we can reprogram our mental software

Photographs by Marcelle Deichev
February 23, 2026 By Zac Unger
View PDF version

Two people check the weather report on the eve of their big job interviews and notice that tomorrow is likely to be cold and overcast. The first person makes a mental note to pack an umbrella and drifts off to sleep. The second leans an umbrella against the front door so he won’t forget it, then reconsiders and opts for a raincoat instead so he won’t have to juggle a dripping umbrella when he shakes hands with the interviewer. An hour later, he lies in bed, changing plans, deciding to call a taxi so he won’t have to walk to the subway. But what if he can’t find a taxi on time? What if there’s heavy traffic? Should he go back to the first plan and take the subway and an umbrella? Soon enough, an entire night’s sleep has been lost, and our poor interviewee is worse off than if he had never thought about the next day at all.

Welcome to the world of the worried, where every plan comes with a risk of obsessing over small problems that snowball into bigger ones, luring the sufferer into dead ends of anxiety. If this sounds familiar, then Paul Sharp has been thinking of you. Sharp, a cognitive scientist and senior lecturer at Bar-Ilan University, studies the mechanics of human thought, particularly how we plan, and how, when planning goes awry, it curdles into anxiety.

Share this article

His field, computational psychiatry, is probably not one you’ve heard of. It is built on an intuitive insight that the brain is a machine and that our thoughts and actions can, in part, be thought of as lines of code. “We take the metaphor of the brain as a computer,” says Sharp, an Azrieli Early Career Faculty Fellow. And while human beings are not machines, “there’s a theme in common between the two, which is information and how it’s transformed.”

In Sharp’s view, anxiety is not a random glitch. Instead, it is a side effect of a key strength, our ability to imagine the future. Anxiety, therefore, can be thought of as planning run amok. “If worry is a form of planning,” Sharp says, we can evaluate how those plans are sometimes incorrectly biased toward negative outcomes, and then “we can move from the mysterious world of emotions and into the world of rationality and machines. And we can fix machines, even if they’re really complex.”

The field of computational psychiatry is only around 10 years old. It combines advances in artificial intelligence, computer science, cognitive neuroscience and psychiatry to understand the hidden causes that lead to mental disorders. Like meteorologists who use computer models to predict weather patterns, computational psychiatrists create computer models to understand patterns in mental health.

At the heart of the field is the idea that mental processes, like planning or decision making, are essentially computations. As Sharp explains, “the brain receives the information from our different senses and then processes it so we can recognize objects and evaluate decisions.” Think of those processes as mathematical patterns.

Scientists like Sharp develop a mathematical model of information processing involved in a mental disorder, collect data from patients using behavioural and neuroimaging tools, and then use statistical and machine learning methods to test and refine the model. Where traditional psychiatry relies on observing symptoms and behaviours, computational psychiatry goes deeper by trying to understand how “software” problems in the brain cause problematic symptoms.

Sharp’s journey into this field was anything but linear and well-planned. After flirting with finance, he switched to medicine but soured on his biology courses, and then was dissuaded from pursuing law school by an uncle who hated being a lawyer. Sharp took a psychology course and fell in love with research. “My curiosity was lit,” he recalls. “It ignited and I just ran with it.”

“At the heart of computational psychiatry is the idea that the brain is a machine and that thoughts and actions can, in part, be thought of as lines of code. “The brain receives information from our senses and then processes it so we can recognize objects and evaluate decisions.””

Sharp received a master’s in clinical psychology from the University of Illinois and worked for a time at an autism diagnosis clinic. Although he ultimately chose to focus on research instead of clinical work, the grounding in the lived experience of patients and their families still provides the moral underpinning of his work. “I thought if I could help understand these forms of mental suffering and how we can help people out, that’s my thing.”

In the end, Sharp’s skill in math, modelling and statistics led him to focus his PhD work at the University of North Carolina at Chapel Hill on modelling neural patterns involved in anxiety. Whether it was direct clinical work or the academic neuroscience studies, Sharp has never lost sight of the goal of providing relief for people undergoing disruptive mental disorders.

But how does one actually study the code for anxiety? Our brains might act in computer-like ways, but they can’t be opened up with a screwdriver or reprogrammed over the internet. To test his theories, Sharp designed an experiment for more than 200 subjects, who were first asked to self-report about their mood and tendency to worry. In a computer game, the volunteers were instructed to move through a simulated world, collecting rewards and avoiding dangers. Some individuals simply disregarded the goals they were told to plan for, and a second group ignored the dangers and got stuck on chasing rewards. Members of a third group — the worriers — were obsessed with making plans to avoid danger.

What Sharp found was that those in this third group missed out on many of the rewards that were offered. Which makes sense in the context of real life, when we think about people who skip social events because they’re worried about awkward human interactions, or people who arrive at the airport so early that they ruin their entire day. People with such tendencies, Sharp says, “imagine new totally irrelevant threats when they start planning. In doing so, this creates an entirely new motivation to initiate the plan again, which creates a vicious cycle of planning for many, many threats over and over again, which is exhausting and we know is a symptom of worry.”

As a result of these and other experiments, Sharp developed a conceptual model called the planning-anxiety framework, which features two key elements: task construal and meta-control. In making plans, even small ones, our brains decide which parts of the task are important and which can be disregarded. The job seeker from earlier agonizes over bringing an umbrella, but prior experience tells him that his choice of socks won’t matter, so he doesn’t waste mental energy on that decision. But as a result of the uncertainty of next day’s weather, the applicant is derailed by agonizing over too many decision-making tasks, from his rain gear to the traffic to how his potential boss will evaluate his wet handshake. Planning for all these potential outcomes imposes burdens on the anxious planner.

Breaking that cycle requires what Sharp calls meta-control. That is the ability to accurately perform a cost-benefit analysis and terminate the planning process at the “good enough” stage. According to Sharp, preliminary work has found that chronic worry is associated with difficulty terminating “threat-aversion planning.” Essentially, the fear of bad outcomes outweighs the ability to successfully imagine good ones. “Individuals may differ in what level of uncertainty they can tolerate as planning unfolds,” Sharp has written. “A chronic worrier may persist in planning even when their plan has a high chance of averting threat.”

Sharp is in the early stages of moving his work from experimental games with subjects to direct observation, monitoring which parts of subjects’ brains light up as they make decisions. Even subconsciously, making silent plans still involves language. Using non-invasive neuroimaging techniques — basically an enormous helmet that can measure activity on the cortex, the outer “bark” of the brain — scientists build maps of our decision making using the words chosen to conceive the plan. “Once we have this map, we can then try to spontaneously decode the thoughts that people are thinking when they’re in a brain scan,” Sharp says. “Our hope is to use these models to explain when and why we observe repetitive thought dynamics.”

All of this scientific investigation is fascinating, but what does it do for those of us lying awake ruminating on the thousand different ways we might be late for work? “The real thing is the emotional experience,” Sharp says. “The felt experience, the lived experience.” By “emotional experience,” Sharp means that future work needs to make more precise how changing patterns of thought predict the “in the moment” dynamics of what anxious people feel.

Sharp has found that breaking the cycle of chronic worrying and over-planning requires the ability to accurately perform a cost-benefit analysis and terminate the planning process at the “good enough” stage.

Currently, this research is still in its infancy; a base understanding of how the brain processes information to make decisions is still being built. In the future, Sharp hopes, the promise of advanced neuroimaging and modelling could help clinicians improve their diagnoses and therapeutic techniques, assisting patients to better understand the hidden reasons why they are feeling the way they are, and giving them better tools to break destructive cycles.

“The buzzword right now is precision medicine,” Sharp says, describing the ability to tailor a therapy to an individual based on their maladaptive lines of code. “But right now, we’re still in a pure science situation. We’re still at the base level of understanding how the code works.” One day, Sharp’s line of inquiry might lead to new cognitive behavioural techniques that can help people pinpoint disruptive patterns of thought they did not realize they were engaged in. “That’s the hope — to help people better use their expensive mental resources so they can stop worrying,” he says.

Sharp’s work is inherently interdisciplinary, and he credits the Azrieli Fellows Program for bringing him into contact with brilliant investigators across varied fields of study. “I’m sitting at a dinner table with someone working on large language models, and some of the concepts he was working on I didn’t even realize were actually close to the models that I work with,” he says.

Sharp’s mentor, Wendy Heller at the University of Illinois, is not surprised that he’s thriving in this environment. “Paul combines pioneering scholarship with a high degree of collegiality and a joy for scientific interaction that is extended to colleagues across disciplines and across continents,” she says. “He is one of the most collaborative scholars I have ever met, and one of the most delightful to talk with, and he creates intellectual coalitions everywhere he goes.”

Sharp’s enthusiasm and curiosity for understanding what makes our brains work has not dimmed since he first started considering these questions as an undergraduate. He is excited by the promise of figuring out how human intelligence works and helping people when their innate intelligence and creativity lead them to dark places. This research “gives us a chance to look into each other’s universes and ask the question of why we process the world the way we do,” says Sharp. “To me, this is the origin of our humanity.”

Subscribe to our newsletter

* indicates required

All fields are mandatory.