What is a Large Language Model?
A Large Language Model (LLM) is a deep neural network trained on vast quantities of text data to understand, generate, and reason over human language and code.
At its core mathematical foundation, an LLM performs one primary task: given a sequence of words or tokens, it calculates the probability distribution of what token should come next.
Yet, when scaled to hundreds of billions of parameters and trained across trillions of words from the web, this seemingly simple next-token objective gives rise to extraordinary emergent capabilities—including translation, summarization, logical deduction, programming, and tool coordination.
Why does this matter?
Before LLMs, solving natural language problems in software required separate, specialized machine learning models for every distinct task:
- One model for sentiment analysis
- Another model for named entity recognition (extracting names, dates, organizations)
- A separate model for language translation
- A hand-tuned rules engine for intent classification
Building conversational software was labor-intensive, fragile, and unable to generalize across domains.
LLMs introduced the Foundation Model paradigm: a single, general-purpose base model capable of handling almost any natural language or coding task simply by being given descriptive text instructions (prompts).
What makes an LLM "Large"?
The term "Large" in LLMs refers to scale across three dimensions:
┌─────────────────────────────────────────────────────────────┐
│ The Dimensions of Scale │
├──────────────────────────┬──────────────────────────────────┤
│ 1. Parameter Scale │ 7 Billion to 1 Trillion+ weights │
│ 2. Training Data Scale │ 2 Trillion to 15+ Trillion tokens│
│ 3. Compute Scale │ Thousands of GPUs for months │
└──────────────────────────┴──────────────────────────────────┘
- Parameters: The learned internal numerical variables (weights and biases) stored in the neural network. While classical ML models used thousands or millions of parameters, modern LLMs contain tens or hundreds of billions.
- Dataset Volume: LLMs are pre-trained on diverse datasets covering human literature, open-source code repositories, scientific research papers, encyclopedias, and web crawl archives.
- Compute Scale: Training a frontier model requires millions of GPU compute hours running in parallel across high-speed data center clusters.
What is a "Language Model"?
In computational linguistics, a language model is a statistical model that assigns probabilities to sequences of words.
Consider the incomplete sentence:
$$\text{"The astronaut boarded the ____"}$$
A language model evaluates candidate words and assigns probabilities based on learned patterns:
rocket$\to 64%$spacecraft$\to 22%$airplane$\to 3%$sandwich$\to 0.0001%$
By selecting the most plausible next word and repeating the process, the model constructs coherent, logically consistent paragraphs.
Traditional NLP vs Modern LLMs
To appreciate the architectural shift, contrast classical Natural Language Processing (NLP) with modern LLM workflows:
| Dimension | Traditional NLP (Pre-2018) | Modern Large Language Models | | :--- | :--- | :--- | | Architecture | Task-specific (SVMs, Naive Bayes, RNNs) | Universal Transformer-based Foundation Models | | Training | Supervised learning on custom labeled datasets | Self-supervised pre-training on web-scale text | | Adaptability | Rigid; fails outside its narrow training domain | Flexible; solves new tasks via in-context prompting | | Context | Short sequences (a few sentences at a time) | Massive context windows (32,000 to 2,000,000+ tokens) | | Maintenance | Maintain dozens of individual classifiers | Maintain prompts and orchestration workflows |
Critical Distinctions: What an LLM is NOT
To design reliable AI systems, software engineers must avoid anthropomorphizing models.
┌────────────────────────────────────────────────────────────────────────┐
│ Search Engine: Index of documents ──► Keyword / Semantic Lookup │
│ Database: Structured tables ────────► Exact Key/Value Retrieval │
│ LLM: Neural Network Weights ────────► Probabilistic Text Synthesis │
└────────────────────────────────────────────────────────────────────────┘
1. LLM vs Search Engine
- A search engine crawls the web, builds an inverted index of documents, and retrieves existing articles matching your query.
- An LLM does not search a database of live files. It generates answers on the fly based on statistical representations baked into its frozen parameters during training.
2. LLM vs Chatbot
- An LLM is the underlying machine learning model (e.g., GPT-4, Claude 3.5, Llama 3).
- A Chatbot (like ChatGPT or Claude.ai) is a full application wrapper around the model that manages UI, conversation history, user authentication, safety filtering, and tool integrations.
3. LLM vs Knowledge Base
An LLM is not a reliable factual database. It is a reasoning and language generation engine. If a model has not encountered recent data or lacks specific proprietary records, it cannot verify facts unless connected to external search or retrieval pipelines (RAG).
The High-Level Lifecycle of an LLM
The journey of an LLM from raw text to an intelligent application follows four core phases:
┌────────────────┐ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ 1. Raw Data ├─────►│ 2. Pre-training ├─────►│ 3. Alignment ├─────►│ 4. Inference │
│ Web & Code │ │ Next-Token Loss │ │ SFT & RLHF │ │ Prompt & Output │
└────────────────┘ └─────────────────┘ └─────────────────┘ └─────────────────┘
- Data Collection & Curation: Filtering and deduplicating trillions of tokens of text and code.
- Pre-training: Training a raw neural network to predict the next token on web data (creating a Base Model).
- Post-Training & Alignment: Refining the base model with instruction tuning and human feedback so it follows instructions safely and conversationally.
- Inference & Application: Deploying the aligned model behind APIs for prompting, tool calling, and autonomous agents.
Common Misconceptions
- Misconception: The model looks up facts in an internal encyclopedia when you ask a question. Reality: The model computes matrix multiplications across its parameters to predict plausible text. It has no internal search index or relational database.
- Misconception: An LLM knows what it is saying and possesses consciousness. Reality: An LLM is a complex statistical pattern engine. It models grammatical and logical structures in language without subjective awareness or intent.
Key Takeaways
[!IMPORTANT]
- An LLM is a deep neural network trained to calculate the probability of subsequent tokens in a sequence.
- "Large" refers to parameter count (billions/trillions), training dataset size (trillions of tokens), and massive compute requirements.
- Unlike traditional task-specific NLP pipelines, LLMs serve as general-purpose foundation models adapted through prompting.
- An LLM is a reasoning and text-generation engine, not an infallible factual database.
What comes next?
Before an LLM can calculate probabilities or process sentences, human text must be converted into a format computers understand: numbers.
In Lesson 02, we explore Tokens and Tokenization—the fundamental gateway between raw human text and neural network inputs.