ZEN-RRNN - On Meditation & Machines

What our minds teach us about machines.

Nam June Paik, “Buddha Reincarnated” (1994).

A goal of neuroscience and A.I. research is to discover the nature of intelligence and creativity. To achieve this, many ingenious machines and theories have been developed. One way to tackle this hard problem is to use the built-in cognitive abilities of a system to gain insights about itself. This is known as introspection or Meditation:

“Introspection is the examination of one’s own conscious thoughts and feelings. Introspection generally provides a privileged access to our own mental states, not mediated by other sources of knowledge. “ — Wikipedia

Traditionally many proponents of meditation have used very ambiguous language. Describing this simple, elegant process with an amalgam of spiritual and religious terms can be very confusing. Inspired by machine learning, one could define meditation like this:

Meditation: Using selective attention to tune the hyperparameters of an neural network, aiming at optimising its cost function.

Selective attention is the act of focusing on a object for a period of time, while simultaneously ignoring irrelevant information that is also occurring.

Hyperparameter tuning is the act of choosing the right parameters for an learning algorithm, with the goal of optimising its performance.

Neural Networks are used to approximate functions that can depend on a large number of inputs and are generally unknown.

Cost Function represents some “cost” associated with an event or variable. An optimization problem seeks to minimize a cost/loss function.

Of course, this is all very tongue in cheek. Nevertheless, it might prove to be a valuable narrative hack while talking about meditation in a increasingly computation oriented society. For a “how to meditate” guide, use Google.

Meditating Machines

Pil-Sung Yim, “Doomsday Book” (2012)

In Machine learning, a very active area of development is optimising advertising click through rates. Countless highly-skilled teams of engineers are coming up with complex systems to direct eyeballs towards shampoo ads. It is somewhat comedic calling this “Artificial Intelligence”. As an alternative exercise, let’s explore #ComputationalMeditation:

Experiment 1: ZEN-RNN

I fed an Recurrent Neural Network (char-rnn) a compilation of classic ZEN Koans. The ZEN tradition itself points out the absurdity of these texts:

What the Zen tradition emphasises is that the enlightenment of the Buddha came not through conceptualisation, but rather through direct insight. But direct insight has to be supported by study and understanding of the teachings and texts. — Wikipedia on Zen

ZEN-RNN Koans. Seed: Zen.

The wind and light: The monk asked the world about your realities and earth eating the wind. It is not death. He who is is only it. The monk asked, “I am it, it is a bowl.”.
The Swiwhhing Tay Tan: When he was counting to extract the other will be all things. Is the whole of the spare? Go to the root, with the world, the world is not the river. The prince of the soul is a great being who had forgotten the world.
What is the state: He clapped with his hands and said, “I have realised the earth is the same, I am a complete” The purpose of the Eye is life and do not know that if you stop him at attaining it. You are not my head or the hat of the wise. He could not be like the Emperor to be same that all man are.
The traps of the words: When I did not measure the monkey. When the words of the wise men follow into eternity. The sprack at the same life. The ocean of the same fire or one about the exists of a single. They came to the summoned and said, “Yes, I am it, the eye, something about the monks.” Yet the spirit is not display. The monk said, “When I replied to the state of being. If you come from it, I have nothing to be.”
The wise who could not resepect: You will be do not state. He is nothing — enter. In the other who was in the see of the things. We speak of a frog state. These is no measure.
Chûyû’s Ricks: A monk asked Kassan, “What is the body of the weals, so i can follow the road and whole universe?” The master said, “I say states are not separated” and went. I will be the great light and he call his name. What you know is the rest is emptiness.
The goes and the god man: The fish is the ancient of the earth with the tail. He said, “You are not the true of a goddess heart” The passing of the state is simple or not the same to the earth as the treasure. To see it is something of a right, and see it to ask the state what shall the sound of the word. The monks of the south said, “I will be the spirit not the master.”
The Southern Mountain Turtle: To see the state of the something is all things. He said, “The root made this mountain. The spirit is not the world. “ Shizai said, “Yes, I am a great peach”. The monk said, “The shadow of the same is the same state of the same to the sound that the boy is the same to the same to the state of the man is not the same to the staff.”

Experiment 2: RRNN

For the next experiment, I took the generated model file of the ZEN-RNN (the description of the network weights) and fed it back into the system. One could call this a Recurrent Recurrent Neural Network (RRNN). The output does not make much sense. Metaphorically speaking, it does not compute.

Seed: Meditation

0300 0000 0100 0000 0800 0000 0200 0000 0800 0000 7661 6c5f 6c6f 7373 0100 0000 b4a3 faad 7c86 fa3f 0200 0000 0500 0000 766f 6361 6203 0000 0002 0000 0091 0000 0002 0000 0001 0000 0033 0100 0000 0000 0000 0000 3540 0200 0000 0100 0000 2301 0000 0000 0000 0000 0014 4002 0000 0001 0000 006d 0100 0000 0000 0000 0000 5340 0200 0000 0100 0000 e001 0000 0000 0000 0000 a061 4002 0000 0001 0000 0028 0100 0000 0000 0000 0000…

Experiment 3: NULL-RNN

In the spirit of Claud Shannon’s genius art piece “The ultimate machine”, i trained a RNN on 100MB of text, featuring nothing else then “…………..”. The network trained (meditated) for over 36h on a single GPU. The results are predictably “.” but still beautiful:

Seed: ………

………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………

Final thoughts

Exploring the concept of meditation through the lens of computation is difficult but entertaining. Is it possible to compute mediative states? Can machines be “enlightened” ? Who knows. Using machine learning to maximize mass-contemplation is a fascinating venue for research. Most importantly, don´t take this piece of meditative #ComputationalComedy to serious, or yourself for that matter — life is to short not to laugh.

You should sit in nature for 20 minutes a day… Unless you´re busy, then you should sit for an hour. — ZEN saying on meditation.
Get in touch: https://twitter.com/samim | http://samim.io
Sign up for the Newsletter for more experiments like this!