Gamification in AI — How Learning is Just a Game

A walkthrough from Minsky’s Society of Mind to today’s renaissance of multi-agent AI systems.

Eleni Nisioti
11 min readMar 11, 2022

--

⁍ Preface

In 1986, Marvin Minsky, a pioneering computer scientist who greatly influenced the dawn of AI research, wrote a book that was to remain an obscure account of his theory of intelligence for decades to come.

The Society of Mind consisted of 270 essays divided into 30 chapters. The book was less of a scientific or practical manuscript and more of a meta-manifestation of Minsky’s main message:

“Intelligence is an emergent property of interactions between simpler parts, that if you dig deep enough, are not themselves intelligent at all.” — Minsky, Society of Mind

Are we seeing a renaissance of Minsky’s Society of Mind? Image source: Google Trends

This sounds suspiciously like the mantra of what is today’s Complex Systems research. Natural systems like termite colonies and flashing fireflies have fascinated researchers in this field for decades: the puzzling contrast between the simplicity of each individual and the complexity of a group is counterintuitive for humans who have been engineering artificial systems in a top-down fashion.

Why did such an approach intrigue Minsky? Even more, how and why has Minsky’s message acquired a whole new substance in the recent years of AI progress?

⁍ Overview

In this post we’ll take a deep dive into the concept of gamification. First, we will briefly revisit Minsky’s archetype of a society of mind, which views intelligence as the outcome of interactions between agents with different objectives. Then, we will look at three recent research projects that gamified existing algorithms by converting them from single-agent to multi-agent:

🕵️‍♀️ Data generation as a game — Generative Adversarial Networks

🧐 Principal Component Analysis as a game — EigenGame

🗣 Language as a game — Emergent Communication

⁍ Minsky’s Society of Mind

You are watching an infant building a Lego tower.

The infant grabs a block, puts it in its mouth, cautiously places it next to its foot, grabs another block only to throw it away, puts the previous block on top of another one, quickly adds another one over it, inquisitively looks around perhaps in search of that green piece it immediately uses to increase the height of its construction and then slaps the four-story tower to the ground.

“What is the infant doing?” asks Minsky.

You can disregard the infant’s intelligence by saying that it has not reached an adult level yet. It is “just playing”.

Minsky’s Society of Mind is arguing that the developmental period experienced by humans is important for learning how to control the agents inside us

Minsky proposes that this play is more important than we think. At this stage in its life, the infant has many skills: it can see, grasp, move items, place them on top of each other. These are skills adults take for granted and can put to use doing impressive adult things like building actual houses and playing tennis. What the infant is missing is control over how these different skills communicate with each other; how did we, adults, find this control?

According to Minsky this control, which ultimately is the externalisation of our intelligence, is the result of a developmental process where these skills, which he calls agents, “fight” and “join forces” while solving a task.

Our internal agents are playing games until they learn how to cooperate and trick us into believing we are an individual.

Gamification

There are many definitions for what a game is. Here, we are interested in the formal definition born in economics and used in computer science:

In a game, two or more agents, are interacting by performing actions, which give them rewards. An agent wants to get the maximum reward possible but they are limited: their rewards depend on everyone’s actions but they are only in control of their own actions. What if one agent’s best action is bad for the others? The game only finishes when the agents have reached a situation where all of them are so happy with their actions they wouldn’t change them under any condition: why keep playing then?

This situation is called a Nash Equilibrium and is the Holy Grail of every multi-agent problem. As you can tell from this general description, not all games have a Nash Equilibrium and, even if they do it, the agents may have a hard time finding it.

Gamification is the reformulation of a problem that involved only one agent as a problem involving many.

Games can be messy, unpredictable and hard to analyse theoretically. Yet here are some success stories from AI research proving that, once achieved, gamification can bring field-breaking benefits.

⁍ Data generation as a game — Generative Adversarial Networks

The internet has always been a wild place but recent successes of AI are making it wilder: you can now find humans that don’t exist, anime that do not exist and cats that don’t exist.

