Alpha Zero, chess and learning English: the present and the future of artificial intelligence
Here we were recently whispered that after only five years, translators and language teachers will simply not be needed. And the thing is that the neural systems of artificial intelligence are developing very actively.
They say that they will translate text and speech so qualitatively and quickly that the need for living specialists will simply disappear.
We, of course, laughed, but thought. And they decided to take a deeper dive into the subject and find out what is there with artificial intelligence and whether it will really leave us without work.
What is an artificial neural network
In short, an artificial neural network is created in an attempt to imitate the work of the human brain using mathematical algorithms.
The main feature of the neural network is the ability to self-learn. From the point of view of mathematicians, this process looks like a nonlinear optimization problem, which uses methods of discriminant analysis and clustering.
If for the humanities, the artificial neural network is able to analyze data using complex algorithms and conduct operations with well-defined mathematical systems, and with fuzzy language.
Two examples that we will analyze.
A well-defined mathematical system - chess . The game has a series of clear rules that are absolute to fulfill. There is a specific goal - to checkmate your opponent.
And there is a huge array of possible moves, among which you need to choose those that will lead to victory.
The difficulty of analyzing a chess game is that the number of unique chess games is approaching the number 10 ^ 120. Yes, yes, it is 10 to 120 degrees. By comparison, the number of atoms in the observable universe is approximately equal to 10 ^ 79.
Analyze all positions physically unreal. Therefore, the system is forced to choose moves and techniques that lead to an immediate win or a strategic strengthening of the position.
The second example of using a neural network -translation from one language to another . Here is a completely different data processing system, because there are hundreds of rules and thousands of nuances of languages that need to be considered when translating.
In addition, the system needs to understand the context in order to translate untranslatable words or puns. Otherwise, how can you find out the correct translation of the sentence with the verb “set”, which has 44 recognized values only?
Or even more difficult task is to convey subtle English humor so that Russian can laugh at him. Or even more difficult - translate a verse. Or ... well, you understand.
Now briefly about how the neural network works.
The system first decomposes the data into elementary components. And then one or more hidden layers of the algorithms analyze the data and perform the conversion.
In deep neural networks there are several layers of algorithms that deal with analysis. Often they are cascade in nature, in which information from the lower layer is transmitted to the layer that is higher in the hierarchy and processes the information at a different level.
Moreover, if the algorithms find clear dependencies in the data, then new algorithms are created based on them.
In chess, for example, a machine very quickly "invents" tactics for the rapid development of figures and the capture of central fields.As the system is trained, the number of algorithms and parameters grows. Some of them are improving and becoming more difficult, some of them are replaced by more compact options.
And all because such maneuvers almost always give an advantage in the opening.
Note that in the rules of the game this is not even close, but most of the games played confirm the hypothesis, so the machine begins to use it itself.
The same applies to the translation of the meaning of the word, which in different languages can be very different.
For example, take the word "onion." It has two basic, but radically different versions of values - a vegetable (“onion”) and small arms (“bow”). There is also a third of slang - “bow” is called a combination of clothes or a fashionable image (tracing from the English “look”). It is rarely used, but the neural network should also know it.
To find out which translation option to use, the neural system assigns each value its own parameters, which also depend on the words used alongside in the sentence.
So, in the sentence “Honey, buy a kilogram of onions and potatoes,” the system translates “onion” as “onion”. And all because there is a “kilogram” next to it, which is not used with small arms, and “potatoes”, which also refers to the “vegetable” parameter.
Similarly, with the sentence "The shooter pulled his bow and shot an arrow at the enemy." "Stretch" can only bow as a weapon. Plus there is the word "shooter". Therefore, we get the translation - “bow”.
Interesting. The word “arrow” in this case will not be considered as significant when determining the meaning of the word “bow”. And all because the “arrow” can also mean the green onion stalk as a vegetable. Therefore, sooner or later an exception will be added to the system, which will not take into account the word "arrow" in the context of the "bow".
And the result is a phenomenon when, according to its conclusions, the actions of a car become close to a person. And this is despite the fact that a system of algorithms is still used there, even if it is complex and multi-level.
Let cybernetics and mathematics do not swear. If anything, we are humanitarians in the good sense of the word, and the article was written for their own kind of humanoids.
A couple of words about Alpha Zero and Chess
In 2017, DeepMind, a subsidiary of Google, released an updated program for neural networks. The developers decided to test the work of the program on the most popular strategy games with clearly established rules: chess, go and shoga.
The learning process of a chess program took only 24 hours. Only the rules of the game were entered into the system - that's all. No debut libraries or batch databases. Only rules. And 24 hours the program played with itself.
In the first game absolutely random moves were made. True, it can not be seen anywhere - the information is taken from the words of the developers. As a result, one side lost, and the system felt that the actions of the other side were better for winning.
After 24 hours and 44 million games played with itself, AlphaZero became the strongest chess player in the history of the game. The Elo AlphaZero rating is about 3500 points, although according to various data it reaches up to 5000.
For comparison, the average amateur rating is 1200 Elo, the master of sports in chess is 2200-2400 Elo. The maximum Elo rating received by a man is Magnus Carlsen, the current world champion. On April 21, 2014, it reached a value of 2889.2 points of Elo.
Alpha Zero also plays about 600 points stronger (in the most optimistic version). It is like a master of sports playing with a second grader. And the second is the strongest human player.
For connoisseurs of chess. Here is an analysis of some batches of Alpha Zero vs. Stockfish.from the Russian grandmaster Sergey Shipov. And to be honest, we were impressed.
Alpha Zero and Stockfish: what is the differenceAs for chess, neural artificial intelligence has already surpassed man and his older machine brothers.
Stockfish was the strongest computer chess program until Alpha Zero humiliated it.
It is noteworthy that Stockfish for a second analyzed 70 million positions, and Alpha Zero - only 40,000, which he considered promising by the Monte Carlo method.
That is, the neural network does not evaluate every single move, but the sum of the totals of the draws of the moves, while cutting off the draws that lead to a losing position.
As a result, Alpha Zero spent 99.99% less resources on analysis.
As a result, Alpha Zero won 28 out of 100 games, 72 finished in a draw and did not lose any.
But this in fact concerns a closed system with a small, defined initial set of rules.
Now let's deal with the language system.
Neural Artificial Intelligence and Translation
We are well aware of the brainchild of Google in the field of translation - Google Translate.
So, Google Translate with translations works a little differently from Alpha Zero with chess. In chess, the system analyzes individual move complexes, which lead to the most advantageous result. For transfers, however, a bi-directional network is used. One stream divides the original sentence into semantic elements, and the second reproduces them in the correct order in another language.
Something like this happens. The proposal is divided into components. And the word is not the smallest component, because the meanings of the word are considered as a deeper level.
The resulting constituent elements are analyzed by meaning using algorithms - that is, the most self-learning hidden layers. The proposal is analyzed first in parts, then all together and even in the opposite direction. After all, for example, in German the particle “nicht” at the end of a sentence radically changes its whole meaning.
Schematic representation of the process. Each layer of algorithms analyzes the sentence in different configurations, and then “collects” from the received meanings a sentence in a different language, taking into account its grammatical features.
But if everything is clear with chess, then the language is a more flexible system in the rules, which also allows for the translation of sentences that are exact not only "by letter", but also "by spirit". That is, a translator can consciously sacrifice the accuracy of a literal translation in order to convey the meaning more deeply.
Literary translation of poems
A typical example is the translation of poems. Indeed, it is almost impossible to translate even one stanza so as to preserve at once the rhythm, the arrangement of words, and the full meaning.
There simply cannot be uniform algorithms, because often you have to radically alter the verse in order to convey its real meaning.
Of course, translation of poems is one of the most difficult areas of linguistics, but neural networks have already shown themselves to be the best in accurate calculations, so we will start with the most complex.
For example, take the second sonnet of Shakespeare. Alternately, we give the original text, the translation by S. Trukhtanov (we chose this option from many purely subjective) and the translation from Google Translate.
When forty winters should besiege thy brow,
Dig deep trenches And in thy beauty's field,
Thy youth's proud livery, so gazed on now,
Will be a tatter'd weed, of small worth held:
Then being ask'd where all thy beauty lies,
Where all the treasure of thy lusty days,
the To say The, Within of thine own deep-the sunken eyes,
Were an all-eating shame and thriftless praise.
Much more praise How deserved thy incorporation beauty beauty's use,
the If thou the couldst? Answer «This fair child of mine
Shall sum up my count and the make up my old excuse,»
Proving a His beauty beauty by succession of thine!
Were the BE to the this new made the when thou the art old,
And see thy incorporation warm blood the when thou the feel'st IT cold.
As you can see, English is obviously outdated here - there is even a single number of the second person, which is not used in modern English. And this complicates the translation even more.
In general, we will not pull and just see the difference between human and machine translation:
And honestly, this is not the best performance of Google. Perhaps this is why adherents of machine translations are embarrassed when they are asked whether their algorithms will work with verses. After all, even the vaunted Google Translate doesn't even cope with this.
Literary translation of prose
If so, try something simpler. Art prose. The Great Gatsby Fitzgerald.
"with In up my younger and more vulnerable years up my father Gave me some advice I of've Been That turning over in up my yet Mind the ever since.
“Whenever you feel like criticizing any one, you’ve had it.”
Now let's compare human and machine translations. As a defender of humanity, we took the translation of N. Lavrov.
Lavrov's translation does not exactly correspond to the original. There are changes in the arrangement of phrases, the sentences are somewhat more extended than in English. But in general, the impression is harmonious, the meaning and mood are transferred completely.
Machine translation is more accurate in terms of mechanics - the sentences are translated exactly as written in the original. The meaning is quite good, but there are problems with “you-you” and everything sounds rather clumsy.
In literary translations, you can sacrifice some accuracy for the sake of harmoniousness or harmonious phrases. Human translators use this, even too often, but the car does not.
So, what is next?
True, for the sake of justice, it is necessary to mention that the technical texts, where the literal accuracy of the translation is important, Google Translate translates perfectly and practically without errors. But those characters who claim that the translators will be left without work in 5-10 years can be safely sent on a long foot journey.
Existing processors and data processing algorithms can handle systems that have a limited set of rules. Chess or go - just like that. But with flexible versions of systems like languages, where the boundaries of the rules are blurred, the program has to build on unnecessarily complex algorithms that work far from perfect.
It is possible that the algorithms just need more time to learn to work with languages accurately. Well, we will do our work further and half-heartedly monitor the success of neural networks in this field.
But for now, do not rely on artificial neural networks - learn English and develop your own.
EnglishDom.com - online English learning platform
Pimp your conversational English on online courses from EnglishDom.com. The link - 2 months subscription to all courses as a gift.
And for live communication, choose learning via Skype with a teacher. The first trial lesson is free, register here. The promo code goodhabr2 - 2 lessons as a gift when buying from 10 lessons. The bonus is valid until 05/31/19.