DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Securing AI/ML Workloads in the Cloud: Integrating DevSecOps with MLOps
  • Architecting AI-Native Cloud Platforms: Signals to Insights to Actions
  • AI-Based Multi-Cloud Cost and Resource Optimization
  • How to Build the Right Infrastructure for AI in Your Private Cloud

Trending

  • Context Is the New Schema
  • Building a Skill-Based Agentic Reviewer with Claude Code: A Practical Guide Using Skills.MD, MCP Servers, Tools, and Tasks
  • Why AI Forces a Rethink of Everything We Know About Software Security
  • Java Backend Development in the Era of Kubernetes and Docker
  1. DZone
  2. Data Engineering
  3. AI/ML
  4. Using AI and Machine Learning To Create Software

Using AI and Machine Learning To Create Software

I started implementing OpenAI into Magic. It took me no more than two days to teach it Hyperlambda to an accuracy of 90%. What does this mean for our industry?

By 
Thomas Hansen user avatar
Thomas Hansen
DZone Core CORE ·
Jan. 12, 23 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
5.1K Views

Join the DZone community and get the full member experience.

Join For Free

I've just released a new version of Aista Magic Cloud that allows you to use natural language to create Hyperlambda backend code, and its accuracy is at 90% after only two days of experimenting with the thing. To appreciate this feat, I suggest you watch the following YouTube video.

The way it works is that you start out with a base model. I found Curie to give me the best result. Then you supply OpenAI's API with a bunch of questions and answers. This is the most critical part since the better your questions and answers are, the better your end result will become. I found that extrapolating my questions with variables allowed the model to be able to recognize variables, and substitute these, composing larger blocks of code from smaller blocks more naturally. An example of the above could be, for instance, the following questions, with code snippets solving your questions.

  • Insert company_name and org_no into my customers table in my crm database
  • Insert first_name and last_name into my contacts table in my customers database
  • Insert description into status table in my cms database
  • Etc ...

The above might seem ridiculous for a human being, but by extrapolating similar questions such as the above, OpenAI is able to identify variables that it later can find in your natural text as you ask it to solve specific problems. You can even automate the creation of such learning entities by using scripts. I have even seen people using OpenAI and ChatGPT itself to create training material for OpenAI and ChatGPT. Below is an example of a sentence I asked it after training it.

Create a Hyperlambda endpoint that inserts name, address and zip into my customers table in my crm database

For the above sentence, it produced the following result:

Plain Text
 
.arguments
   name:string
   address:string
   city:string
   country:string
data.connect:magic
   data.create
      table:customers
      values
         name:x:@.arguments/*/name
         address:x:@.arguments/*/address
         city:x:@.arguments/*/city
         country:x:@.arguments/*/country
response.status.set:201
return
   result:Insert was a success


The above code is 90% correct. If I had done a better job extrapolating my training data, it would probably perform 100% accurately. Notice how it inserts city and country instead of zip code.

Code Is a Classification Problem

Another thing I realized after playing around with my training material is that code is a classification problem — at least, this is true for Hyperlambda and OpenAI. This allowed me to use less resource-intensive engines that are less expensive and faster. For instance, I used Curie with a lot of success, which is smaller, less expensive, and faster than DaVinci. This allowed me to submit my training data to OpenAI for roughly $1 and ask questions for roughly 0.3 cents. I tried using Ada, but she failed miserably. I never tried Babbage, though, which might have worked, and is even less expensive than Curie.

However, the point is that there are a finite amount of correct solutions within a programming language for a specific problem. For Hyperlambda, this is especially true since it's a super high-level programming level, more like a "5th generation programming language" intended to orchestrate data and not for algorithm-intensive tasks. This allowed me to use classification logic as I trained my model, which of course, produces much more accurate results.

Another thing I noticed was that by providing multiple questions to the same snippet of code, I was able to drastically increase the quality, which again is because that code is a classification problem. I had, in total, 691 training snippets; however, there were probably only some 250 different code snippets, implying the same code snippet was reused multiple times for different questions. One thing I intend to change in future versions is to extrapolate much more, allowing Curie to recognize variables more easily in my natural text. Currently, I've got roughly 90% correctly working code. However, due to Hyperlambda's simple syntax, I am certain that I can bring these numbers easily up to 99% accuracy with less than 1,000 training snippets.

All in all, the entire process of implementing this into Magic took me two days, with a couple of days thinking about the problems first. If you want to play around with the thing, you can register for a free 90 days cloudlet below and create your own OpenAI API key.

AI API Machine learning GPT-3 Cloud

Published at DZone with permission of Thomas Hansen. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Securing AI/ML Workloads in the Cloud: Integrating DevSecOps with MLOps
  • Architecting AI-Native Cloud Platforms: Signals to Insights to Actions
  • AI-Based Multi-Cloud Cost and Resource Optimization
  • How to Build the Right Infrastructure for AI in Your Private Cloud

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook