Combinatorial Explosion in Dream Interpretation

by Dr. Zamir Syed, PhD

The following is a delicious exposé of the deficiency in AI as it pertains to dream interpretation.

The recent craze and fascination with A.I. is creating a mindset of disengagement from human beings and indeed human interaction. At Darul Qasim, we see the learning and transferring of knowledge as a human convention and not of a mechanical one. The Prophetic model is rooted in the oral tradition and uses the written tradition wisely. This article shows the limitations of AI in understanding and computing a beautiful lived human science. That is the science and art of dream interpretation. It proves that human experience cannot simply be inserted into a bunch of 1s and 0s. The human experience is based on the human rūh (soul) and cannot evolve (or devolve) into matter. Machines are without a rūh or and are non-sentient. Thus, they do not define human experience, nor can they outsmart them. They can indeed help in “chores” and make human tasks easier.

– Shaykh Amin, Director of Darul Qasim.

In the quest for more Knowledge.


During the waking hours of our lives we enjoy a certain sense of security in that the world around us makes sense. The physical laws that govern objects in motion never seem to bend. Newton’s laws of mechanics will show you not to hop on a skateboard at age fifty. The same is true with human interaction, as complex and irrational as it can be, dealing with people on a daily basis still seems to fall under some set of behavioral laws. Standing in line at Home Depot holding a bag of lump charcoal you praise a fellow shopper’s wrist watch (must be in Dallas, Texas) only to find they promptly return with a nod and a smile. Waiting in your car at an intersection you get distracted for 30 seconds not realizing the light has turned green and the guy behind you shouts some choice words for your listening pleasure. The reality of the physical universe surrounds us and whether we like the interactions or not, there is a strong sense of familiarity with the rules of engagement, the systematic display of cause and effect … and then you fall asleep.

You are in that same Home Depot looking to buy a new grill when you spot a perfect candidate on the showroom floor. You remove the lid and out comes a family of white cats, mother and her kittens, bright and fluffy, like balls of cotton. You pet the mother’s soft coat of fur as she warms up to you and drives her face into your palm, a familiar feeling for cat lovers. Down the aisle you see your next door neighbor shopping as well but with a black doberman walking alongside him, no leash. At first it appears strange to you because you didn’t remember your neighbor having a dog, but you acquiesce. The canine notices your spouse who somehow spawned in that same aisle without your noticing and proceeds to lick their hand. Your spouse is noticeably uncomfortable yet your neighbor, presumably the owner of the creature, is all but indifferent. The licks evolve into bites, painful ones, your spouse struggling to get away from the dark beast … and then you wake up.

This would never have happened in real life because most folks would have grabbed a steel poker from the grilling aisle and ensured their spouse’s safety. It is that lack of control in a realm where the physical limits we are accustomed to are relaxed that leaves an impression, sometimes one that is hard to forget. Every now and then a dream comes along that is hard to ignore, preoccupying the little space we have in our busy modern lives. Even skeptics of dream science are unable to deny the occurrence of strong dreams and the impact they can have on a person’s life.

Recall the story of Fir’aun from the time of Prophet Musa عليه السلام. Why did Fir-aun set out to commit a most cruel genocide against the Bani Isra-eel race? It was because of a dream where he saw a fire emerging from Bait-ul-Maqdis engulfing his kingdom in Egypt. Or remember the dreams of the two men in prison who consulted Prophet Yusuf عليه السلام for their interpretation (Surah Yusuf – Ayah 41). Imagine wearing the shoes of the second prisoner, knowing that once you’re out of here your life will end in crucifixion! Having a positive outlook on life while carrying that knowledge in your heart … not so easy. A little less extreme, consider later on the King’s dream about seven fat cows eating seven lean cows. Prophet Yusuf’s ليه السلام interpretation protected an entire nation from poverty and starvation.

We are AlhamdulIllah blessed that the door of true dreams is still open, even for us little people. The challenge therefore is not as much in seeing dreams, but rather it is in understanding and interpreting them.

The language of dreams is drawn from the Imaginal Realm ( عالم الأمثال). Everything we are able to conceive of in the physical realm that we live in, takes on a physical shape and form in the Imaginal Realm. The forms we see in dreams are brought forth from the Imaginal Realm. So now consider the vastness of the Imaginal Realm against the physical realm ( الدنيا ) we live in. The former must be able to house anything we as humans can conceive, imagine and feel. The human mind’s ability to conjure up an idea, to imagine something, seems almost limitless. On a brutally cold Chicago winter morning, how hard is it to imagine snapping your fingers and teleporting to a tropical island sipping fresh coconut milk without a care in the world. Add some time travel to that, make yourself young, sharp, strong, why not? Or how about the math student sitting alone at their desk on a spring afternoon, frisbees airbourne in the adjacent quad, contemplating the paradoxes of transfinite sets. Early on in their undergraduate studies, every student of pure math comes across a quantitative construct that is too large to fit in the known universe. Something so large in size yet it can be described with minimal fuss, and boom, you just outsized the cosmos. The limits of imagination are much much wider than that of the physical realm.

