IBM Launches AI-Based IBM i RPG Code Assistant Project
IBM i CTO Steve Will on the launch of IBM's initiative to use AI to modernize RPG code
![Steve Will You and i blog](https://techchannel.com/wp-content/uploads/2024/02/Steve-Will-You-and-i-Hero-1024x576.jpg)
This blog post marks the official starting point for information about the RPG Code Assistant (RPGCA) project. For those who just need links to the key information which exists right now, I’ll start with those. After those details, I’ll give you more context—everything starting with the subhead “Background: How We Got Here.”
IBM i RPG Code Assistant Project Detailed Materials
- IBM i & AI: Strategy & Update: This webcast, delivered July 10, 2024, provided an overview of the IBM i strategy as it relates to AI in general, and then described an overview of the RPGCA project. I’ll be covering the same material in this blog post, but if you want to see the video and a PDF of the charts I used, start at the “IBM i Guided Tours” hosted by COMMON and then click the content tab to find “IBM i & AI: Strategy & Update”—click that and find the recording and PDF.
- Note: A follow-on webcast was done July 17, 2024. In this webcast, Edmund Reinhardt showed details of how to use GitHub to submit code for training, if you choose to participate in that way. The recording for that webcast will appear on this same COMMON site a few working days later.
- AIforIBMi@ibm.com: If you want to contribute code, and/or want to volunteer to do some work on this project, send an email to that address. One of our team will be in touch to give you more information and to get you to sign the agreements you’ll need. We must have a signed license agreement so we can use your code for training, and we need you to have a non-disclosure agreement for the confidential plans you’ll hear about as we work on the project.
- https://ibm.GitHub.io/rpg-genai-data/#/: This is the link to the GitHub repository where we’ll be collecting submitted training material, which can include code and other things. You’ll have the opportunity to submit your code “publicly” so that other participants in the project can see it and so that it can ultimately be released when we’re done using it internally. But you can also submit your code “privately” so that your code won’t be distributed/disclosed once it has been used for training. The overview of this was in the July 10 webcast and the details are documented on the GitHub site, but are also described in the webcast Edmund did on July 17.
- https://techchannel.com/contributor/steve-will/: This is how you find my blogs on TechChannel. I will be posting updates about this project from time to time. While I’ll share some updates on other social channels, I’ll try to post here when major decisions or checkpoints need to be communicated.
- LinkedIn and X (formerly Twitter): Speaking of “other social channels,” I have been using LinkedIn and X (formerly Twitter) for years. I will likely be updating using those channels more frequently than I will in the blog. Look for me, and follow me:
Background: How We Got Here
At COMMON’s POWERUp conference in May 2024, I spoke about a new project IBM is undertaking–something we’ve been calling the RPG Code Assistant or RPGCA for short. You may have seen me talk about it there or at COMMON Europe Congress or at the June IBM i Large User Group meeting. Or maybe you saw the Guided Tour that I mentioned above. Or, you might have read about it on TechChannel after they did an interview with me. Or maybe you listened to one of the podcasts I was on. Or maybe, like so many people, you heard second- or third-hand that there is something happening, but haven’t had a chance to get the details. You can get many of the details from the links I posted above, but I find myself wanting to tell the story here so you have more context and explanation. So, let’s get started.
AI and IBM i: Addressing RPG Skills
In 2023, a new offering for the IBM Z client base that generated a great deal of excitement was introduced. It also raised many questions from IBM i clients! And those questions quickly found their way to me, my team and pretty much anyone in the IBM who has anything to do with IBM i.
What’s the offering? It’s known as IBM watsonx Code Assistant for Z. What does it do? According to its website, it is “a generative AI-assisted product built to accelerate mainframe application modernization at lower cost and with less risk than today’s alternatives.”
Oh! OK! An AI tool for modernization of applications on Z. Let’s look a little deeper. It says, “Developers can automatically refactor selected elements of an application and continue modernizing in COBOL, or selectively transform code to Java. …”
The emphasis in that last quote is mine, because that’s the part that gets IBM i people thinking. And asking.
“Will there be an ‘IBM watsonx Code Assistant for IBM i and will it transform RPG to Java?”
Those are two different questions, to be honest, but the thing I want to specifically address today is the topic of transforming RPG to Java.
I completely understand why people would make this leap, but I’d like to step back and look at the real requirement here.
Our IBM i community clearly knows that there is a “skills issue” related to IBM i in general, and RPG in particular. A look at the Fortra survey results makes it clear year after year that IBM i Skills is one of the top 5 concerns. And when we talk to clients, the biggest IBM i development skill they’re talking about is the need for RPG programmers.
We’ve known that’s true, and we’ve done many things to help clients address it—most importantly, transforming RPG into a free-format, modular language which can be written, debugged and maintained using the kind of modern tools used by programmers of other very popular languages. We’ve also worked on creating tools and working with the community to develop tools to allow new programmers to work with RPG more easily. And we’ve been successful, to a point. As the Fortra survey shows, and as our interactions with customers reinforce, there are many of our clients using modern free-format RPG as part of their solutions while also using open-source options such as node.js, PHP and more.
A core principle of our strategy around RPG is to assist customers to modernize to the best possible outcome, which includes allowing them to hire developers who do not know RPG, but who can pick up the language in its modern form, using modern tools and who can also use other programming languages they know to make the best use of all their skills. This allows customers to get value out of RPG doing the things it does best–high performance business process logic, working with SQL and Db2—while creating blended solutions which contain components written in other languages or provided as services somewhere on IBM i or in a cloud. In this strategy, RPG remains a key programming language in the future of IBM i and development of applications on IBM i.
The net of all this, in the context of the application of AI to the RPG skills need is this: IBM does not plan to create an AI-based tool with a goal to convert RPG to Java. But we do want to use AI to augment the abilities of developers. So, what are we going to do?
Using an AI Tool (RPGCA) to Help RPG Developers
After discussions with many experts in the IBM i RPG community and taking into account the things that current AI technology can do, what IBM believes is most needed is an RPG Code Assistant that can help clients deal with the huge portfolio of existing RPG code and enhance the modernization and development tools that already exist. In late 2023, we, in the IBM i development team, began laying out our goals for an AI-based RPGCA.
While we were doing that, a team of IBMers (not in the IBM i development team) trained a large language model (LLM) to understand RPG! It was a relatively short-term project, which was created for a customer who paid them. And the resulting model, while certainly not a full product, proved to all of us that the key functions we want to deliver in Code Assistant for RPG are possible. It was, in essence, our proof of concept (PoC).
So, what are we envisioning RPGCA should be able to do?
4 Functional Goals for Code Assistant for RPG
1. Explain: The biggest need expressed by our clients is to be able to deal with the massive volume of existing code, so the first key function is “Explain.” That is, the tool should be able to look at an existing piece of RPG and then explain, in English, what the code is doing. I hope the usefulness of this is obvious, but just in case:
Often the first step in creating a new feature in existing code is to look at code that was written by someone else, perhaps a long time ago, and perhaps without much internal commenting or documentation. Whether you know RPG or not, having a tool that helps explain the code would reduce the amount of time a developer needs to spend doing analysis and design before writing an enhancement that relates to the code. And this is most beneficial if the developer is new to RPG.
The PoC mentioned above does a decent job at explaining. We want something even better than that for a general purpose RPGCA.
2. Generate: One of the reasons AI has become such a hot topic, is the ability of LLMs to create or generate on their own. With the availability of LLMs like ChatGPT, the public was finally able to ask an AI to write term papers, summarize knowledge on a topic, generate images and so on.
In the context of an RPGCA, we’d like a developer to be able to ask the RPGCA to write code, using a combination of English and SQL. For example: “Given the table PAYROLL defined by the SQL below, generate a free-form RPG LE procedure that. …” And RPGCA would produce the code. You might use that code as the model for some enhancement you’re doing, or it might be good enough to just drop into your project.
Again, the PoC does produce RPG. Most of the time. If you ask it "nicely"—that is, in the way it was trained to understand. It's a good start. The PoC proved it can be done.
3. Convert: While it’s true that the majority of new RPG being written is done in free-format ILE RPG, it’s equally true that most of the RPG currently in use is written in earlier forms of RPG. Tools that transform older RPG into modern free format ILE RPG exist in the market exactly for this reason—to help clients with older RPG move forward.
Well, it turns out that if you train an LLM to be able to explain RPG, especially if you train it with both older RPG and more modern RPG, it “naturally” becomes able to do some amount of “transform old to new” on its own. If you work specifically to train that behavior, it becomes even better at it. Sure enough, the PoC can do a decent job at it. We see the value of this, as do other vendors, but we see this as a good jumping off point if we want to do transformations which have been hard, impossible or neglected: S/36 RPG, old style date definitions, etc. And, as I said, if the RPGCA can explain old RPG and new RPG, the core of this function is a natural outcome of the training.
4. Generate test code: This function might not seem like something we would attempt early. We can all see the value, of course. Part of today’s recommended code development process is to write repeatable test suites which can be run during ongoing development, so it would be excellent if a development team could direct RPGCA to “generate a unit test program for the following RPG code.”
Still, I’m not sure I would have put that function in my list of initial tasks we wanted for RPGCA—except that the PoC could do it! And when we described this capability to our IBM i RPG Champions, many of them were very excited about the extra value this would provide to our community. So, it’s become an expected function in RPGCA.
So Why Not Just Sell the PoC as RPGCA?
One of the issues with the PoC and other LLMs that can try to explain, generate and transform RPG code is that they were all trained with a fairly small set of RPG. They had to rely on RPG code available in GitHub. Other programming languages can be trained fairly extensively using open-source code written in those languages and stored in GitHub with licenses that clearly allow the models to use the code for that purpose. But when it comes to RPG, there is far less of it available. Consequently, while the PoC is good as far as it could go, if we want to create a more fully functional, accurate and reliable, more trustworthy and “transparent” tool, we need to address a few things, and one of those is getting more good RPG code–and related information–for training the LLM that underlies the RPGCA.
There are also many things needed for a full offering, beyond simply a trained LLM, but for the moment, let’s focus in on getting more RPG training material.
We Need IBM i Community Involvement
One “asset” we have in the IBM i community is the IBM i community!
When we realized that the PoC had been limited in the material used to train the model, we immediately thought about all the amazing IBM i Champions who are skilled in RPG and in using RPG in modern development projects. We also knew that many of our passionate users have a vested interest in helping IBM i in general, and RPG in particular, remain vital in the future. We were quite confident that we could reach out to the IBM i community and get volunteers to help.
And wow, did we!
In preparation for the COMMON POWERUp keynote talk, where I first described the RPGCA project in public, I spoke to many IBM i Champions and explained what we wanted to do. I also asked for them to provide us training material–RPG examples, descriptions of RPG they had used to teach people, etc. They were all enthusiastic in their desire to help. And, since most of them work for themselves, they could assure us they could contribute the code without any fear of their work being Intellectual Property owned by some other business. You’ll likely recognize most of the names. I listed them in the webcast, but for starters, these IBM Champions offered their advice and help: Susan Gantner, Jon Paris, Scott Klement, Jim Buck, Paul Tuohy, Niels Liisberg, Hideyuki Yahagi, Yvonne Enselman, Mats Lidström, Koen DeCorte and Steve Bradshaw.
Additionally, as you might imagine, I also talked to some clients and partners about this project. Many have offered to contribute their own business code, if it would help. Some of them are fine with contributing the code openly. There are ISVs, for example, who give their source code to anyone who buys their solution. Some of these ISVs are willing to contribute most of their code knowing that others working on the project can see it and knowing that their code will ultimately be put in a public GitHub repository. But some customers—and I have several banks among this group—are willing to give large parts of their code to this effort, if we can promise them it will only be used to train the model, but never be made public. Imagine that!
With the help of these Champions, and the people who have already contacted us by sending an email to AIforIBMi@ibm.com, we’re going to have far more training material than earlier LLMs had. Plus, IBM is also contributing training material from the RPG manuals, presentations and test suites we have produced over the years.
This Is The Beginning of Using AI to Modernize RPG Code
This post serves as a good beginning. It allows me to explain what our goals are, why we’re working towards those specific goals, and at a high level, how we’re organizing part of the work. It’s my hope that this helps those of you who contacted me, or were thinking of contacting me, with some form of the question, “How is IBM going to use AI to help all of us who have RPG code?”
Inside IBM, we’re discussing the best path forward for IBM and for IBM i clients. Everyone can see the value of creating an AI-based tool that augments existing tools. Everyone agrees we, in IBM i development, are going to benefit from the help and passion in the IBM i community as we take future steps. Exactly when something will be available, and in what form, and at what price–these are still unknown.
So, watch this space. And watch for news from my social channels and interviews and webcasts and podcasts.
This is an exciting time to be in IT. Throughout the industry, we’re selecting from the many ways AI can move technology forward. I’m grateful to be doing so with the help of an amazing team in IBM, and with the interest, passion and support of the IBM i community.