This cat does not exist.

Back in 2012 things were quite different. All the rage was about algorithms for classification. Recognising objects in large datasets such as CIFAR-10 was very important for many applications and industries such as advertising and robotics. It is no wonder then that the field of computer vision became a main driver of progress in AI.

But generating images is a different task from classifying them. One does not need to look into the math to see that it’s inherently more difficult.

It’s much easier to recognise a drawing of the Eiffel Tower than draw it yourself.

In contrast to classification, a supervised learning paradigm, generation is most often done in an unsupervised manner: for example an autoencoder, in the form of a neural network, can capture the statistical properties of a dataset. By seeing many pictures of a chair it learns what makes a chair a chair so that it can reproduce it with small variations, making chairs that don’t exist but could.

Today, Generative Adversarial Networks (GANs) are the most common tool used to generate many types of data. Notice the plural: GANs are not one but two neural networks that are playing a game.

A diagram of a GAN

On the right, wearing many layers, the Discriminator is a fearful opponent. The Discriminator has seen a lot: it knows very well how to tell apart a cat from a dog and is quick to judge others that don’t.

On the left, the heavyweight Generator is the clear underdog of the game: it needs to draw cats without ever seeing one! Even worse: the cats are good enough only if the Discriminator cannot tell if they are real or drawn by the Discriminator. It’s a fight to the Nash Equilibrium.

In drier, mathematical terms, the two networks are playing a zero-sum game. As the Generator is getting better at generating realistic images the Discriminator is having a harder time to tell what is real from what is generated. At the Nash Equilibrium we have our ideal Generator and a frustrated Discriminator that gets it correct 50% of the time by random chance.

Significance: GANs are arguably the most influential example of gamification we have today. Their genius lies in a simple, born-out-of-necessity trick: by placing a generative model against a classification model, GANs translated the immense power of classification at that time into power for generation.

Transforming a constraint into an opportunity lies at the essence of multi-agent solutions.

⁍ Principal Component Analysis as a game — EigenGame

Imagine you want to predict the income of employees in a company.

You have a dataset with two features: the years of experience and the car colour of the employees. If asked which feature you think would be necessary and sufficient to keep, you would probably discard the car colour as irrelevant.

But now imagine that your dataset has 12,000 features.

Glancing through the values of your sheet you see columns with suspiciously large or random numbers, which makes you think that your dataset may be hiding noise that will make understanding the outputs of your model impossible. Even if you use a very large neural network, you will need to rely to the predictions of a black box. How can you tell which features are the most appropriate, before giving them to a machine learning model?

Principal Component Analysis (PCA) is an old-school but still widely applied technique for automatically solving this need. Its objective is to find a “transformation” of the data into a new coordinate system where the first features contain as much information as possible.

PCA in action

The word transformation here comes from Linear Algebra: if we have an original matrix X with a row for each example and a column for each feature x, then PCA’s job is to find another matrix W, which, when multiplied with X gives Y, the newly transformed data.

The useful property of matrix Y is that you can keep just a couple of its first columns and this subset will still contain almost all the information in the original dataset X. The features of matrix Y are termed principal components. Information in this type of task can be measured as the variance across the dimensions of the data.

The usefulness of PCA becomes even more obvious when we realise that real-world datasets are large, hiding insights that our human perspective cannot decipher.

PCA for Anomaly Detection

From a mathematical perspective PCA needs to find the eigenvalues and eigenvectors of the original dataset, with each eigenvector corresponding to a different principal component.

While theoretically this is a trivial task that any undergrad taking up Linear Algebra can do with pen and paper it has very large computational complexity: it involves the multiplication of potentially immense matrices and computing the eigenvalue decomposition. Both of these computations have a complexity scaling in the cube of the data’s number of features.

This explain this statement at the NeurIPS 2017 Test-of-Time Award:

It seems easier to train a bi-directional LSTM with attention than to compute the PCA of a large matrix. — Rahimi and Recht

In last year’s ICRL, researchers presented an algorithm that offered a new perspective on PCA: EigenGame.

Their proposal was to have a different agent assigned to finding each eigenvector. Each agent’s reward is related to the variance explained by its own eigenvector.

Thus, the Nash Equilibrium of this game is identical with the solution of PCA: we describe as much of the variance contained in the dataset with as few features as possible. Only this time we avoid the expensive matrix multiplication by asking each agent to find its own part of the solution.

Significance: This work showed that gamification can lead to great computational gains as it naturally parallelises the optimisation task.

⁍ Language as a game: the field of Emergent Communication

Firstly, what is language?

For machine learning researchers there are many reasons why this is more than a philosophical question:

  • Natural Language Processing (NLP) is an area containing some of the most important machine learning applications, like translation and text summarisation.
  • Language is an abundant resource: petabytes of human-produced data on the internet have been put to use to train huge language models such as GPT-3 and Google BERT.
  • Techniques developed in NLP, such as the Transformer architecture, are useful in very diverse fields such as computer vision and reinforcement learning.

For the part of the ML community working in these areas language has a a mechanistic definition:

Learning how to use language is a classical supervised task, albeit a complex one due to our large vocabularies. One just needs to collect massive amounts of data and feed them to a model that will discover their statistical regularities. For us, uttering the most appropriate next sentence in a dialogue is equivalent to finding the most probable sentence that a human would have used when taking part in a similar dialogue.

Do you think there is something odd in this definition? Many AI researchers think there is.

For most of us finding a definition for language would be hard but we would certainly make use of some of the following terms

  • interacting in real-time with another human
  • understanding their intentions and opinions
  • agreeing or disagreeing
  • achieving something beyond communication, such as playing Hanabi or making a heist.

This realisation has led to the birth of Emergent Communication, a sub-field of AI concerned with how communication systems emerge without any prior engineering. The main tools here are language games:

In a language game, two or more agents, are communicating with some objective. This objective may be very simple: communicate successfully with another agent so that you are both talking about the same topic.

Referential games are a great example: the SENDER and RECEIVER both receive a set of two identical pictures, but only the SENDER knows the topic, which is which picture they need to “talk about”.

The RECEIVER needs to deduce the topic just from the message of the SENDER. If the RECEIVER finds the right topic the agents win, if it points to the wrong one the agents lose. Thus, the game is cooperative. The two agents do not have any knowledge of human language but find their own vocabulary by playing this game many times.

Here’s how this language game looks like:

Emergent communication is a language game played between agents. The topic is in red. The agents won this one! Original source: Lazaridou et al, 2020

Significance: Language games are exciting for many reasons:

  • Many researchers are warning that no matter how many resources we put into language models such as GPT-3, you will never be able to have a deep conversation with a chatbot. These models do not know how to interact with humans, read their intentions and adapt to a conversation.
  • There are many applications where human language is not the best way to communicate about solving a problem (think of trying to explain to someone how to tie a knot). Using emergent communication, artificial systems can come up with their own language, each appropriate for a different task.
  • AI research can help other fields such as anthropology, genetics and cognitive psychology, discover the origins of our own language. Things are not going great for these fields: in 1986, David Premack remarked that:

“Human language is an embarrassment for evolutionary biology”

To date, we do not have a clear understanding of why humans differ so much from other species when it comes to language.

Single-agent and multi-agent approaches are just two sides of the same coin, the coin being the problem at hand. Multi-agent solutions can offer computational and performance gains, while single-agent solutions can help us decipher the complex dynamics of games.

As the dust of excitement in other sub-areas of AI is settling down, multi-agent systems are gaining ground: perhaps we now have the right tools to see what artificial societies of mind might look like.

Applied Data Science Partners is a London based consultancy that implements end-to-end data science solutions for businesses, delivering measurable value. If you’re looking to do more with your data, please get in touch via our website. Follow us on LinkedIn for more AI and data science stories!

--

--

Eleni Nisioti

PhD student in AI. Deep learning is not just for machines. I like my coffee like I like my code. Without bugs.