Collectively the set of images, forms, concepts and ideas is, mathematically speaking, orders of magnitude larger than the physical realm. In fact a comparison given by Rasuul-Ullah ﷺ between the physical and Imaginal realms is like a ring tossed in a desert, the ring being the physical realm. Therefore the language of the Imaginal Realm is orders of magnitude more complex than that of the physical realm. Ever try learning a new language? Think about the combinatorial complexity of the vocabulary of the Imaginal Realm. But it doesn’t stop there.

The forms that we see in dreams are largely limited to the physical objects we know about in the universe we live in. Hence there is a many-to-one mapping between dream meanings and forms. A form in a dream can have multiple meanings depending on the imaginal context. A scene in a dream consisting of multiple elements would need to be interpreted jointly, not as the sum of its parts. This is how dreams convey a message. In a dream sequence, the forms not only appear as individual entities, but they interact with each other. That interaction, together with the entity descriptions comprises an experience. How a dog interacts with a person in a dream is not limited to the physical laws. In a dream a dog might just speak French and take you out for sushi – in which case canceling that upcoming dinner appointment with your European colleague may be in order. As such, interpreting a dream sequence involves analyzing a much larger set of potential sequences or experiences than those of the physical world.

As humans, the rational part of our intellect is by default data-driven in that we repeatedly sample observational data to hypothesize reality. Wearing dress shoes a day after it snows will cost you a new pair of shoes. No treatment can reverse the effects of cold black slush against your soles. Do this twice and “not wearing dress shoes in snow storm aftermath” is ratified in your cerebral constitution. Not always aware, we do it all the time – paying attention to cause and effect as our daily lives unfold minute by minute. Say you meet three different Pakistani folks on three different occasions, each of whom owns a dashing white 4-door sedan. Almost subconsciously your mind will weld white sedans to people from Pakistan. Searching for patterns and correlation within physical phenomena is a continuously running background process in every living mind. However, this can be futile in the imaginal realm as the same dream sequence may represent very different meanings. Here there is a missing interpretational agent: the dreamer.

The dreamer, almost by definition, is the ultimate perceiver of a dream. The dream is therefore subject to the condition of the dreamer including their perceptual potential. Consider the dreams of Prophets AS which are one hundred percent true dreams. What Prophets see in dreams is what is going to happen in reality. The perceptual ability of a Prophet by Allah’s decree is of total clarity and cognition, there is no need for interpretation.

In the case of you and I, our dreams are not so clear. Even seeing a true dream (رُّءْيَا) is an event let alone having one interpreted. Some dreams we see simply because that is what we want to see. If you really want to believe someone else in the world is responsible for your personal screw ups and follies, you might reaffirm it with a dream. On the other hand if you are enamored by a fresh charismatic figure who just flew into a local imam position, whose qiraat penetrates your soul every morning during fajr, whose sermons make you forget about that job promotion you so badly wanted all these years, well then, you just might see that young chap in a dream as the Imam al-Mehdi. A word of advice – keep that dream to yourself.

The carnal self (نَفْس) has the potential to introduce significant bias and inaccuracy in the dreamer’s perception. In this case the dream can provide clues as to what the dreamers themselves are after, but it blurs the scene for those seeking guidance from the dream as is. If a restaurant owner strongly believes his brother is skimming off the top on weekends when the place is packed, well the latter may very well make a guest appearance one night in dreamland. Thankfully dreams don’t hold up as evidence in a court of law.

From this it is evident that the dream interpreter has to decode both the dream and the person who dreamt it. The interpreter must be able to decipher the self-induced perturbations and rotations of the dreamer. The carnal self has the ability to invert the dream signal! Imagine what that does to the utility of an interpretation, a simple binary flip turns the entire narrative upside down (or right side up!) Nothing is geometrically further from a statement than its opposite. Is that young man a Mehdi, a Dajjaal or neither?

Along similar lines, a dream’s interpretation is also subject to the dreamer’s life events. A familiar face in a dream may represent that same person in the physical realm, or it may represent something totally different. If the dreamer in their active day-to-day life happens to have a relationship with someone, then their appearance in the dream might refer to their relationship. On the other hand, if the dreamer has not met that person in decades, then the scene may very well refer to something else like a business opportunity for example. An inwardly horrifying yet outwardly comedic (such is life) example is when you see your spouse in a dream …wait for it … getting cozy with someone other than you. What’s more painful is waking up realizing it was a dream and having nowhere to release that built-up anger. Here any interpretation would need to include the personality and history of the dreamer. Jealousy and trust issues, warranted or not, would obscure the informational content of the dream. On the other hand, one’s spouse in a dream can represent their job in real life, suddenly making the sequence a lot more palatable for the dreamer.

Another example is that of snow which on some occasions can mean forthcoming good fortune and on others the opposite. It will depend on the circumstances in the dreamer’s life including when exactly they saw it. If they saw snow falling during the winter months the meaning will be different from had they seen the same dream in the summer. And if you think it is restricted to a simple binary outcome, sorry. Snow can also serve as advice (نصيحة) about some ideas you have in life. A couple seeing snow atop mountains might have to rethink their near-term life decisions. From these examples, it becomes apparent that the variation in meaning of an imaginal entity grows proportionally with the space of interactions of that entity with others in the Imaginal Realm. 

Per imaginal entity, the space of potential interactions is about as large as the set of entities themselves. Meaning, a spouse in the Imaginal Realm can interact with any other imaginal entity, each interaction distinct from another. You might see your husband drinking a cup of warm milk, chopping down a tree in your uncle’s cherry orchard, or shaking your since long passed grandfather’s hand smiling at each other. Each one of these scenes is a simple pairwise interaction of entities where two entities mingle in some manner within the Imaginal Realm. Mathematically speaking, the space of pairwise entity interactions is larger than the square of the entity space (N2). But hey, why stop there? There is nothing to prevent three or more arbitrary entities from forming a scene in the Imaginal Realm. The space of interactions quickly grows exponentially in the number of entities.

From the vantage point of the dream interpreter, the sheer number of dependencies and knowledge banks that go into a single interpretation is perplexing. The Imaginal Realm code, the dream-scenic interactions, the synchronic state of the dreamer and the personal experiences of the dreamer including their history together heavily compound the space for interpretation.

Portions of the Imaginal Realm code have been captured in Ibn Sirin’s book on Dream Interpretation. Thirty bucks on Amazon will have this lovely text shipped to your living room, ready for use on your next exciting nocturnal adventure. So there you are, the zealous dreamer hopping out of bed one morning rushing to grab your copy strategically placed on the nightstand almost within arms reach. Your eyelids struggle to defend your sluggish pupils against that piercing morning sunlight, the one thing stopping you from locating the word frog in Ibn Sirin’s text. Alphabetical order ultimately leads you to the answer as you read aloud. “…a frog means a pious man”. No sooner than your brain starts calculating who this might refer to in real life, you read a couple lines down “…a frog means a person who practices sorcery”. You give yourself a pat on the back for having helped drive up the AMZN stock price with your recent contribution.

The Imaginal code itself is immediately combinatorially explosive in that there are way too many possibilities for the reader to even attempt to apply the dictionary to their dreams. In fact, browsing Ibn Sirin’s text, it seems like every other dream scene contains the possibility of dying from a calamity – see for yourself! On the flipside, if you are looking for something in particular, you can eventually browse through enough of the text to find entries that resemble what you seek. How’s that for observer bias?

Ibn Sirin’s book was not meant for the avid, self-proclaimed, hobbyist looking to unlock the mysteries of the Imaginal Realm with the aid of a PDF file and some regex skills. It was meant as a reference for a trained expert on dream science.

Another ingredient of interpretation specific to Muslim dreamers is that the language of the dream must be processed through the Qur’an. Therefore the interpreter, in addition to being familiar with the dimensions mentioned above, must also possess skill in correlating dream codes within a Qur’anic context. Again, this is much more than a mere text search as it requires training in the tafseer of the Qur’an and how the verses and themes of the Qur’an connect at a conceptual level with any particular dream sequence.

Artificial Intelligence or AI, the topic of the hour, has folks on edge, the primary reason being that it can seemingly do a lot of the things humans do, but much more effectively. Similar to how in the 20th century machines replaced scores of labor intensive, mechanical jobs that once put food on the table for millions, the general populace can all but wonder what AI has in store for today’s workforce. As mysterious and charming as modern chat bots appear to the naked eye, it must be understood that AI is only able to interpolate the data it is trained on. AI does not genuinely create ideas from scratch. Rather, modern AI is simply a software system that is heavily trained to detect patterns and relationships across enormous amounts of data. AI has been around for over 50 years, the recent innovation being that computer scientists and engineers now have access to excessively large compute resources as well as large volumes of electronically accessible data.

