Home web3.0 Working with AI: Code Conversion

Working with AI: Code Conversion

Nov 06, 2024 pm 09:12 PM
AI Cracking the code

Not too long ago, it wasn't possible for LLMs (Large Language Models) to rewrite code. Each LLM has a token limit, which establishes how many words it can absorb and apply. With lower token limits, the models are unable to absorb the amount of information required to perform complex tasks like code conversions.

Working with AI: Code Conversion

Software development company Mantle recently faced a common challenge: they had built a next-generation equity management platform prototype in a specific coding language that was perfect for speedy interaction in response to feedback from customers.

However, the code used in their production tech stack was different, and to ship the product, Mantle would need to convert the codebase from one language to another. This is a notoriously onerous task that is regularly faced by software teams and enterprises.

“The effort is justified, but the process is painful,” said Dwayne Forde, Mantle co-founder and CTO. “Instead of moving a customer-facing roadmap forward, you are now going to spend a significant portion of valuable engineering time recreating existing functionality.”

Wondering if AI could help, Forde—a trusted industry leader with more than 20 years of engineering experience in roles with companies including VMware and Xtreme Labs—chronicled the process recently in a blog post on Mantle called “Working with AI: Code Conversion.”

He hopes the case study will serve as a useful resource to other tech teams, helping them save time and effort.

It is the second in a series of instructional guides Forde has written for technical teams, as part of an effort to advance the collective interests of the sector by showing how AI can accelerate and enhance their work.

“Our goal wasn’t to achieve 100% perfectly crafted code,” Forde noted. “The goal was to get 80% of the boilerplate and repeated patterns out of the way so that engineers could focus on high-value validation and verification and we could ship the product.”

Not too long ago, it wasn’t possible for LLMs (Large Language Models) to rewrite code. Each LLM has a token limit, which establishes how many words it can absorb and apply. With lower token limits, the models are unable to absorb the amount of information required to perform complex tasks like code conversions.

But with rapid advancements in LLM software came higher token limits, and Forde realized his team had exciting new options in front of them. Higher limits meant that models could increase their reasoning, perform more complex math and inference, and input and output context in dramatically larger sizes.

One million tokens means, according to Medium, that a model can do the equivalent of reading 20 novels or 1000 legal case briefs.

Forde and his team understood that this dramatically larger token limit would allow them to feed entire coding languages into an LLM, essentially teaching it to be bilingual.

Because converting code is extremely labour-intensive, Mantle knew that having an LLM convert even small amounts of code from one language to another would be hugely beneficial to the delivery time of the engineering project.

“We developed an approach that reduced the scope of work by two-thirds and saved months of developer time,” Forde wrote in his post.

Converting the Mantle prototype project into a new code language would have normally taken months of manual labour.

Instead, Forde said his engineers focused their time experimenting with how to best prompt an LLM to do much of the work for them.

It wasn’t just as simple as feeding the code languages into the LLM and asking it to translate.

Under Forde’s watch, the Mantle team went through a process of innovation and discovery to figure out the best instructions, context and guidance to provide the LLM in its work.

They fed the model code snippets from their prototype source language, as well as existing production code patterns, descriptions of their target architecture, and provided the LLM with context about specific libraries and utilities used in Mantle’s own tech stack.

“We have certain libraries that we prefer, so adding a section of context was very helpful to make sure the LLM output code was compatible with what we use,” said Forde.

The team even fed the LLM screenshots to demonstrate how they wanted the information to be presented, something that would not be obvious to AI from the code language alone.

“Screenshots of the existing application give the LLM a visual layout of the application,” said Forde. “The context and direction you provide don’t have to be all verbal. You can use visual reference points as well to get the output you’re after.”

In his blog post, Forde breaks down the step-by-step process Mantle used to convert their code. The process is innovative, iterative and – at times – playful.

At one point, the Mantle team instructed the LLM to “act like a software engineer who could only answer in source code.”

The Mantle team asked the LLM to convert only small sections of code at a time, checked its work, corrected any misinterpretations, and then moved on.

The step-by-step experimentation allowed the Mantle team to refine and improve its work over time, and create an effective process that can now be replicated in future projects.

“Once the file was generated, our team either reviewed and adjusted the output manually or adjusted the

The above is the detailed content of Working with AI: Code Conversion. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Intel Markets (INTL) Could Be the Crypto of the Year as Cardano (ADA) Holders Diversify Ahead of Hard Fork Intel Markets (INTL) Could Be the Crypto of the Year as Cardano (ADA) Holders Diversify Ahead of Hard Fork Aug 25, 2024 am 03:49 AM

The crypto market is undergoing a significant sentiment shift as sidelined capital starts to take entry. Projects like Near Protocol (NEAR) and Cardano (ADA) are heating up in anticipation of the upcoming rally.

Shytoshi Kusama Hints at Forthcoming Collaboration with AI Project NFA Labs Shytoshi Kusama Hints at Forthcoming Collaboration with AI Project NFA Labs Aug 09, 2024 am 06:27 AM

Shytoshi Kusama, the enigmatic figure leading the Shiba Inu ecosystem, has sparked speculation about a forthcoming collaboration with an AI project.

Coinbase and Tether Unveil AI-Powered Platforms to Empower Developers in the Blockchain Space Coinbase and Tether Unveil AI-Powered Platforms to Empower Developers in the Blockchain Space Oct 29, 2024 am 03:24 AM

Coinbase's “Based Agent” platform and Tether's Local AI SDK aim to simplify the development of AI-driven cryptocurrency agents.

Apple AI Will Be A Game-Changer, AI Coins Rally Likely Next Week Apple AI Will Be A Game-Changer, AI Coins Rally Likely Next Week Sep 09, 2024 am 03:15 AM

Apple is all set for the iPhone 16 launch on Monday, gearing up for a major push to generative AI by introducing it to its consumers of iPhones

Firecoin Raises $1.2M to Bring AI-Powered Token Insights to the TON Ecosystem Firecoin Raises $1.2M to Bring AI-Powered Token Insights to the TON Ecosystem Oct 25, 2024 am 12:12 AM

Investing in the crypto market can be extremely lucrative, with new tokens occasionally making upward of 160,000% in yearly returns for investors.

Sui (SUI) and GoodEgg (GEGG): Two Promising Projects to Watch in September's Cryptocurrency Market Sui (SUI) and GoodEgg (GEGG): Two Promising Projects to Watch in September's Cryptocurrency Market Sep 12, 2024 pm 09:01 PM

As the cryptocurrency market faces fluctuating trends, savvy investors are beginning to shift their attention toward emerging projects that demonstrate resilience and growth potential. With concerns over Bitcoin's (BTC) volatile price trajectory foll

Despite 'Dead Coin” Narrative, Cardano (ADA) Maintains Top-Ten Position, Explores AI Integration Despite 'Dead Coin” Narrative, Cardano (ADA) Maintains Top-Ten Position, Explores AI Integration Aug 17, 2024 am 06:41 AM

In recent months, Cardano [ADA] has faced criticism, with some labeling it a “dead coin” due to its price trends. However, despite this negative

Launchpool Incubates ONAI, an AI Ecosystem Based on the TON Blockchain Launchpool Incubates ONAI, an AI Ecosystem Based on the TON Blockchain Aug 05, 2024 pm 03:32 PM

This partnership signifies a crucial advancement towards integrating commercial AI agents and automation into the Web3 space.