Facebook’s AI Transcoder

--

Introduction:

As we have seen many applications of artificial neural networks that allow us to build a model of non-linear processes and it also has turned into an effective tool to solve many problems such as clustering, classification, regression, pattern recognition, structured prediction, machine translation, dimension reduction, decision making, anomaly detection and more. These applications make it possible to use artificial neural networks. In this article, you will get to know about Facebook’s AI transcoder which is developed by the reachers of Facebook and named it “Neural transcompiler”.

What is a Neural transcompiler?

It is an AI transcoder that converts the code from one programming language to another.

It is an AI-based system that converts the code from high-level languages like C++, and Java and python into another. It comes under unsupervised learning in which there is no prior data/pattern has given, meaning that it looks for previously undetected patterns in data sets without labels. It gives a rule-based outcome with the help of a significant margin and without any supervision of a human.

To relocate the existing code file to a modern or useful language such as java or c++ is often costly and tough work as it requires source code and the target language.

The researchers of Facebook told that the commonwealth bank has spent its $730 million to changed its platform form COBOL to java. If this type of transcoder was available at that time they didn’t need to rewrite the code from scratch and to spent these much of money but that was not so easy as each programming language has its syntax and relies on different APIs.

How does this transcoder work?

Facebook’s system the transcoder that translates between the programming languages c++, java, and Python and finds out the solution without any labeled data. This transcoder is firstly initialized with the cross-lingual language. The cross-lingual language is used for natural language processing tasks. This is using for both approaches supervised and unsupervised. For instance, for unsupervised German-English machine translation and supervised Romanian-English translation, we have new precision marks. Now it this cross-lingual is used for transcoder to convert the programming languages from one to another.

This cross-lingual language pretraining model maps the small parts of code that expressing the same instructions without caring about the programming languages. This method is called auto encoding that trains the system with noisy data also.

The cross-lingual method of transcoder starts from the number of common tokens such as “for”, “while”, “if”, “try”, catch, and digits, mathematical operators, characters, booleans0, string, that are generally used in any programming languages.

This transcoder follows two translating method

  1. Source to the target
  2. Target to the source.

Source to target: This method helps to reconstruct the target from the noisy data that we have fed to the model.

Target to the source: This method is used to translate the sequences into the source language.

The transcoder is trained on a public GitHub that is available over 2.8 million source repositories that are written by the researchers of Facebook. and the researchers have extracted more than 852 parallel functions of python, C++, and java from the very popular free programming learning site geeks for geeks. After sending the source code to the transcoder the researchers have noted down the computational accuracy of this AI transcoder. The model gave different accuracy with the different sources and target programming languages that have given to the transcoder.

1 The accuracy is given by the transcoder when the source language is C++ and the target language is java. (Accuracy = 74.8%)

2 The accuracy is given by the transcoder when the source language is C++ and the target language is python. (Accuracy = 67.2%)

3 The accuracy is given by the transcoder when the source language is java and the target language is c++. (Accuracy = 91.6%)

4. The accuracy is given by the transcoder when the source language is python and the target language is java. (Accuracy = 56.1%)

5. The accuracy is given by the transcoder when the source language is python and the target language is C++.(Accuracy = 57.8%)

Conclusion:

The transcoder shows the understanding of the syntax that is very specific in each programming language and also their data structures, functions, and structure of code blocks and also small modification like if you need a variable in the input was renamed.

The transcoder can easily be used for any programming languages and it doesn’t require any expert knowledge and commercial solution in a large margin. If any type of problems made by the model it can be solved by adding a simple decoder or with the help of dedicated architectures to ensure that are generalized methods are syntactically correct.

Artificial Intelligence is the greatest technology that is exponentially increasing provide job opportunities. As we have seen facebook’s AI transcoder there is more application that is introduced by the other MNCs also. I urge you to expand your knowledge in fields like AI and data science with the help of Learnbay, As now is the best time to invest focus and potential on being prepared for the world of AI.

--

--

Learnbay.co — Data Science Training in Bangalore

learnbay.co Provides Data science and Artificial Intelligence Certification Course for working professionals with Real Time Project and Job Assistance.