A simple example to illustrate this point is in voice recognition or speech-to-text. Suppose I say the word “hello” and present to you an image of the soundwave, a task that once upon a time required a microphone, an oscilloscope and camera, but today can be performed by your toaster oven. You observe the rorschach-looking image finding it somewhat uninteresting. But suppose now I provide you with twenty soundwave images of various people saying the word “hello”. Like we discussed before you would naturally begin to notice consistencies between the images, certain peaks and troughs occur in common places. That blur of sinusoidal curves starts to take shape in your mind. Although no two images are alike, they share a common thread, an underlying feature set that stems from the fact they were all derived from the same physical task of uttering a most common two-syllable word. Now, suppose I present you with another twenty images but this time of various people saying “goodbye”. The first thing your “hello”-brain will notice is how the goodbye soundwave images differ from the first twenty images. You instinctively begin to bifurcate image properties into “hello” features and “goodbye” features. The peaks and troughs are in different places, the oscillation rates are distinct, there is divergence between the two sets of images. With enough observation time, you would be able to decipher any of those forty images even if the labels were removed. Meaning, just by looking at any of those forty images, you would be able immediately identify whether it was a “hello” image or a “goodbye” image. That is, you have been trained.

In fact, you can test your skills out-of-sample by being presented with new “hello” and “goodbye” images, distinct from the original forty. Your trained mind will now be able to identify those key image features that allowed you to distinguish the two words from each other. With reasonable accuracy, you will be able to identify new soundwave images as being “hello” or “goodbye”. This is exactly how AI works. From a computer’s perspective, those images can be encoded as numerical sequences, perhaps of ones and zeroes indicating whether a pixel is lit or not. A software program can then be fed a large set of images coupled with the words they represent. With enough compute power and with a large set of image data, the machine can be trained to identify soundwave images with the words they represent. But if you think about it, a key limitation is apparent: AI is only as good as its training data. If the data fed to a machine is wrong in the first place, so will be the machine, just as you the human would be confused had the original forty images been improperly labeled. 

There is nothing spiritual about AI, it is just awesome at noticing patterns and emulating them. The more repeatable, stable and predictable a task is, the more susceptible it is to emulation by AI. For example, integrating online payments into a company website was novel and cutting edge twenty-five years ago. Today it is a straightforward web development exercise. Tomorrow AI will do it for us.

So now back to the subject at hand, dream interpretation. Why couldn’t we train AI to interpret dreams? Well let’s see how that might work starting with training. We would have to feed an AI engine a plethora of training data consisting of previously interpreted dreams. That would comprise several dimensions starting with the Imaginal code. For starters we could provide Ibn Sirin’s text in electronic form, enabling the machine with a dictionary lookup mapping elementary Imaginal sequences to meanings – that’s the easy part. Next you would perhaps source social media to feed the machine whatever data is available on a person including their personal activities, their relationships, their upcoming events, many of which pre-encoded would appear in the form of cringeworthy clips and distorted selfies. Don’t forget to stack on top of that a collection of Tafaseer for further contextual reference. The AI system would then go to work, attempting to isolate key features that help identify each dream sequence with its interpretation.

The sheer size of the dream interpretation space is nauseatingly voluminous. The probability of two dreams being identical is virtually infinitesimal, whence it is difficult to conceive of what an extensive dream-interpretation training set might look like. Again, there is no magic in AI. It cannot parse data outside of the span of its training universe. A machine trained in speech-to-text soundwave recognition will not be able to interpret a cat resting on its power supply in search of a warm surface to sleep on. So how would a dream-interpreting AI engine account for the carnal self of the dreamer?

What is more concerning here is the inherent loss-function of an erroneous result. If the machine gets the interpretation wrong, consider the cost to the dreamer. Are they going to divorce their spouse or quit their job? Ultimately the AI has nothing to lose, it is just following orders. The same is certainly not true for the dreamer.

If there is anything the reader should take away from this note, it is that the task of the dream interpreter is a tall one. If a person decides to map all the apparent ingredients (this note kindly skips out on the unapparent elements of dream interpretation) and mechanically enumerate the possible interpretations of a dream, not only would the list be non-exhaustive, it would contain a plethora of diametrically opposed interpretations. Feeding an AI engine all the dream-science research in the world, all the social media content published by the dreamer and all the electronically available Tafaasir texts, in aggregate would still produce a catalog of potential interpretations with little probabilistic context.

So which one would the dreamer pick? The answer is simple, save your breath, find a qualified Islamic scholar to do it for you.

1 thought on “Combinatorial Explosion in Dream Interpretation

  1. Shahid Quadri

    I was wondering if the dreamer had a dream for someone else as that sometimes happens. Even if the dreamers information from all sources and all of Ibn Sirans and all other Islamic scholarly books were feed into the AI, how could the AI know this dream was a message for someone else?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *