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
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • How to Build the Right Infrastructure for AI in Your Private Cloud
  • A Glimpse Into the Future for Developers and Leaders
  • Creating Scalable, Compliant Cloud Data Pipelines in SaaS through AI Integration
  • How To Build Translate Solutions With Google Cloud Translate AI

Trending

  • How Large Tech Companies Architect Resilient Systems for Millions of Users
  • Accelerating Debugging in Integration Testing: An Efficient Search-Based Workflow for Impact Localization
  • Navigating Double and Triple Extortion Tactics
  • Traditional Testing and RAGAS: A Hybrid Strategy for Evaluating AI Chatbots
  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
4.7K 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

  • How to Build the Right Infrastructure for AI in Your Private Cloud
  • A Glimpse Into the Future for Developers and Leaders
  • Creating Scalable, Compliant Cloud Data Pipelines in SaaS through AI Integration
  • How To Build Translate Solutions With Google Cloud Translate AI

Partner Resources

×

Comments
Oops! Something Went Wrong

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

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

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 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!