12

I have been looking into Viv, an artificial intelligent agent in development. Here is a demonstration of Viv (by Dag Kittlaus).

Based on what I understand, this AI can generate new code and execute it based on a query from the user.

What I am curious to know is how this AI can learn to generate code based on some query. What kind of machine learning algorithms are involved in this process?

One thing I considered is breaking down a dataset of programs by step. For example, here is the code to take an average of 5 terms

  1. Add all 5 terms together
  2. Divide by 5

Then I would train an algorithm to convert text to code. That is as far as I have figured out. However, I haven't tried anything because I'm not sure where to start.

Does anybody have any ideas on how Viv is implemented?

Faizy
  • 1,144
  • 1
  • 8
  • 30
N. Chalifour
  • 161
  • 2

1 Answers1

1

4 years and 6 months have past since your unanswered question.

That is an eternity in terms of Machine Learning and things have evolved a lot. So I will answer about the present, not the past.

Today, there are some code generating models, like GitHub Copilot and OpenAi Codex which are based on NLG (Natural Language Generation). The principle is very simple:

  1. Make a huge (billions of parameters) model to predict the next "word" (token) in a sequence of text.
  2. Train that model with all available data you can find, and it will understand our language and all kinds of concepts, from philosophy to medicine (that's a GPT).
  3. Then you fine-tune it to perform well in programming code, specially in a database filled with code comments.

And now you have a highly capable model for code prediction (generation) from a comment (imperative natural language query).


There are also other AI strategies for code prediction, like https://www.tabnine.com/

Andre Goulart
  • 874
  • 3
  • 25