AI, Machine Learning, and LLMs: Understanding the Technical Hierarchy
This article breaks down the technical hierarchy from Artificial Intelligence (AI) to Large Language Models (LLMs). It explores the core concepts, relationships, and engineering implications of AI, Machine Learning (ML), Deep Learning (DL), the Transformer architecture, and LLMs. By understanding this hierarchy, developers and tech professionals can better evaluate model capabilities and choose the right approach for their specific tasks.
1. The Overall Technical Hierarchy
The concepts of AI, ML, DL, and LLMs exist in a nested hierarchy, where each layer is a subset of the one above it. As you move down, the scope narrows and the technology becomes more specific:
Artificial Intelligence (AI)└── Machine Learning (ML)└── Deep Learning (DL)└── Transformer Architecture└── Large Language Model (LLM)
It is important to note that Symbolicism (reasoning based on logical rules and knowledge bases) is an early, parallel technical route in AI that does not belong to the ML branch. ML is data-driven, while Symbolicism relies on explicit rules. Understanding this distinction helps clarify the boundaries of the subsequent layers.
2. Artificial Intelligence: Goals and Scope
AI is the broadest concept, referring to the science and technology of simulating, extending, and expanding human intelligence in machines. It focuses on tasks that typically require human intelligence, such as visual recognition, language understanding, decision-making, and planning.
2.1 Scope of Coverage
Any behavior where a machine exhibits “intelligence” falls under this category, including:
- Expert systems based on manually written rules;
- Classification and prediction models based on statistical learning;
- Perception and generation systems based on neural networks.
Early expert systems are a classic example. The following pseudocode demonstrates a rule-based sentiment analysis logic:
Function Determine_Sentiment(text):positive_words = {"satisfied", "like", "recommend"}negative_words = {"disappointed", "poor", "refund"}score = count of positive_words in text - count of negative_words in textif score > 0: return "Positive"if score < 0: return "Negative"else: return "Neutral"
This method is highly interpretable, but the rules require manual enumeration. It will fail when encountering nuanced expressions like “It’s okay, I guess.”
2.2 Weak AI vs. Strong AI
Based on capability scope, AI is generally divided into two categories:
- Weak AI (Narrow AI): Focuses on a specific type of task, such as image classification or speech-to-text. All systems currently in practical use belong to this category.
- Strong AI (Artificial General Intelligence, AGI): Refers to intelligence that can flexibly learn and transfer capabilities across multiple domains, reaching or exceeding human levels. It remains an unrealized research goal, with industry estimates on its timeline varying significantly.
3. Machine Learning: From Rule-Based Programming to Data-Driven
Machine Learning is the core subset of AI. Its fundamental idea is to allow computers to learn patterns from data rather than having programmers explicitly write every rule.
3.1 Comparison of Programming Paradigms
The workflow difference between traditional programming and ML is as follows:
- Traditional Programming: Humans write rules, and machines execute them.
- Machine Learning: Humans provide data and corresponding answers, the machine induces the rules from them, and then applies those rules to new data.
Taking house price estimation as an example:
# Traditional programming: humans manually define the formuladef estimate_price(area):return area * 10000# Machine learning: fitting rules from historical datahistorical_data = [(area, sale_price), ...]model = train(features=area, labels=sale_price, data=historical_data)predicted_price = model.predict(new_area)
In the second approach, parameters like unit price are determined by the data; the programmer does not need to know their exact values in advance. The more scenarios the data covers, the broader the model’s applicability.
3.2 Main Learning Types
Machine learning is divided into three main categories based on the learning method:
- Supervised Learning: Training data comes with labels, and the model learns the mapping from input to output. Typical tasks include classification (e.g., spam detection) and regression (e.g., sales prediction).
- Unsupervised Learning: Data has no labels, and the model discovers structures on its own. Typical tasks include clustering (e.g., grouping users by behavior) and dimensionality reduction (e.g., compressing high-dimensional features).
- Reinforcement Learning: An agent interacts with an environment to receive reward signals, gradually learning optimal policies. Typical applications include game playing and robotic control.
The difference among the three lies in whether the data is labeled and where the feedback signal comes from. The choice depends on the task’s data conditions and objectives.
4. Deep Learning: Representation Learning via Multi-Layer Neural Networks
Deep Learning is a branch of ML that uses neural networks with multiple hidden layers (deep neural networks) to learn hierarchical representations of data.
4.1 The Meaning of “Deep”
“Deep” refers to the number of hidden layers in the network. Each layer transforms the output of the previous layer into a more abstract representation. In image recognition, for example: shallow layers usually capture local features like edges and colors, middle layers combine them into textures and parts, and deep layers correspond to holistic object concepts.
4.2 Core Advantages
Traditional ML relies on manual feature engineering, where the quality of features directly determines performance. Deep learning can automatically extract features from raw data, reducing reliance on expert experience. This advantage is particularly evident in high-dimensional, unstructured data such as images, audio, and text.
4.3 Major Network Architectures
- Convolutional Neural Networks (CNNs): Utilize local receptive fields and parameter sharing, excelling at processing images and spatial data.
- Recurrent Neural Networks (RNNs): Process sequence data sequentially by time step, suitable for speech and text, but limited by the difficulty of capturing long-distance dependencies and the inability to parallelize computation fully.
- Generative Adversarial Networks (GANs): Consist of a generator and a discriminator trained against each other, commonly used for image generation.
- Transformer: An architecture based on attention mechanisms, currently the mainstream choice for natural language processing.
5. Transformer: The Core Role of Self-Attention
The Transformer is a specific architecture in deep learning introduced by researchers in 2017. Its core innovation is the self-attention mechanism.
5.1 How Self-Attention Works
When processing text, the model needs to determine the relevance of each word to others. The self-attention mechanism allows each position in the sequence to directly compute association weights with all positions, thereby attending to global information simultaneously. The core calculation can be expressed as:
Attention(Q, K, V) = softmax(Q × K^T / √d_k) × VWhere:Q (Query): The query vector of the current positionK (Key): The key vectors of all positions, used to calculate relevanceV (Value): The value vectors of all positions, aggregated by weightsd_k: The dimension of the key vectors, used to scale the dot product result
Take the sentence “It broke the glass because it was too fragile.” Using attention weights, the model can determine that the second “it” most likely refers to the “glass” rather than another noun.
5.2 Two Improvements Over RNNs
- Long-distance dependencies: RNNs must pass information step-by-step; the further the distance, the more information is lost. Self-attention computes associations between any two positions directly, making distance less of a barrier.
- Parallel computation: Each step of an RNN depends on the previous step’s result, making parallelization difficult. Transformer’s attention computation can be applied to the entire sequence simultaneously, making it better suited for large-scale hardware training.
5.3 Architecture Composition
The original Transformer used an Encoder-Decoder structure. The encoder understands the input, while the decoder generates the output word by word. Building on this, many subsequent LLMs retain only the decoder part, forming a Decoder-only structure. This demonstrates that Transformer components can be pruned and combined according to task requirements.
6. Large Language Models: Scale, Capabilities, and Training
Large Language Models (LLMs) are ultra-large-scale neural networks based on the Transformer architecture, trained on massive amounts of text.
6.1 Where the “Large” Comes In
- Parameter scale: Model parameters can reach tens or hundreds of billions. More parameters theoretically allow the expression of more complex patterns.
- Training data: Training corpora are typically measured in trillions of tokens, covering diverse text sources like web pages, books, and code.
- Compute resources: The training process requires large-scale accelerated computing clusters and takes weeks to months.
Scale brings capability improvements but also new challenges in terms of cost, energy consumption, and evaluation difficulty, which must be considered during engineering selection.
6.2 Main Capabilities
LLMs can perform text generation, comprehension, translation, question answering, code writing, and logical reasoning. These capabilities are not manually coded; they emerge from the statistical patterns in the training data. Therefore, model outputs may contain factual errors, and critical information must be verified.
6.3 Key Technologies
- Pre-training: Learning general language patterns from large-scale unlabeled text, typically using next-token prediction as the training objective.
- Fine-tuning: Continuing training on specific tasks or specific styles of data to better align the model with application needs.
- Prompt Engineering: Guiding the model to output more reliable results by designing the instructions, examples, and formats of the input.
An example of a well-structured prompt:
Role: Senior Backend EngineerTask: Review the boundary conditions of the following functionRequirements:1. List issues by severity;2. Provide the modified code;3. Explain the reason for each modification.Input:(Code to be reviewed)
Clear roles, tasks, constraints, and input formats usually significantly improve output quality.
7. Engineering Implications of the Four-Layer Relationship
Understanding this hierarchy helps in selecting the appropriate method for a specific problem.
| Problem Characteristics | Recommended Layer | Reason |
|---|---|---|
| Clear rules, low variability | Rule-based Systems | Interpretable, low implementation cost |
| Structured tabular data, moderate sample size | Traditional ML | Fast training, stable performance |
| High-dimensional unstructured data (images, audio) | Deep Learning | Automatic feature extraction, high accuracy |
| Open-ended text comprehension and generation | Large Language Models | High versatility, adaptable to multiple tasks via prompts |
Note that the higher the layer, the greater the required data, compute, and operational costs. In scenarios with small data volumes or simple requirements, using higher-layer models is often not worth the cost.
8. Common Misconceptions
Misconception 1: LLMs equal AI. LLMs are merely a specific technical direction within AI. AI also includes rule systems, traditional ML, computer vision, and many other fields.
Misconception 2: Deep learning is always better than traditional ML. Deep learning requires large amounts of data and compute power. In small-sample or tabular data scenarios, traditional methods are usually simpler and may yield better results.
Misconception 3: Large models already possess general intelligence. Currently available systems still fall under the category of Weak AI. They perform well on many tasks but still have significant limitations in reliability, causal reasoning, and verifiability.
9. Summary
Artificial Intelligence, Machine Learning, Deep Learning, Transformers, and Large Language Models form a technical chain from macro to micro. Each layer is a subset of the previous one, solving more specific problems on top of the foundation laid before it. Mastering this hierarchy can help you determine the boundaries of technical solutions, understand the sources of LLM capabilities, and select the appropriate methods for your actual projects.
