Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 3

Types of Large Language Models and Their Applications

Recommended resources

Welcome to the third lesson in our foundational module. In our last session, we demystified tokens and context windows, establishing the fundamental constraints you'll work with as an AI developer. We learned that every interaction with a Large Language Model has a cost and a size limit, dictated by how text is tokenized and how much "working memory" the model has.

Today, we'll build on that by exploring the fact that not all LLMs are created equal. They are not monolithic entities but come in different "flavors," each shaped by a distinct training process for a specific purpose. This lesson will compare base models, instruction-tuned models, and chat models, clarifying when to use each. Understanding these distinctions is a crucial step toward selecting the right engine for the intelligent agents you aim to build.

The Evolutionary Path of a Language Model

The journey from a raw, data-absorbing algorithm to a helpful conversational assistant is a multi-stage process. Each stage imbues the model with new capabilities, making it progressively more useful for real-world applications.

This diagram illustrates the typical evolutionary path of modern LLMs. It starts with a **Base LLM** trained on a vast corpus of internet data. This is then refined through **Instruction Tuning** to follow commands. Further **Chat Optimization** makes it conversational, and finally, it can be specialized for specific domains.

In this lesson, we will focus on the first three stages, which represent the most common categories of models you will encounter: Base, Instruction-Tuned, and Chat.


1. Base Models: The Raw Foundation

A base model is the direct product of the initial pre-training phase. In this stage, a model is exposed to trillions of words from the public internet, books, and code. Its single objective is next-token prediction. It learns grammar, facts, reasoning abilities, and language patterns by simply trying to predict the next piece of text in a sequence.

To understand this initial training phase, which is called self-supervised learning, watch the first part of this short video from Snorkel AI.

Understand the basics of LLM training in under four minutes!

This video, "Understand the basics of LLM training," clearly explains the three main stages of training.

Watch the section on self-supervised learning, from the beginning until 01:33. Notice how the model learns by predicting words that are intentionally hidden from it, using the vast amount of unlabeled text data available.

Because of this training, a base model is excellent at text completion but not at following commands. If you give it a question, it's just as likely to provide another question as it is to provide an answer, because that might be a statistically plausible completion based on its training data.

This short video provides an excellent intuitive example of this behavior.

What are the different types of models - The Ollama Course

This clip from "The Ollama Course" demonstrates the typical behavior of a base model versus a tuned model.

Watch the segment from 02:12 to 03:08, where the presenter explains how a base model responds to prompts. The "once upon a time" example perfectly illustrates its completion-oriented nature.

From a software engineering perspective, a base model is like a raw, powerful library or SDK—think of a low-level graphics rendering engine or a networking stack. It has immense potential but isn't a finished product. It provides the building blocks, but it's up to the developer to use them to create something useful.

For a more formal definition and some examples, please read the following sections.

LLM Finetuning Series 05: LLM Architectures: Base, Instruct, and Chat Models

This article provides clear, structured explanations of each model type.

Start by reading the section What is a Base Model?. The analogy of a student who has read every book in the library is a great way to think about it.

When to use a base model: You would typically only interact with a base model if you intended to do your own extensive fine-tuning. For most application developers, including for our purposes in this course, you will almost always use a model that has already undergone the next stages of refinement.


2. Instruction-Tuned Models: The Task-Oriented Worker

To make base models more useful, they undergo a process called instruction tuning, or Supervised Fine-Tuning (SFT). In this stage, the model is trained on a curated dataset of (instruction, desired_output) pairs. These instructions can range from "Summarize this article" to "Translate this sentence to French" or "Write a C# function that sorts a list."

This process aligns the model's behavior with human intent, teaching it to act as an instruction-follower rather than just a text-completer.

Let's return to the video on LLM training to see how this works.

Understand the basics of LLM training in under four minutes!

This is the same video as before, "Understand the basics of LLM training".

Now, watch the section on supervised learning, from 01:33 to 02:25. This part explains how instruction tuning transforms the model into a helpful assistant that can generalize to new tasks.

