What is the difference between AI, machine learning and deep learning?
They are nested categories, not alternatives — each sits inside the one before.
Artificial intelligence is the broadest: any system performing tasks that would normally require human intelligence. It includes approaches with no learning at all. Expert systems encoding rules written by humans, search algorithms, and game-playing programs using hand-crafted evaluation are all AI. Deep Blue beat Kasparov in 1997 using search and human-written evaluation, not learning.
Machine learning is a subset in which systems learn patterns from data rather than following explicitly programmed rules. You supply examples and the algorithm derives the rules.
The main types:
Supervised learning — labelled examples, learning to map inputs to outputs. Spam classification, price prediction.
Unsupervised learning — finding structure in unlabelled data. Clustering, anomaly detection.
Reinforcement learning — learning through trial and reward. Game playing, robotics.
Many highly effective machine learning methods are not deep learning at all — decision trees, random forests, gradient boosting, support vector machines and logistic regression remain the best tools for a great deal of real work, particularly on tabular data, where they frequently outperform neural networks.
Deep learning is a subset of machine learning using neural networks with many layers. Each layer transforms its input, and stacking them allows the system to learn hierarchical representations — early layers detecting edges, later ones shapes, later still objects.
Its defining advantage is that it learns useful features automatically from raw data, where earlier approaches required humans to design them by hand. That is why it transformed image recognition, speech and language, where hand-crafted features had stalled.
Its costs: very large data requirements, substantial compute, and poor interpretability — it is often impossible to explain why a given output was produced.
Generative AI is a use case within deep learning, producing new content rather than classifying existing content.