by davidatbu · 4y ago · 0 comments
Copilot is based on OpenAI Codex, which is based on GPT-3, which is a transformer model.
Although technically, transformers are mostly GNNs that are "fully connected" (in the graph theory sense), I don't think that supports your speculation here about how GNNs could be used for code analysis since the "tokens" that GPT-3 is trained on are not programming-language syntactic constructs, but sub-word units obtained from natural language (something like WordPiece).
I will say though, I am equally excited by the exact prospect you raised of using something like GNNs for code analysis.
My hunch is that if somebody can figure out a way to make training hierarchical/graph based neural networks very fast, we'll observe the same gains that we did with transformers. But hierarchical/graph based models don't lend themselves to efficient computation.
Definitely check them out! There are also tools that were made available by some of the authors: https://github.com/google-research/python-graphs
Unfortunately, GNNs are lagging LLMs in the code domain. Maybe because
a. LLMs and transformers rulezz OR b. there is far more source code than there are compiled code graphs