What Are LLMs? Working, Types, and Applications

By Rahul Singh

Updated on Dec 2, 2026

Share:

Quick Overview:

  • LLMs are AI models trained on large amounts of textual data to learn and reason with human language.

  • They are built on the Transformer architecture and work by breaking text into tokens and predicting what comes next.

  • LLMs come in several types: encoder-only, decoder-only, encoder-decoder, open-source, closed-source, domain-specific and multimodal.

  • Popular models include GPT, Claude, Gemini, Llama, Mistral and DeepSeek, each with different strengths.

  • In this blog you will learn what are LLMs, their architecture, types of LLMs, popular models and real world applications.

Understanding how LLMs work is the first step towards building AI applications. IIT Kharagpur's Generative AI & Agentic AI Course - Executive Post Graduate Certificate helps you apply these concepts through practical projects involving LLMs, RAG, and AI agents.

What Are Large Language Models (LLMs)?

If you have used ChatGPT, Claude or Gemini, you have already met an LLM. But what are LLMs, exactly? A large language model is a type of artificial intelligence trained on enormous collections of text, such as books, websites, articles and code, so that it can read, write and respond in natural language. 

The "large" refers to two things: the amount of training data and the number of internal settings, called parameters, which can run into the billions or even trillions.

So, what are LLM models in AI doing under the hood? They learn statistical patterns in language. During training, a model sees countless sentences and keeps trying to guess the next piece of text. After enough practice, it picks up grammar, facts, writing styles and even some reasoning skills. It does not look up answers in a database. It generates them, one piece at a time.

This approach took off after 2017, when researchers at Google introduced the Transformer architecture in the paper "Attention Is All You Need". OpenAI's GPT-3, released in 2020 with 175 billion parameters, showed what happens when that design is scaled up. 

Key Components of Large Language Models

Whether you ask what are LLM in AI or how they are built, the same few building blocks come up.

  • Tokens: Models do not read words the way we do. Text is split into tokens, which can be a whole word, part of a word or a punctuation mark. In English, one token is roughly four characters, so 100 tokens is about 75 words. So, what are LLM tokens used for? They are the unit a model reads, writes and is billed by.

  • Embeddings: Each token is turned into a list of numbers that captures its meaning. Words with similar meanings end up with similar numbers.

  • Parameters: These are the learned weights, which contain information that the model has learned throughout training.

  • Context Window: It refers to the number of tokens that the model considers in one go, including your prompt and the response of the model. The larger the context window, the more extended the document and conversation.

  • Training data: The text the model learns from. Its quality and variety shape how useful and fair the model turns out to be.

Architecture of Large Language Models

Almost every modern LLM is built on the Transformer. Its key idea is self-attention, a method that lets the model weigh how much each token in a sentence relates to every other token. 

Take the sentence "The trophy did not fit in the suitcase because it was too big." Attention helps the model work out that "it" refers to the trophy, not the suitcase.

A Transformer stacks many layers, and each layer refines the model's understanding of the text. Most chat models today use a decoder-only design, which reads the tokens so far and predicts the next one.


LLM architecture infographic showing transformer layers, self-attention, feed-forward networks and response generation through tokenisation, embedding, attention, probability prediction and sampling.

Here’s how the prompt gets processed.

  1. Tokenisation: Your text is tokenised.

  2. Embedding: Tokens are mapped into vectors of numbers.

  3. Attention layers: The process goes through many layers and figures out the context of your text.

  4. Probability prediction: The output is the probability of each possible next token.

  5. Sampling: One token is chosen, usually using some randomness with a parameter called temperature.

  6. Repetition: This token is added to your text, and the loop continues until the response is formed.

How Are Large Language Models Trained?

Large language models (LLMs) learn from a huge pile of text: books, articles, websites, research papers, and even programming code. By working through all of it, they pick up how language fits together, including grammar, context, and a surprising amount of reasoning.

Training usually happens in a few stages.

1. Collecting and cleaning the data

The process begins with acquiring text from various sources. The text is messy, and hence it needs to be pre-processed; this entails removing duplicate text, irrelevant text, and poor quality samples.

2. Tokenization

Computer systems do not understand text the way humans do; hence, the text is broken down into smaller parts called tokens. A token may comprise an entire word, a part of a word, a digit, or even just one character. Each token is assigned a numeric code by the model.

3. Pretraining

This is where most of the learning happens. The model trains itself with no human labels, in one of two ways:

  • Next-token prediction: Generative models, like the ones behind most chatbots, guess what comes next in a sentence.

  • Masked-token prediction: Models like BERT fill in words that have been hidden.

Every time the model guesses wrong, it adjusts its internal parameters through backpropagation and gradient descent. Over billions of examples, its guesses get much better.

4. Supervised fine-tuning (SFT)

The pretrained model is very knowledgeable but is not yet skilled at being helpful. Thus, it is further trained using carefully curated examples of instructions and helpful responses to them.

5. Reinforcement learning and preference tuning

Then, the model is trained to be more helpful based on preferences expressed by people. There are two popular ways of doing so:

  • RLHF (Reinforcement Learning from Human Feedback): People evaluate or rank responses, and the model learns to prefer better responses.

  • DPO (Direct Preference Optimization): A simpler technique that learns directly from preferences.

Both techniques help improve response quality, following instructions, and safety.


6. Evaluation and testing

Finally, before releasing the model, it is evaluated on benchmarks measuring reasoning, factual correctness, coding, language understanding, and safety.

Also, developers search for AI hallucinations, bias, and inconsistent answers. Developers can also apply LLM guardrails to detect unsafe inputs, unreliable outputs, and sensitive data exposure.

Not all models undergo all six stages. The process depends on the architecture of the model, its purpose, and computational resources.

