Reprogramming the OCD Algorithm: How Our Brain’s Feed Can Be Retrained

Reprogramming the OCD Algorithm: How Our Brain’s Feed Can Be Retrained

Platforms like TikTok and Instagram engage billions of users across the globe, each of whom is eager to curate a feed of content worthy of their attention. Your feed could be filled with funny cat videos, the latest news, viral dances, or, if you are like me, Ronaldinho highlights, the “Stews from Around the World” recipe series, and occasional updates from the Kendrick Lamar vs Drake beef. Early on, this was an enjoyable experience and provided a welcome refuge from a busy workday or a boring train ride. Unfortunately, these platforms use hyper-personalized algorithms to manipulate our attention and maximize our time on them for financial gain. In Johann Hari’s book Stolen Focus, he describes that, “platforms don’t just predict what we like — they create a dependency where we crave more of what holds our attention, regardless of whether it aligns with our values or goals.” If you experience OCD, this process might sound familiar.

Pretend your consciousness is like an Instagram feed, an infinite scroll of psychoemotional thoughts, images, and feelings. Some of which are positive, others neutral, and some distressing. You can engage with this feed similar to how you engage with Instagram: choosing to “like” a post, share it, click “not interested”, or spend time clicking deeper into a particular profile. In the same way, our brains respond to the attention we give to thoughts, reinforcing patterns based on what we engage with most. 

The Algorithm of the Mind: The Biopsychosocial Mechanisms of OCD

OCD is a neurobiological disorder with cognitive-behavioral implications. The brain regions impacted by OCD (primarily the cortico-striato-thalamo-cortical loop) are instrumental in habit formation and error detection. In individuals with OCD, hyperactivity in this circuit results in excessive doubt, an increased sense of personal responsibility, and difficulty filtering out intrusive thoughts. 

This circuitry leads to a person assigning undue significance to certain thoughts, similar to how Instagram will push new content based on past engagement. If a user repeatedly interacts with a particular area of content, the algorithm will offer more of the same. Likewise, in OCD, engaging with obsessions through compulsive responses increases their strength and frequency over time.

OCD is driven by maladaptive reinforcement learning. Engaging in compulsions provides temporary relief from distress, negatively reinforcing the behavior into a vicious cycle. This is akin to repeatedly clicking on a particular type of content and finding it dominates your feed, even if you no longer want to see it.

Sociologically, OCD symptoms can be influenced by cultural expectations, personal identity, and the social reinforcement of compulsions. A person living in a rigid, high-expectation environment may develop perfectionistic compulsions, while another raised with strict religious rules may develop scrupulosity-related OCD. These environmental factors help "train" the brain’s algorithm, shaping which thoughts gain prominence.

Training the Algorithm: Using ERP and ACT to Shift Mental Content

So, how can we train our brain’s algorithm with the same finesse as our Instagram algorithm? How can we create a stream of consciousness with less obsession and intrusivity and more things we actually value? The answer lies in Exposure and Response Prevention and Acceptance and Commitment Therapy.

ERP is the gold-standard treatment for OCD, and it helps teach the algorithm what not to prioritize. ERP therapy works by deliberately exposing individuals to anxiety-producing stimuli while preventing the compulsive response. This disrupts the reinforcement cycle that demands intrusive thoughts require a response.

Using the Instagram analogy, ERP is like refusing to engage with unwanted content. Imagine that you’re sipping your morning coffee and scrolling through your feed when an advertisement for your least-favorite mass corporation appears. You deliberately choose to scroll past without liking or commenting. You may even choose to click “not interested”. Over time, the algorithm registers that this content is no longer relevant to you, and it decreases in frequency. The same principle applies to the brain: by resisting compulsions, you teach the mind that intrusive thoughts do not warrant attention, gradually reducing their power. In practice, this is much more difficult. OCD has a bag of tricks and will attach itself to things you think are important and urgent. It’s vital to use relabeling skills, call them out by name, and then respond accordingly. Thought-blocking will not work. 

Acceptance and Commitment Therapy: Engaging With Valued Content

While ERP helps stop reinforcing intrusive thoughts, ACT helps introduce new, meaningful content to your feed. Instead of avoiding distressing thoughts, ACT encourages individuals to acknowledge them without judgment and pivot towards actions aligned with their values.

In our analogy, ACT is like choosing to follow accounts that inspire and fulfill you. This might not prevent stray content (think of pop-up ads) from appearing, but you can intentionally engage with life-affirming activities—whether that’s spending time with family, working on a creative project, or immersing yourself in nature. Over time, the brain registers this shift and starts offering "better content" in the mental feed.

The Long-Term Impact of Algorithm Training

Neuroscientific research supports this approach. Studies on neuroplasticity show that the brain adapts based on repeated behaviors and thoughts. Studies using fMRI scans have shown measurable reductions in CSTC circuit hyperactivity after ERP therapy (Figee et al., 2013), and behavioral interventions like ACT increase activity in brain regions associated with cognitive flexibility and emotional regulation.

Learning to disengage from intrusive thoughts through ERP and engage in valued activities through ACT rewires the reinforcement pathways that drive OCD. This approach allows individuals to reclaim their lives, reducing the isolation and avoidance that OCD often creates. 

Give it a try

I’ve found that using visualization strategies can help develop this skill. Close your eyes and imagine you’re holding your cell phone. You’re comfortably seated on your couch, and there is a slight breeze flowing through the cracked window. It’s finally spring. You’re scrolling through your feed with a smile on your face. One of your friends just had their first child. Another one finally decided to take that solo trip abroad. Your child just posted their graduation photos. You like, comment, and save to your favorites. All of a sudden, you’re bombarded with posts about harming others, doing something embarrassing, being in the wrong relationship, or whatever your particular flavor of OCD happens to be. Look at the post closely. Acknowledge its existence without judgment. How does it actually look on the screen? What’s the caption? Okay, now place your finger on the three dots, open the options, and click “not interested”. Scroll past it. What’s the next post? What’s important to you in this moment? What do you want to engage with now that aligns with your values? Repeat.

Putting it all together

We may not control the thoughts that appear in our mental feed, but we do control how we respond. By choosing not to compulsively engage with intrusive thoughts and by actively pursuing meaningful engagement, we can retrain the algorithms of our minds. Over time, this shift leads to a mental feed that is less cluttered with distressing content and more filled with the experiences and values that make life worth living.

By working with our brain’s algorithm instead of against it, we gain the ability to shape our mental landscape, fostering a healthier and more fulfilling state of mind.

- Ty Oreskovic, LPC Staff Therapist

References:

Figee, M., Luigjes, J., Smolders, R., Spinhoven, P., Scholten, H., & de Koning, P. (2013). Deep brain stimulation restores frontostriatal network activity in obsessive-compulsive disorder. Nature Neuroscience, 16(4), 386–387.

Hari, J. (2022). Stolen focus: Why you can't pay attention—and how to think deeply again. Crown. 

Help! The sky is falling!

Help! The sky is falling!