Using language models for code generation works better when limited to a specific domain
Using language models for code generation works better when limited to a specific domain

Using language models for code generation works better when limited to a specific domain

Automatic code generation has always been an integral part of programming: compilers, synthesis tools, convertors, etc. are examples of classic code generators. Now, with such powerful LLMs at hand, it is only natural to try to find new ways to generate codes. The question is: are LLMs the right tool for code generation?

There are two sides to code generation: (1) understanding the intent (a.k.a. capturing the spec) (2) writing the code. LLMs are great for (1), but not so good for (2).

This is an example of using LLM for general-domain code generation:

https://github.com/RoboCoachTechnologies/GPT-Synthesizer

You can see that the main focus here is to properly capture the spec, and that's where LLMs shine.

LLMs solution for a general-domain code generation may not be complete or optimized. It is always easier to break the problem and solve code generation in a specific domain. Here you can see how much better and cleaner the output of code generation can be when it is limited to a specific domain (robotics domain, ROS in particular, in this case):

https://github.com/RoboCoachTechnologies/ROScribe

What are your thoughts on using LLMs for code generation?

submitted by /u/RoboCoachTech
[link] [comments]