Different Types of Large Language Models

There is no single way to sort LLMs, but these groupings cover most of what you will see.

By Architecture

  • Encoder-only models: Built to understand text rather than write it. BERT is a well-known example and supports tasks such as text classification and semantic search.

  • Decoder-only models: Built to generate text. The GPT family, Claude and Llama follow this design.

  • Encoder-decoder models: They take input and output the processed output, which fits into tasks like translations and summaries. Examples: T5

By Access

  • Closed-source models: Provided through the API or application and have private weights. GPT, Claude, Gemini are some examples.

  • Open-weight models: Their weights are downloadable and runnable on your own hardware. Popular examples: Llama, Mistral, Qwen.

By Purpose

  • General-purpose models: Deal with multiple kinds of jobs.

  • Domain-specific models: These are fine-tuned to work in areas like law, medicine, or finance.

  • Reasoning models: They allocate additional computation time while reasoning through multiple steps before providing answers to better answer math and logic questions.

  • Multimodal models: Take input and generate outputs in formats apart from text, e.g., images, videos, audio, etc.

  • Small language models: Smaller versions of models to fit into mobiles and laptops.

Popular Large Language Models and Their Capabilities

Various kinds of Large Language Models differ in terms of their architecture, training process, availability, and capabilities. Yet, whereas some language models focus on creating content and reasoning, others are focused more on coding, multilingualism, or understanding the language.

The table presented below highlights several well-known Large Language Models based on their capabilities and applications.

Large Language Model

Developer

Key Capabilities

Model Access

Common Use Cases

GPT (Generative Pre-trained Transformer)

OpenAI

Text generation, multimodal understanding, reasoning and code generation

Primarily proprietary

AI assistants, content creation, software development and AI agents

Gemini

Google DeepMind

Multimodal processing, long context understanding and complex reasoning

Proprietary

Document analysis, research, video understanding and coding

Claude

Anthropic

Complex reasoning, long document analysis, coding and tool calling

Proprietary

Research, business automation, content writing and software development

Llama

Meta

Language generation, multilingual processing, fine-tuning and multimodal understanding

Open weights

Custom AI applications, private deployment and chatbots

DeepSeek

DeepSeek AI

Mathematical reasoning, code generation and complex problem solving

Open weights

Scientific research, programming and mathematical analysis

Mistral

Mistral AI

Multilingual processing, reasoning, coding and function calling

Open weights and proprietary

Enterprise AI, local deployment and document processing

Qwen

Alibaba

Multilingual understanding, coding, multimodal processing and reasoning

Open weights and proprietary

Translation, AI assistants and agentic AI applications

Granite

IBM

Enterprise reasoning, code generation, information extraction and tool calling

Open weights

Business automation, Retrieval Augmented Generation (RAG) applications and enterprise AI

BERT (Bidirectional Encoder Representations from Transformers)

Google

Contextual language understanding, text classification and entity recognition

Open weights

Search engines, sentiment analysis and extractive question answering

Which one is best? It depends on the job. 

If you are weighing generative AI vs LLM terms or models, note that a team working with sensitive data may prefer an open model hosted in-house, while a startup that wants quick results may pick a hosted API. Benchmarks help, but testing a model on your own tasks tells you far more. 

Real-World Applications of Large Language Models

LLMs now sit inside tools many people use every day. Here are some of the most common uses.

Application

What the LLM Does

Example

Customer support

Answers queries and drafts replies

Chatbots on banking and e-commerce sites

Content creation

Drafts, edits and summarises text

Blog outlines, email drafts, report summaries

Software development

Writes, explains and debugs code

AI coding assistants inside editors

Translation

Converts text between languages

Real-time translation in chat and documents

Education

Explains topics and gives practice questions

Personalised tutoring tools

Healthcare admin

Summarises notes and drafts documentation

Clinical note summaries reviewed by doctors

Data analysis

Turns plain-English questions into queries

Asking a database a question without writing SQL

Conclusion

LLMs look like magic from the outside, but the core idea is simple: predict the next token, again and again, using patterns learned from huge amounts of text. What makes them powerful is scale, the Transformer design and careful training afterward. 

So, what are LLMs best used for? The smartest way to approach them is as capable assistants rather than all-knowing oracles. Use them to draft, explore and speed up routine work, and keep your own judgement in charge. If you are starting out, pick one model, try it on a real task and see where it shines and where it stumbles.


Rahul Singh

Rahul Singh

49+ of articles published


Current role in the industry :

Associate - Content Marketing

Education Qualification :

B.Tech in Computer Science & Engineering

Expertise :

Artificial intelligenceMachine Learning (ML)Data ScienceFull-Stack DevelopmentData Structures & Algorithms

Tools & Technologies :

PythonReact.js & Next.jsJavaScript (ES6+)SQLTailwind CSSNode.js & MongoDBGit & GitHubSEO Tools (SEMRush)Google Search ConsoleTableau / Power BIFigma

About

Rahul Singh is an Associate Content Writer, with a strong interest in Generative AI, Agentic AI and AI-Native Software Engineering. He combines technical development skills with data-driven strategies to build scalable applications and optimize digital content. Rahul specializes in simplifying complex concepts across AI, ML and software development into practical, easy-to-understand insights, helping learners understand how AI products, systems and services are built and applied. He focuses on real world applications and explains advanced topics in a clear, step by step manner so you can follow along without confusion. His work connects theory with hands-on examples, covering AI-assisted development, intelligent automation and AI integration in software applications. He aims to help you learn faster, create better projects, and apply your knowledge confidently in real scenarios.

Follow me on :

Frequently Asked Questions

FAQ

Ready to Take the Next Step? Enroll Today!