An instruction-tuned model, often identifiable by "Instruct" in its name, excels at single-turn tasks. You give it a command, and it gives you a direct response. It doesn't inherently maintain a conversational back-and-forth.

Continuing our software analogy, if a base model is a raw library, an instruct model is like a well-defined command-line tool or a specific REST API endpoint. It's designed to perform a predictable operation based on a clear input. For your work, this could be an endpoint that takes a JSON payload representing a logistics issue and returns a structured summary.

LLM Finetuning Series 05: LLM Architectures: Base, Instruct, and Chat Models

Now, let's continue with the same article from earlier.

Read the section What is an Instruct Model?. Pay attention to the characteristics listed, especially its focus on single-turn responses.

When to use an instruct model: These models are perfect for automating well-defined tasks that don't require conversational memory. Examples include:

  • Summarizing customer support tickets.
  • Classifying incoming emails.
  • Extracting structured data (like invoice details) from unstructured text.
  • Generating boilerplate code based on a specification.

3. Chat Models: The Conversational Partner

The final step in this evolution creates a chat model. These models are built on top of instruction-tuned models and are further refined to excel at multi-turn dialogue. They learn to maintain context, adopt a consistent persona, and engage in a natural, helpful, back-and-forth conversation.

The key technique used here is often Reinforcement Learning from Human Feedback (RLHF). During this phase, humans rank various model responses for qualities like helpfulness, accuracy, and harmlessness. This feedback is used to train a "reward model," which then fine-tunes the LLM to produce outputs that humans prefer.

The final segment of the training video explains this stage.

Understand the basics of LLM training in under four minutes!

Once more, let's refer to the "Understand the basics of LLM training" video.

Watch the final segment on reinforcement learning, from 02:25 to the end. This explains how RLHF helps shape the model's output to be more aligned with nuanced human preferences like brevity and safety.

In our software analogy, the chat model is the complete, interactive application. It manages state (the conversation history), interacts with the user over multiple turns, and presents a polished, user-facing experience. This is the category that models like ChatGPT, Gemini, and Claude fall into.

The following image provides a fantastic summary of this analogy, connecting the model types to concepts you're familiar with from software development.

This illustration maps the LLM evolution to software development concepts. The **Base Model** is like raw code and libraries. The **Instruct Model** is like a compiled, usable application that performs a function. The final stage, a **Thinking Mode** or AI agent, is like an "operator" that can use the application with reasoning—this is what we are ultimately aiming to build.

For our goal of building AI agents, chat models are the essential foundation. An agent needs to reason, and that reasoning often takes the form of an internal dialogue or a conversation with tools.

LLM Finetuning Series 05: LLM Architectures: Base, Instruct, and Chat Models

To finish our understanding, let's complete the article.

Read the final parts of the text: The section on Chat Models, which highlights the focus on dialogue. The comparison table for a concise summary. The Conclusion, which provides clear guidance on when to choose each model.

When to use a chat model: This is your default choice for any application that requires interaction, conversation, or a sequence of related steps. This includes:

  • Customer service chatbots.
  • Virtual assistants.
  • Interactive educational tutors.
  • And critically for this course, AI Agents, which use conversational ability to reason through complex tasks.

Conclusion

Today we've unpacked the evolutionary journey of LLMs, seeing how they are progressively refined from raw text predictors into sophisticated conversational partners. Choosing the right type of model is the first step in designing an effective and efficient AI application.

Here are the key takeaways:

  • Base Models are powerful but raw next-token predictors. They are the foundation for further tuning but are rarely used directly in applications.
  • Instruction-Tuned Models are fine-tuned to follow commands for single-turn tasks. They are ideal for task automation like summarization or classification.
  • Chat Models are further optimized for multi-turn dialogue using techniques like RLHF. They are the necessary foundation for building chatbots and the AI agents we'll be focusing on.

In our next lesson, we will delve into the key parameters that allow you to control the behavior of these models at inference time. You'll learn how to adjust settings like temperature, top-p, and top-k to steer the model's output between deterministic and creative, a crucial skill for building reliable AI systems.