Build for me
AIPublished September 12, 2024

What Are AI Models? How to Select And Tune AI to Suit Your Needs

A guide to understanding AI models and tuning them to produce output that meets your specifications

Cait Levin

Cait Levin

Education Lead

What Are AI Models? How to Select And Tune AI to Suit Your Needs

Artificial intelligence can feel like a black box—you can see the prompt you enter and the output it generates, but the engine that converts one into the other is much less visible.

That engine is the AI model—an algorithm trained on specific data to produce a specific type of output. If you’re using AI for important work (or just want to learn everything you can about artificial intelligence), learning how to choose which model to use and tune it to meet your needs more effectively is a valuable skill.

In this guide, we’ll break down the way different artificial intelligence models work, why the difference matters, and how to pick the best one for your specific tasks—whether it’s improving customer experience or analyzing business data. 

We’ll also look at how to build your own software that integrates the power of your chosen AI models with Glide. Glide is a no code app-building platform that offers integrations with the major AI tools as well as native Glide AI—a managed AI feature that selects the ideal AI models for each task for you.

But first, let’s learn about AI models and what distinguishes them.

What is an AI model?

An AI model is a computer algorithm that learns from datasets to find patterns and make predictions in order to create output that mimics the form of the data used to train it. Typically the goal of developing AI models is to produce an output that accurately mimics that of human intelligence. 

What makes a model unique is both the algorithm that runs it and the distinct body of data that it was trained on. As a model is exposed to more training data, it gets better at recognizing patterns and producing realistic results.

Most AI models you’ll use are actually machine learning (ML) models. They use deep learning techniques with neural networks to mirror the human brain’s ability to learn complex patterns. This is why ML models are so good at performing tasks that used to require human intelligence to carry out. 

For instance, a model that does natural language processing (NLP) will be focused on understanding and generating human language in a way that feels realistic. Other AI models have different specialties, like DALL·E, which generates images from text descriptions using neural networks, or Anthropic’s Claude, which excels at things like cognitive reasoning and generating code. 

One of the most well-known generative AI models is OpenAI’s GPT-4. It’s a large language model (LLM) that uses natural language processing and deep learning to generate and understand written text. ChatGPT is the most well-known application that uses GPT-4, but the same model also powers tools like Microsoft Copilot. In this case, ChatGPT is the AI tool, while GPT-4 is the specific AI model that runs that tool.

What is a trained model in AI? 

AI models work by learning from examples (in the form of training data), recognizing patterns, and then producing an output that follows those identified patterns. Training a model involves giving it selected data to refine the algorithm and get the output you want from it. It’s also often an ongoing process. As the model receives more data, it continues to refine and improve. 

AI models are trained using two techniques based on different data science approaches—supervised learning and unsupervised learning (and occasionally semi-supervised learning). Supervised learning models use labeled data to make predictions, while unsupervised learning models identify hidden patterns in data without explicit instructions. 

As an example, you could train a custom natural language processing ML model using your business’s customer support tickets from the last five years. As it analyzes that data, it will start recognizing patterns. You can then use it to do things like predict which customers are most likely to cancel their subscriptions based on specific wording in support questions or create a chatbot with it that can accurately answer your most common customer questions.

How training data creates AI model bias

AI bias is when an AI model produces skewed or inaccurate output because it has been trained on a dataset that contains biases (which, spoiler alert: it almost always does!) or is incomplete.

This could look like a hiring algorithm illegally rejecting the resumes of older candidates because it has been trained on a workforce that skews younger. It could also take the form of a speech recognition algorithm that is unable to recognize accents (since it was only trained on the voices of native speakers) or an image algorithm that can’t produce non-white faces (because it hasn’t been trained on images of people of other races).

It’s important to remember that AI doesn’t have the context or judgment that a human does, so it won’t identify these problems and correct for them. It only knows what it’s been trained on and will reproduce it faithfully. You have to use your own training, fine-tuning, and careful consideration of output to refine your results and avoid AI bias harming your business.

AI bias can show up in several ways:

  • Demographic bias occurs when certain groups (such as a specific gender, race, or age) are over- or underrepresented in the training data. 

  • Cultural bias can happen if the model is trained on data from only one region or culture, leading to skewed outputs when used elsewhere. 

  • Selection bias arises when the data used to train the model doesn't fully represent the real-world scenarios where the AI will be applied.

You can use prompt engineering to combat AI bias

You can use prompt engineering to combat AI bias

Learn how

How to choose the right AI model

Choosing the right AI model is all about understanding what the model is designed to do and how it fits the task (or tasks) you need to do. The first step is getting a thorough understanding of your own workflows and where exactly you need to use AI. You can then start assessing which models are best suited to each task.

What tasks is the AI model optimized for? 

At the most basic level, you need to choose a model that creates the type of output you need. If a model is optimized for generating text, it won’t be the right fit for generating images. 

You can refine your choices from there. If you want to generate realistic-looking headshots to populate a directory, you’ll want to choose an image-generating model that is optimized for photography rather than illustration. If you need to analyze large datasets, look at what types of data that model is mostly trained on—it will be most effective if you want to use it for that specific type of data as well.

