Video games and the next big step on humankind

Music: You can hear the cry of the planet by David Dockery

When video games started to become more popular, they were accused of causing people to be more aggressive and even they have been blamed on some murders. I remember a story of a boy who thought he was the protagonist of Final Fantasy VIII and killed his parents. I've no idea if that story is true or not but even if it's true I wouldn't blame video games, I would arise awareness about mental illness and other important issues instead of blaming whatever is easy to do at the time. Metal music was the target before video games and this trend will repeat with new media.

Well, I've been playing video games since I was really young: I remember the green screen of one of the first computers we had at home and being scared of passing through a slicer of prince of Persia. I had to tell my brother to pass through those because I was scared the slicer cut my character in two, which I found it was very detailed at the time. But I also remember building really long ladders to save what were called lemmings, you had to give orders to lemmings so they start doing useful things but if you did nothing they would just fall to their death in the first cliff they found. So you had to think carefully and strategically where you had to tell them to start building ladders while setting another one the command 'stop' so the other lemmings didn't just walk pass the unfinished ladders. You needed precision but what was most important was creativity in the solutions.

Video games have become a huge part of my life. Indeed they have shaped the way I see and think about the world.

. . .

As the years passed, video games started to get more and more serious and complex due to computers being more powerful and creators exploring the new capabilities. The stories behind were no longer about saving 10 pixels high creatures but they were about more complex topics like: identity, faith, betrayal, lost, power...

I have laughed, cried and I have been anxious with those stories, but most importantly, I learned a lot. What's unique about it that is not realized in books or films is that you move through the world created by the authors, and instead of describing the world, you experience it. You have to move the characters yourself, the story only advances when you have the will and ability to do so. This creates a really powerful relationship between you and the story that's being told.

If you know me, you already know what game I would like to talk about, and indeed it's about Final Fantasy VII. I'll talk about that one because it's the one that impacted the most when I was young but there are plenty of games like this that impacted young people like me. The first Metal Gear has a text in the ending that reads as:


In the 1980's, there were more than 60,000 nuclear warheads in the world at all times. The total destructive power amounted to 1 million times that of the Hiroshima A-bomb.
In January 1993, START2 was signed and the United States and Russia agreed to reduce the number of deployed strategic nuclear warheads to 3500 - 3000 in each nation by December 31, 2000
However, as of 1998, there still exist's 26,000 nuclear warheads in the world.

That game was a critique on the absurdity of the cold war and the unnecessary amount of nuclear weaponry we had and unfortunately that we actually still have.

. . .

What's the deal with video games? I think it's time to talk about Final Fantasy VII. I will spoiler a lot of things about the game so if you really are intrigued and want to give it a try (which I recommend), skip this section and start reading the next one which starts after the three dots.

You are warned then, let's begin. If you look at an image of the game now, all you will see is just a low-polygon figures that doesn't look that good, but let me explain you why this game marked an entire generation.

To beat this game for the first time you typically spend between 60 and 80 hours (depending on how much you explore the world and how fast you move, etc.) the first time you play. Well, now imagine meeting a person you like and want to know better so you meet with that person each day for two weeks for a couple of hours. With that amount of time you would barely make it into the middle of the game. As you can see, you really get to know the characters with that amount of time, you have to make decisions and you live first hand what happens to them.

So... what's all this game about? What happens there?

The world of Final Fantasy VII is different from the one we live in. What we call electricity the game is called Mako. Mako is very different from electricity in the sense that is taken directly from the planet. Later you find out that Mako is what is called 'life stream' which is the energy of living things when they die. So when collecting Mako for powering the houses they are literally killing the planet in the process. That's not different from what reality is, but reality is less straight forward and a lot harder to see what's happening. Carbon emissions aren't killing the planet, Earth will stay here with any amount of carbon we emit, but for humans it will be harder, the climate is changing and the temperatures are rising. Carbon has an effect on the planet which affects us which sometimes isn't straight forward to see.

