Here’s how the prompt gets processed.
Tokenisation: Your text is tokenised.
Embedding: Tokens are mapped into vectors of numbers.
Attention layers: The process goes through many layers and figures out the context of your text.
Probability prediction: The output is the probability of each possible next token.
Sampling: One token is chosen, usually using some randomness with a parameter called temperature.
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.