How can you integrate it into your workflows?

Consider how well the AI tool can incorporate into your existing workflows and interface with the other software you use for that work. Are you able to integrate it directly with the tools you're already using, natively or with an API? Or will you need to access it on a separate platform and copy the results over? Your work will be more efficient if the model integrates smoothly into your systems.

How much does it cost? 

AI models have very different pricing structures. Some charge based on tokens, which is a unit of how much data you're processing (such as the number of characters generated). Others might have subscription-based models or charge per use. Using more complex models with larger datasets can often cost more because they process more information.

Before choosing a model, consider your budget and how often you'll use the tool. If you're just experimenting, a usage-based tool might be more affordable. But if you need to use it daily, a subscription could be more cost-effective.

What is model tuning, and why would you do it?

Model tuning is how you refine an AI model to help it perform better on very specific or personalized tasks. Fine-tuning a model is typically done on a platform like OpenAI or Replicate, where you can customize models based on your needs. 

Foundation AI models, like GPT-4, are trained on vast amounts of general data, which makes them good at a wide variety of tasks. However, if you need an AI to excel at a specific job—like analyzing customer support tickets—you can fine-tune it using more specialized data. If you are just getting started, fine-tuning a model is likely to be overkill. Instead, you’ll be better off starting with small model tweaks to fit your specific needs. These adjustments are more about how the model interacts with your data and tasks rather than creating a completely customized AI model. 

Using AI models in Glide

You can use different AI models in Glide in two main ways—using integrations and using native Glide AI. 

Get Managed AI with Glide AI

Alternatively, you can use Glide AI, which is a managed AI system. This means that it selects the best AI model for your specific task—whether that’s transcribing speech into typewritten notes or performing sentiment analysis of a submitted text entry.

Managed AI comes with some benefits over self-selecting a specific model. Your AI models are constantly updated as new models launch or improvements are made. The AI actions you run through Glide AI are also processed through Glide’s enterprise-level account with each tool, which means your updates get the highest level priority and are much faster as a result. Additionally, results are cached within your app, so if you’re running the same AI instruction multiple times you will use fewer updates and get results faster.

While you can’t tune models when you use Glide AI, what you can do is refine your instructions using AI prompt engineering to receive better results from your AI.

Integrate different AI models with your Glide app

You can also choose to integrate your Glide apps with tools like OpenAI, Replicate, Google Cloud, and Azure, and you can create your own connections with outside AI models using APIs. You can tune these models like normal and connect the tuned model to your Glide app.

Refine results using model tweaking on OpenAI output in Glide

You can also refine your OpenAI integration output using model tweaks in Glide. To do this, you adjust the parameters that instruct the AI model, making it more likely to produce the results you need.

Whatever tweaks you make to refine your OpenAI output, it’s best to start by testing on smaller datasets. Test the model tweaks on a small batch of data first to see how changes affect the output. That way, you won’t overwhelm your app with updates, and you can gradually improve the AI’s performance to meet your needs.

 You can model tweak OpenAI in Glide using three parameters:

Temperature

Tweak your output by changing OpenAI's temperature, which is represented by a number between 0.0 and 2.0. This works because OpenAI models are non-deterministic, meaning that identical inputs can yield different outputs. 

Using a higher temperature to make your output more random, diverse, and creative, or lower the temperature to get more focused and deterministic results. A higher temperature runs the risk of making your output less relevant to your prompt, while a lower temperature is likely to give you similar results each time. 

Maximum Length

You can set a maximum length for the responses generated by your prompts. A higher max length will give you longer responses, but you may lose coherence the longer they get.

This length is measured by the number of tokens (words or symbols) and must be a number below 2048 since that is the context length limit of most models (though the newest models can support 4096 tokens).

Frequency Penalty

You can set a frequency penalty between -2.0 and 2.0. A higher penalty discourages the model from repeating itself, which can result in more varied output that also runs the risk of producing responses that are irrelevant to the input. A lower penalty is more permissive of repetition but can create narrow or uninteresting responses.

Understand AI models so you can use AI as a more effective tool

There are many artificial intelligence and machine learning models and tools available, and it seems like more are being developed every day. The great thing is, the model improvements that are happening are helping to make AI more and more powerful. The downside? Not all those models are great, and it can be a lot of work to find the perfect model for the work you need it to do.

Your goal is to understand how these models function and how to control their output more effectively using model training, tuning, and prompt engineering. This will turn AI into a craftsman’s tool in your hands. You’ll be able to use it to create AI solutions to tricky problems, build powerful software for your business (or your clients’ businesses), and put together sophisticated workflows that make your work much, much more efficient.

Create software that helps you interact with AI models

Sign up
Cait Levin
Cait Levin

An educator for over 15 years, Cait leads all aspects of Glide’s educational experience for users, from Glide University to the Glide Docs and everywhere in between. She has worked with learners of all ages across disciplines and mediums. When not thinking about how to help folks use Glide, she reads and writes on her couch in Boston, often with a snack.

Share this article

Glide's mission is to put the power, beauty, and magic of software development into the hands of a billion new creators. Join Us