This is the first thing I learned, while trying to create a better environment for us we might be destroying other places in the process. In the game you start in a city called Midgar. Flowers don't grow there which is a small thing you learn at the beginning but a clue of what the gathering of Mako is doing to the planet. The same happens with the temperature of Earth which is slowly rising, that's our clue (and there's a lot more actually) but what we do with that depends on us.

In the game you start as an eco-terrorist trying to destroy the reactors that collect Mako. It's not clear if that's the best way to act: by doing so lots of people die and also half of the team ends up dying. That's the first question the game raises to you: Is it worth it to keep doing that? Are you doing things worse by trying to be too aggressive?

This game is quite complex and I could spend all day talking about it but let's not enter in any details here, just let you know that in the middle of the game, after you have spend like 30 hours, a character is killed. This death is remembered by a lot of people and it's quite known in the gaming community. For a lot of people, that was actually their first encounter with the death of a beloved one and this can really leave a mark to young people. In that time there was the early internet and in all forums everyone talked about ways to resurrect that character which is impossible but I guess it's a way to cope with death. After that, everything takes the wrong turn: The protagonist, called Cloud, gets lost in the middle of chaos and you find them later in a wheel chair really ill and without the ability to talk.

Music: From the edge of dispair by symphonicremasters

That was shocking to me and I'll always remember the feeling of lost and despair while everything is getting worse. You see the rest of the party trying to move on, but Tifa, one of characters from the beginning, decides to stay with Cloud in the hospital. Everything feels so unreal in that moment but the party tries to keep moving on even though everyone is feeling lost.

The party slowly recovers and Cloud gets better at the end, and from that point forward everything goes well, except you find out that Cloud, who said he accomplished his dreams by becoming and elite soldier, never achieved that. He never achieved his dreams but due to a trauma and poison he misremembered his past thinking he was his best friend (who was actually a real elite soldier). But he died in front of Cloud after both where trying to escape from being experimented on.

Final Fantasy VII really brings you down, but the party always tries to keep moving forward while trying to understand themselves and trying to not repeat the mistakes of the past. I've applied that resilience of trying to go forward even when you are not sure you will success. I wasn't a good student, I always passed the courses with the minimum grade and when starting physics I wasn't used to study and the first years was really tough. But slowly I did manage to get better and better and at the end I manage to finish the degree and a masters course in theoretical physics, which my younger self would be impressed for sure.

When I was studying physics I listened to the songs of the game and if you played the music of the post you have been as well. The original game didn't had drums on the songs like the first song I put, it was too old and the music was all MIDI which is the computer simulating the instruments and MIDI drums didn't sound good in that time. What you hear in that youtube is just a guy who loved the game like many and made a commemoration of the memories it brings. You can see in the comments of another of his Final Fantasy VII covers:

I think it's time we move forward.

. . .

I've been talking about Final Fantasy VII which is what it is called an RPG (which stands for role-playing game). This games are usually centered on the story but there are a lot of types of games and not all of them are the same. Some are just pastime ones which became quite popular with smart phones, other are more focused on adventure, other in strategic thinking, etc.

I love strategy games, in Europe chess is considered a mind game and usually if you say you are good at it people tend to think you are smart because it's a complicated game. But with video games, the games can be even more complex. Take for example Advance Wars, is a game released for the Gameboy Advance depicting war in a very casual way where the objective is to capture the enemy HQ. Like chess, this is a turn based game but unlike chess, you have to manage economy capturing buildings of different types and then build your army before your enemy captures your bases. You units have life and can be hurt and healed, there are ranged units, different type of terrain that affects the mobility of the units, etc. Games have become really complex nowadays and I assure you they can help challenge your mind. Simply try games like Baba is you or Jelly is sticky, to name just a few examples, and you will see how those puzzle games can be a real challenge and you have to really think outside the box. If you are bored of the euclidean geometry where the sum of the internal angles of a triangle is always 180 degrees, you can try Hyperbolica to explore Hyperbolic and spherical geometry in first person.

Those are one type of enjoyment you can get of video games which is the challenge itself of beating the game. Those type of games have been of high interest for artificial intelligence (AI from now on) because the environment is very well defined. Since the rules are defined by the game you can define clear goals and it's easy to see if you have created a dumb AI or a smart one: just play against a human and see how it does.

The earliest research into thinking machines was inspired by a confluence of ideas that became prevalent around 1930s to 1950s. Neurology had shown that the brain was an electrical network of neurons that fired in all-or-nothing pulses. Claude Shannon's information theory described how information could be transmitted digitally (that means all-or-nothing signals) and Alan Turing's theory of computation showed that any form of computation could be described digitally. The close relationships of those ideas suggested that constructing an electronic brain might be possible.

Walter Pitts and Warren McCulloch analyzed networks of idealized artificial neurons and showed how they might perform simple logical functions in 1943. They were the first to describe what later would be called a neural network.

Nowadays we all hear about neural network and machine learning but what does really mean all of that? How does a machine learn?

. . .

Let's see how well you perform this test. Let's put colors into a grid of 10x10 with different type of values from 0 to 1. We will represent 0 with white, 1 with black and all in between by different grays so it's easier to visualize. Can you identify what numbers are those?

If you said 662, then you really did a good job! Maybe too easy? Well, if you try to write a program to read that, you will rapidly find it's not that easy. If you take the values of each cell, then you find that having the same number slightly moved in the grid gives completely different values for a lot of cells but still you will have no issues recognizing that. That's because we are able to recognize patterns and understanding how we are able to do that is the beginning of the neural networks.

Each input (or cell) is a neuron of the system. A neuron is just something that can hold a value, in our case the value of the color it has (which goes from 0 to 1). Since we are working with a 10 by 10 grid we have 100 inputs or neurons that activate. The output of this neural network corresponds to the nine possible digits from 0 to 9, so a certain configuration goes from the inputs, then to some hidden layers that I will explain later and the output:


As you can see in the picture, we have 100 initial neurons which would have a number inside, then those are connected to the ones on the next layer which has 7 neurons and is hidden, those goes to another hidden layer and finally the output. The amount of layers hidden and the amount of neurons in each hidden layer is kind of an arbitrary choice, in this case I put 7 just because it's what it fit best on the page. The interpretation of what each layer does is usually extremely difficult to tell and usually a really non-human way of doing things since machine learning can catch up on things we do not, but trying to understand the hidden layers can be really important to see what might be going on.

The last hidden layer of neurons may contain information on features like, having a circle on top or bottom, or having straight lines and so on. So for example in the case of a 6 the neuron that says there's a circle in the bottom might 'fire' and for an 8 both top and bottom neurons fire. The layer before that should contain information about how to build those more simple forms which for a circle for example might be 4 curved lines put together.

So how are the number of this neurons are computed? We know the first layer is taken as an input but how do you compute the second layer?

Well, the value of each layer depends on all the values from the layer before with a different weight (or coefficient) and a bias (which is a constant you can add at the end if you want the neuron to fire easily or with difficulty. Then all this values are summed and a function called ReLU is applied (this was usually was done with a sigmoid function instead of the ReLU function but for really large neural networks that runs too slow). The ReLU function is just a function that is 0 when the value is negative and the value itself when positive.

So many neurons and so many connections sound really as a matrix, in fact you can type it as:

But how does it learn?

. . .

The objective is to set all those weights and biases so given a specific configuration we get 10 parameters which ideally are zero except the digit we were trying to draw.

So to begin with, we just initialize all those parameters randomly, which means it will perform terribly since everything is random but here is where the training comes.

At this point you define what is called a cost function, which is a way of telling the computer when is wrong and when is correct. For example, if you draw a 3 and the output might be (0.43, 0.52, 0.01, 0.75, 0.22, 0.97, 0.61, 0.60, 0.88, 0.75) when in reality we want (0, 0, 0, 1, 0, 0, 0, 0, 0, 0). So the cost function is defined as the difference between those two vectors, and then we square each result and add them up which will be:

(0.43 - 0.00)^2 + (0.52 - 1.00)^2 + (0.01 - 0.00)^2 + (0.75 - 0.00)^2 + (0.22 - 0.00)^2 + (0.97 - 0.00)^2 + (0.61 - 0.00)^2 + (0.60 - 0.00)^2 + (0.88 - 0.00)^2 + (0.75 - 0.00)^2 = 4.0362

Then, we do this again and again which is what we call training and we do the average of the cost function of all the cases and we get an idea of how good or bad the neural network performed. But knowing how bad the network did doesn't make it better, we need a way to change the weights so it gets better. If you ever took a course on calculus, you know you can find a minimum of a function by doing its derivative:



In this case we have plotted just one parameter but we have a multidimensional function: one dimension for each parameter so in reality we have 843 inputs, one for each weight plus the biases:

C(w1, w2, ..., w843)

In multidimensional calculus what you compute instead of the derivative is the gradient, but the idea is the same, the gradient points to the higher point in the function while minus the gradient points to the minimum. Notice that is not trivial to find the global minima of a function, you know the slope of your current point but you don't know if you will end up in a local or a global minimum since the function is unknown.

This technique was primarily used in the 80s and 90s and nowadays we have more modern approaches like the convolutional neural network or LSTM but it's a key step in understanding a neural network.

Now that we have an idea of what a neural network is, lets see what it has been capable of and I don't know any better place than to explain the story of DeepMind.

. . .

DeepMind is a British company about Artificial Intelligence (AI) founded in September of 2010 and acquired by google in 2014. The goal of DeepMind is to create an AGI, which stands for Artificial General Intelligence. The meaning of that is slowly changing as we learn more and more about artificial intelligence but essentially it means to make a neural network capable of doing different tasks at the level of a human or better.

One of the first self learning system ever build was in 1955 by Arthur Samuel and it was in the game of checkers (or draughts). It was shown on television on 1956. Since then, machine learning has been having ups and downs: At the beginning there was a lot of hope but then rapidly the computers couldn't keep up with the demand in memory that those systems required and AI were always toy models that couldn't scale because of that. Usually, to be able to read an image and say which number it is we needed a bunch of weights, a typical machine learning algorithm can have billions of weights, there's even algorithms which contain trillions of parameters lately.

But now the term machine learning can be heard everywhere and one of the reasons is that now computers have enough power to do interesting things.

What's the current state then? One of the big achievements of AI goes back to 1985 when Deep Blue, a chess-playing AI developed at Carnegie Mellon University, defeated the world champion Garry Kasparov four games to two. But why is this considered a big of achievement? Because the number of legal positions in chess is estimated to be 10^40, if we include illegal moves that number goes up to 10^111. There are between 10^78 and 10^82 atoms in the universe, so you can imagine a computer simply cannot compute all possible moves to decide what to do, we would be waiting an eternity.

This gets even more exemplified with the game of Go, which is an abstract game from China which is believed to be the oldest board game continuously played to the present day. Go is characterized for having very easy rules but a huge amount of possible configurations: it is estimated there can be 100^170 positions which results in a googol times more complicated than Chess. That's why Go players felt really confident that any computer could play Go as well as a grand master and until very recently there wasn't any computer program able to do so... Until DeepMind came around with AlphaGo, an AI capable of beating the very best players of Go.

In chess it's relatively easy to know if you are in a good position or not, you can check the number of pieces in the board and that usually gives you a good idea. There are some pieces more valuable than others and you can set values to check that but in Go, it's really hard to see if you are in a winning position or not. That makes creating an AI really difficult since the computer has to analyze its position first to make a good move. Usually when you ask why a great player made a move in chess they will explain you how they put pressure in some places on the board or how if they capture your piece then you have an even better move but in Go, players usually say things like: 'It felt like a good move', people play using intuition you build after playing many games. How can you create a machine that uses intuition?

The first critical change to make AlphaGo successful was to make the evaluation function, which is the function that evaluates the state of the board, been evaluated by a neural network itself. This way you don't have to program what is good and what it is not, the AI figure those by itself.

But a good machine learning that plays proper Go doesn't mean it's smart, it just means it's good at Go. One of the challenges of creating an AGI it is its generality and so they did that with AlphaZero, a neural network able to play any 2 player game. That neural network ended up outperforming AlphaGo at Go and can play Chess a lot better than Deep Blue and it's able to play Shogi (japanese chess) at a super human level as well.

Those games have something in common though, the information is visible for every player at every stage of the game and that's not how real world usually works. There are unknowns and you have to plan those as well, and that's when they jumped into the world of videogames.

In videogames, the decisions have to be made on the spot, sometimes you don't have time to think and in a lot of video games you don't have the complete information on what the opponent is doing exactly. The game they choose for the neural network was StarCraft II, which is one of my most played games.

In StarCraft there are multiple challenges, you need resources to grow your economy, you need to build an army and you need to destroy all enemy buildings. The enemy is also trying to do the same to you all while both are in what's called 'Fog of War', which is a fog that covers all the map and you can only see near your units. To know what the opponent is doing you have to sent some units or 'scouts'. From the buildings you see the opponent has and the type of troops and the amount of workers, you can deduce what strategy it is trying to do: Preparing for a quick attack? Building more economy for a late game battle? Doing some sneaky strategy? While you scout, the opponent is trying to deny it by killing the unit you sent so you usually cannot see all that is happening.

This is what AlphaStar was trying to tackle, and it managed to do it very well. The machine ended up playing grand master level and manage to won some of the top players.

And then, the first real application to the world came with AlphaFold. One of the biggest challenges in biology is the way a protein folds. A protein is a sequence of amino-acids and you usually know that sequence, but depending on how the protein folds due to the electrical attraction or repulsion of its components, it interacts really different with its environment. So knowing how a protein folds allows you to rapidly make vaccines or drugs to combat certain bacteria or virus, it also allows for creation of proteins that are able to eat plastic for example, which is a thing that it's been studied right now, and a lot of different things. The prediction of the folding of a protein was usually a thesis for a biologist and it can take many years to find (even more than a thesis). Now with AlphaFold they created incredibly precise predictions and created a database (https://alphafold.ebi.ac.uk/) which is accessible to everyone to accelerate the progress of science and allows smaller researcher groups to get a boost on rare diseases treatments which usually don't get much attention and money.

So, what's the future?

. . .

We are facing the biggest crisis humanity have ever faced: The carbon in the atmosphere is rising making the temperature of the planet higher which means particles actually move faster which can remove the moisture from the soil resulting in more wild fires, the ocean evaporates more rapidly resulting in bigger storms, etc. So we know what's happening and how to avoid it: reduce carbon emissions, but that's not easy to do.

This will bring social and energetic crisis and what's worse is that this is not the future, we are already in the beginning of the crisis and we have to act now.

We are investing already in cleaner energy sources like nuclear fusion, which as a difference from nuclear fission, it doesn't generate radioactive waste but it's extremely hard to make on Earth. The Sun generates energy by merging atoms together in its core due to the high gravitational pressure, and when low mass atoms merge together it gives energy which is called fusion energy. We are trying to imitate the Sun, but on the surface of Earth we cannot use gravity like the sun, and we have to use super powerful electromagnets. The atoms are at so high temperature that it forms plasma and it would meld any material it touches so the electromagnets have to keep the plasma floating. What is worse, any small changes on the shape of this plasma destabilizes the system. There are models that try to predict the shape but it's really hard and the current European record is at 5 seconds when the minimum objective is to achieve 10 minutes.

That's where DeepMind comes in again: they are trying to make an AI that predicts and reacts to the shape of the plasma so you can modify the electromagnets at the moment the plasma changes shape so it's more stable. That's one of the current process and great progress has been made (see https://www.nature.com/articles/s41586-021-04301-9).

Also they manage to reduce Google Data Center Cooling Bill by 40% using deep learning techniques which also means it takes less energy meaning it also leaves less carbon print on the atmosphere.

Nowadays the Data Centers use more electricity than entire countries so in a matter of years it's like a new country has emerged from nothing which demands a lot of electricity. Optimizing the process in a data center is not something nice to have it's something we must have.



The challenges humanity faces are global and very difficult to solve, AI is our new tool to try to tackle and solve those problems and it needs to work.

AI is also entering in a lot of different places: image recognition, voice recognition, image processing and so on. Gato is an AI created by Deep Mind that is trying to be as general as possible, currently it can process images and write what's on the images, it can control a robotic arm to move pieces around, it can play arcade games, you can chat with it and much more. What does this mean? It means it understand the context and knows if the output should be an image, a text or moving a robotic arm to pile blocks.

That's where I see the future of AI moving towards: More general and multi-disciplinary. There's been attempts to make AIs to prove theorems in Maths, to make unbiased juries (which is very hard and tricky since the data comes from humans and humans are very biased). In medicine there's been advances which AIs outperform doctors in image classification tasks like analyzing radiographs and detect abnormal cell growth which can be really hard to see.

. . .

I think AI will be everywhere we can think of, and I don't find it's unthinkable to imagine a centralized AI type of machine which you will be able to ask about what can you do to be more happy, or how to improve your diet given your resources to have a healthier life based on the type of person you are.

Will we have intelligent machines like humans which have the same rights? I think a lot of that depends on what the use is. What I do think is that we will keep advancing AI and the line between conscious and non-conscious will be crossed without we notice.

Making machines think means understanding ourselves as specie. Which animals are more conscious than others is a similar issue than when a machine will become conscious or self aware. The line between death and alive is more blurry than we would like and the world is weirder than we always think it is.

We are humans made of cells, which are made of atoms which are made of fundamental particles. Fundamental particles are not alive, yet from their interactions emerges intelligent beings either in nature or in a computer.

Which laws are behind those particles that manage to do so much stuff? In the next chapter we will dive in the laws of physics, which we will explore as a journey. The laws of physics are not yet known in all its accuracy, but we do have a really good approximation of what they are. We will explore them as we had discovered them.

The journey of finding the laws of physics is also the journey to understand our place in the universe.

. . .

The next post will be titled: The journey to find our spot in the Universe. And as always, I hope to see you there!


Thanks for reading,

Rob.

Comentaris

Entrades populars d'aquest blog

The beauty in repetition

Introduction / disclaimer