Debugging Cognition As Though It's Software
If you’ve ever debugged a piece of software, you already know how to debug cognition and “metaprogram”. Let me explain. (If you just want the actionable stuff, go all the way to the bottom).
Tracebacks
Programmers are familiar with screens similar to the picture above. Usually, when a program fails, a stack trace is generated that allows the programmer to follow the error back to its source through the files involved in the failure. There’s also an error message to give an indication as to what went wrong. To debug the software, the programmer follows the trace back to the origin of the error and then corrects the line(s) of code causing the error. So how does this relate to cognition? Let’s start with an example. I’ll make it personal.
When I got back home to Seattle from Rhode Island when the coronavirus pandemic was just beginning, I experienced massive amounts of anxiety at the prospect of having caught the coronavirus during my trip. I took precautions that included staying away from people and taking a row to myself on the flight, but I screwed up at one point and accidentally put my hand in my mouth after touching a potentially unclean surface. Realistically the chance of contracting coronavirus after my goof couldn’t have been more than 1%, but my anxiety would’ve made you think that I’d french kissed somebody on their deathbed during the trip. I had panic attacks and insisted that I hole myself up in my room. I wore a mask in my house and sequestered myself off in my room, contemplating death from a virus that I probably never caught.
I tried to reassure myself that I’d be fine. I rationalized to myself that it’s unlikely I caught the virus on my way over and that 21-year-olds rarely die from this disease. But the panic attacks continued, and it became clear that I couldn’t rationalize away whatever mental software I was operating on. Thus I did a “traceback”, following the chain of cognitions associated with the panic attacks and horrible tightness in my chest. Here’s what I’ve got recorded in my journal from that day, italics are my emotions and plain text is my rational (S)elf:
I have coronavirus
Why do you think you have coronavirus?
Because I fucked up on the flight over, and that means I’m at risk of getting it
So there’s the possibility you have the virus. But the probability of it being a problem is low. Why are you panicking so much?
Because I’ll probably die
Why do you think you’ll die?
Because bad medical shit happens to me
What makes you think that?
Because I had that medical episode happen a few years ago
And what does that mean to you?
Any moment, some small medical issue can spiral out of control
For context, I went through a series of surgeries two years ago for a hernia and to close a hole in my heart. The whole experience was traumatic as well as long and drawn out. I went to the hospital several times due to the hernia and then the doctors found the hole in my heart out of absolute sheer luck. I’ll probably write about it in the future.
In any case, I figured out what core beliefs caused the chain of dysfunctional cognition that led to one of the panic attacks. This isn’t where we stop though. Usually debugging software gives us an error message that tells us what went wrong, but there’s no error message here. So how do we use the information we just gathered?
So There’s No Error Message
Let’s back up for a bit.
I operate under the framework that we have four primary emotional needs that our psyche always attempts to meet. These are:
Connection - the need to feel seen and understood by others, the need to love and feel loved
Self-esteem - the need to know that one is doing something meaningful with their time and has a valuable existence
Safety - the need to know that one is safe from harm, both physically and psychologically, and can ensure their own safety
Spirituality - the need to feel that there is something greater than oneself that one is part of, or the need to ward off nihilism
Evolution prioritizes our survival, not our thrival. Thus we will adopt any set of beliefs we can to make sure we get each of these four needs met. However, many of these beliefs may be dysfunctional and cause ourselves and the people around us misery. The amount of misery one causes themselves correlates with the misery they cause the people close to them, and vice versa. With this in mind, of course there’s no error message - we’ve learned how to live with the dysfunction. The ground level belief is one where if we continue asking it questions, it gives non-answers. Continuing the example of my pseudo health scare, if I kept asking my emotional self questions, this is what would have happened:
Why do you think any moment some medical issue would spiral out of control?
Because that’s what happened in the hospital
But why does that one incident mean that the medical issue would spiral?
Because it’s just what’s going to happen
During my medical crisis, I’d internalized the very emotionally charged belief that my health is fragile and can spiral out of control at any moment. Because I never dealt with the emotions effectively at the moment (I spent a large portion of those months depressed and feeling that my life is over) or afterward, that initial belief and emotional wound of “bad medical things happen to me” reacted to the fear of SARS-CoV2 exposure and sent me down a negative spiral. These sorts of negative root beliefs attach themselves to one’s psyche during emotionally charged situations and resurface if left untreated. We then build layers of other beliefs on top of this unhealthy axiom by which dysfunctional behavior arises. My root belief that bad medical situations happen to me was a belief that I internalized and then adopted dysfunctional behavior as a means of meeting my psychological need for safety.
Here are more examples to demonstrate how toxic root beliefs manifest in dysfunctional compensatory behaviors:
A person internalizes the script “I am meant to be abandoned” throughout childhood. This manifests into deep fears of abandonment in relationships and difficulty in being vulnerable. (I dealt with this issue for the longest of times and have mostly overcome it, but it is quite painful and leads to much dysfunction). The behavior is a compensation to meet safety needs primarily and then allows one to dissociate from connection needs.
A person internalizes the script “I need to work at a big tech company otherwise I’m a failure” while studying computer science at an Ivy League school and seeing people around them chasing these internships. This manifests in pressuring themselves into studying for coding interviews and chasing internships even though they may have no interest in working at a tech company. The behavior is compensation to meet self-esteem needs.
A person internalizes the script “I’m stupid and can’t do math” after failing a math exam. This manifests in avoiding math classes and anything mathematical. The behavior is a compensation to meet self-esteem needs since it keeps one from re-experiencing possible failure.
When I do this metacognition exercise, I classify the root belief into a means of meeting one of the four psychological beliefs I detailed above. This informs how I replace that belief.
What’s the Right Line of Code?
I can’t tell you the right internal script to replace the pathological one since that’s a choice you need to make for yourself. I’ll tell you about the scripts I use though and make an argument for why I believe they’re correct.
The basis for how I reframe my internal scripts comes from the idea that I can meet all of my psychological needs internally. This comes from my observation that if I need something in the material world to fulfill one of the psychological needs, I won’t actually feel any happiness or satisfaction when I do get that thing. It’s also possible that getting the thing I need makes my life worse in some way. When I attach to something in the material world, I make myself liable to getting hurt due to things that are impermanent. I also set myself up for disappointment and despair since these needs often stem from a fantasizing of the object of desire, where the fantasy rarely ever matches with reality. An example of this sort of fantasizing is feeling a need to become rich since money fulfills a need for self-esteem and generally comes with a fantasy of a very specific lifestyle. With this principle in mind, we can derive an approach to creating healthier underlying scripts:
Connection - I don’t need any specific person to connect with. There are people out there who I can be seen or understood by without needing to be anything other than my authentic self. Becoming neurotic about needing a specific person’s connection or not being able to be vulnerable actually makes it harder to meet this need.
Self-esteem - I don’t need any specific thing or recognition to create my sense of self-worth. As long as I think critically about how I can best use my time and then show up and try my best to do what I’ve decided is meaningful, I can meet my need for self-esteem. Becoming neurotic about getting something done actually makes it more difficult for me to get something meaningful done.
Safety - I don’t need anybody else to take care of me. I’m an adult and can take the necessary steps to make sure that I’ll be safe. Becoming neurotic about feeling like I’m in danger makes me panic and makes it more difficult to actually make sure that I’m safe.
Spirituality - (I’m not going to include my thoughts on this since it’s a very personal thing)
I’ve come to these internal scripts as the “ideal ones” after reading several books on psychology and philosophy. In particular, I take influence from Buddhist and Yogic philosophy as well as the philosophy from the Divine Comedy. If you want to figure out some scripts that work well for you, I’d recommend finding your own books and figuring out what you consider to be Truth.
How Did Things Get To This Point?
We create our beliefs based on interpretations of reality. The actual words we use never fully encapsulate an experience but compress an experience into a finite set of symbols through which we may operate. The reason we’ve gotten to the point of having dysfunctional belief/behavior patterns is that we picked the wrong words to explain past experiences and we need to go back and reinterpret these memories.
Continuing with this idea of symbols and words not capturing the totality of experience, we can use the concept of reality and Reality. Small r “r”eality is the existence our cognition works with. Signals initially come in and then we produce words to describe these signals. The signals themselves come from big r “R”eality though, which contains far too much information for words to describe. We want to reduce the amount of distortion between the reality we exist in and Reality so that we may be more grounded and reduce suffering. The big issue here is that there is no universal agreement as to what constitutes Reality since we cannot use words to communicate with each other about something that fundamentally escapes language and symbols. Thus, we settle for iteratively improving the reality that we exist in and trust that with enough effort and focus we move very close to Reality. So why is reality so painful for many of us?
I believe this has two primary reasons. The first is the development of the psyche from infancy to adulthood, the second is a lack of study of virtue and morality.
From infancy to early childhood, we exist in a sort of solipsism where we believe we are the center of the universe. We believe that we are the subject and the rest of reality is the object, thus anything that happens becomes due to our own actions. While this stage is necessary for a child’s development, instances of trauma and abandonment are processed incorrectly and result in the child feeling that the painful incident happened because something is wrong with them. The child internalizes scripts of the form “because I am ______, [bad thing] happens to me”. Scripts of this form constitute toxic shame and lead to a stunted ability to form connections and generate self-esteem. These sorts of scripts can develop after early childhood as well, but from my limited understanding of childhood development theory, it seems that most come during early life.
As we continue with childhood, we are subject to a variety of other scripts. Narcissism develops when a child repeatedly learns the script “I am only worthwhile if I (do [insert achievement])/(act like [insert constructed identity])”. When a child becomes an adolescent, it moves its center of the universe away from its parents to its peers and begins to internalize many of its scripts based off of interactions with peers, though this isn’t to say that the parents no longer influence internal scripts. Some of the scripts that I internalized during my teenage years were that “people don’t want to be my friend” and “I need to pretend to be stupider than I actually am for people to want to be around me” due to the loneliness I faced in school.
While I posit a pattern for how internal scripts develop, I believe that if a person repeatedly is told a statement in highly emotional situations, that statement then becomes integrated into the person’s reality. This is why it’s important to raise children in a healthy environment with parents who can foster the child’s individual development, as well as addressing issues related to our schools and institutions that do psychological harm to children and adolescents. I believe that our current public education systems are a horribly toxic place for individuals to develop, though this is a topic to address separately.
In much of philosophy, there is a delineation between the Self and self. The Self is the fundamental awareness that exists within the human body, the consciousness that experiences and is connected to something greater than the individual body it exists in. The self is what many Buddhists define as the ego. With this framework, I like to think of all of these scripts that constitute reality as things the self says, thus the goal is to reduce the self and become one with the Self so that I may exist in Reality. I treat these dysfunctional script/behavioral patterns as “ego fragments”, so that during meditation I may be able to dissolve individual fragments and reduce my attachment to reality so that I may live more in line with Reality.
Did You Make This Shit Up?
Partially yes, partially no. Let’s recap first. The method I’m proposing we use is:
Notice: Observe that you have become dysregulated emotionally. Is the dysregulation attempting to make you involuntarily act or not act?
Asking you to act: sympathetic nervous system hyperactivity. This could be considered anxiety of a form
Asking you to not act: parasympathetic nervous system hyperactivity. This could be considered a form of depression
Feel: Where in your body is this dysregulation manifesting somatically? To do this, move your awareness around your head and torso and try to see where there are significant sensations, often they will be uncomfortable. Hold your awareness there. Often, the sensation will manifest in one or more of the following places:
Sternum & throat
Chest
Diaphragm
Stomach
Face
Identify: Having noticed and classified the dysregulation, and with your awareness on the somatic sensation, attempt to identify what it is asking/not asking you to do.
Explain: Ask the sensation what doing the action/not doing the action would accomplish. It will be attempting to meet or mourn a psychological need through some external mean. Completion of this step would allow one to say "I am feeling (anxiety/depression) because I am attempting to fulfill my need of (connection/self esteem/safety) by (doing/not doing) (action/lack of action the sensation)
Anthropomorphize: With the theory of trauma as fragmented selves in mind, anthropomorphize the combination of the somatic sensation and the cognition into a fragmented version of your self
Understand: Ask the fragmented self where it originated from and what event from the past manifested it. This is done under the understanding that trauma is a memory that has not been effectively processed, which leads to its being fragmented, and with an understanding that the trauma manifests in dysfunctional behavioral patterns that allow us to meet the emotional need.
Accept: Accept that this trauma exists and there is this fundamental emotional need that hasn't been met. Accept the behavioral pattern that the fragmented self is asking you to engage in. If acceptance requires grieving the original wound, this is a good time to do so. Feeling the stored emotional pain and coming to terms with it is necessary to move on.
Respond: Thank the fragmented self for its service in attempting to meet the fundamental emotional need. Explain to it that your grounded adult Self is able to meet all emotional needs internally and that nothing in the external world will be sufficient for meeting these needs. Visualizing embracing the fragmented self from the point of view of your Self can make the process more effective. Promise the fragmented self that your Self will take the steps necessary to meet the emotional need.
Persist: Keep your attention on the somatic sensation more and continue feeling any emotions that come up. Ideally you will feel that the sensation "dissolves" in a way. If this happens and no other emotions are there, you should feel a sense of deep peace. It is possible that there are other emotions tied up into the one you just processed and need to repeat these steps for the new emotion. It may also be that the existing emotion was not fully processed, in which case more investigation into the root causes may be necessary.
I created this method of processing through a mix of going through different forms of psychotherapy, reading about psychology and philosophy, and massive amounts of trial and error. The method is subject to change and I don’t want to treat this as though it’s the only way to heal traumas and dysfunctional beliefs. I’m sure that things will change as I continue reading and experimenting. The parts about dysregulation and somatic sensations deserve their own explanation, as this post only really covers steps 3 through 8.
Give it a try if you’re interested though. It’s been instrumental in helping me overcome a lot of anxious and depressive feelings and I’ve seen a definite improvement both in my disposition and in my ability to function in life. When combined with regular meditation, it’s helped me change from an incredibly neurotic and constantly anxious person who is detached from reality to somebody who can enjoy the present moment and is better able to connect with others and do meaningful work. My mind is less of a muddy river, polluted by poisonous thoughts and worries, and more of a clear stream.