One of the primary drivers of research in Artificial Intelligence (AI) has been to create AI systems that can build viable and powerful computer programs to tackle complex business challenges. Recent developments in this area especially the rapid strides made by Large Language Models (LLMs), have brought about this radical shift in thinking. LLMs were originally developed for comprehending natural language but now they have taken machine intelligence to another level. LLMs can now create code and text, setting a new bar for AI development.

Until now, LLMs have been reasonably proficient in handling routine programming tasks. However, they often falter when confronted with complex programming challenges. One of the major stumbling blocks in their use for solving programming problems has been their tendency to generate code blocks as monolithic entities instead of breaking them down into granular, logic-based code blocks with specific functionality.

CodeChain from SalesForce AI

Human developers on the other hand are easily able to create modular code when dealing with complex problems. They tap into their knowledge base of pre-existing modules to accelerate the development of solutions to new problems.

Salesforce Research recently introduced CodeChain, a cutting-edge AI framework to bridge this gap. CodeChain leverages a series of self-revisions driven by sub-modules created in earlier iterations to streamline the process of creating modular code. At the core of CodeChain lies the methodology of enabling LLMs to approach problem-solving to create logical subtasks and reusable sub-modules.

There are two iterative phases in the sequence of self-revisions in CodeChain.

Sub-Module Extraction and Clustering: In this phase, sub-modules are identified by analyzing the code generated by the LLM. Next, these sub-modules are organized into clusters. From each cluster, representative sub-modules are selected which are identified to be more widely applicable and reusable.

Prompt Enhancement and Re-Generation: The initial chain-of-thought prompt is further improved and regenerated by integrating the selected representative modules from the previous phase. Next, the LLM is asked to produce new modular code solutions once again. This way, the LLM can leverage the information and understanding from earlier iterations to enhance them further.

CodeChain has already been shown to have a significant impact on code generation. Salesforce has indicated that by asking the LLM to enhance and reuse pre-existing sub-modules, the modularity and accuracy of generated solutions are greatly improved.

Comprehensive studies have been conducted to investigate deeper into the factors that contribute to CodeChain’s success. These investigations look at aspects like prompting technique, LLM model size, and code quality. The insights from these studies reveal why CodeChain excels in improving the quality and modularity of code generated by LLMs, making it a potential game-changer for AI-powered code generation.

CodeChain leverages chain-of-thought prompting to generate modular blocks of code which drives natural selection of the LLM to select parts of the generated solution for reuse and refinement.

CodeChain’s release by Salesforce AI marks a key milestone in AI-powered code generation. Its ability to boost modularity and accuracy, along with significant improvements in pass rates indicates a giant leap forward. This disruptive framework is poised to transform the programming landscape, empowering businesses to quickly build and deploy effective solutions.

Introducing CodeGen: Turning Prompts Into Code

The Salesforce Research team recently announced the launch of CodeGen – a new LLM that leverages conversational AI to generate accurate and modular code.  

With CodeGen from Salesforce, both programmers and business users can use natural language prompts to define what they want the code to do such as build an app that throws up the last customer interaction. The LLM translates those prompts into code, effectively creating an app using just written instructions.

With CodeGen’s conversational AI capabilities, business and technology teams can eliminate the time and resource-intensive process of building apps from scratch. CodeGen empowers programmers to build apps quickly without much coding, freeing up more time for complex tasks that necessitate a human touch.

The CodeGen Solution

In simple terms – with CodeGen, all you need to do is describe what you want your code to do in natural language and the machine will write executable code for you. This is the next generational promise of conversational AI programming from CodeGen. It makes coding as easy as talking.

Here’s an example to illustrate the power of CodeGen.

When you want to eat a certain dish for dinner, you need to know all the ingredients required to make the dish want and then you have to cook it yourself. You need to know the serving size, the proportion of each ingredient, and the steps to follow.

Now, let’s say you go to a restaurant powered by CodeGen.

You just tell the server what dish you want, and they prepare it and serve it to you. Just describe the dish you want in a short sentence, and it will be served to you without any involvement from you in its creation. You don’t need to specify any ingredients or explain the steps involved in cooking it or provide any other associated instructions. You don’t even need any knowledge of any culinary terms either.

The restaurant kitchen behaves like an intelligent entity, converting your plain sentence into a sequence of steps that takes all the ingredients, in the most appropriate proportion and creates the outcome (in your case the dish you asked for).

Now imagine, instead of a meal you are “ordering” an app that can perform certain functions. That’s the basic idea behind CodeGen.

Salesforce’s implementation of conversational AI programming highlights its commitment to an inclusive approach to software programming to bring it to the masses. AI translates natural language descriptions into fully functional and executable code empowering anyone to build apps even if one has no prior knowledge of programming. According to Salesforce, CodeGen, their LLM which powers conversational AI programming will soon be available as open source to accelerate research.

The launch of CodeChain from Salesforce AI is a landmark event for innovators around the globe. With its ability to improve code modularity and accuracy, it can empower IT teams to dramatically accelerate problem-solving.  This disruptive framework is poised to transform the way we approach and solve business problems. To learn more about AI-powered code generation, contact Girikon, a Gold Salesforce Consulting Partner today.

About Author
Indranil Chakraborty
Indranil is a technology enthusiast with over 25 years of experience in project management, operations, technology and business development. Indranil has led project teams in egovernance, business process re-engineering, product development and worked with Government and Corporate customers. Indranil truly believes in the power of technology to drive productivity and growth for teams and businesses.
Share this post on: