Deep Learning Foundations


Deep Learning Foundations

Maria
Today we're discussing Understanding Deep Learning, a book deliberately focused on the ideas behind deep learning rather than on coding recipes. The aim is to take a reader from the basics to somewhere close to the cutting edge, so they can apply deep learning in unfamiliar situations where no existing recipe guarantees success.

Simon
Exactly. The book starts directly with deep neural networks instead of beginning with a long historical tour through perceptrons. It explains the training and testing pipeline, how performance can be improved, and then moves through major architectures, including convolutional networks, residual networks, graph neural networks, and transformers.

Maria
It also has a substantial section on generative models: normalizing flows, variational autoencoders, generative adversarial networks, and diffusion models. Reinforcement learning appears in a shorter final technical section, while two broader chapters ask why deep networks work and what ethical responsibilities come with building them.

Simon
The book is designed for several audiences. A beginner can use it as a route into deep learning, teachers can use it as a resource, and practitioners or researchers can use it to fill gaps in their knowledge. It contains 275 figures, most of them newly created, along with Python notebooks, but the emphasis is not on supplying code or formal proofs.

Maria
That middle ground is important. It is neither a highly theoretical book packed with proofs nor a practical manual packed with implementation details. Instead, it tries to explain the concepts through text, equations, and visualizations, because connecting those three representations can produce a deeper understanding.

Simon
And the title is intentionally ironic. Nobody currently understands deep learning in the strongest sense. We know how to define parameterized models, optimize them with algorithms such as gradient descent, and observe impressive results, but we do not have a complete explanation of how these models learn the functions they learn or why they generalize so effectively.

Maria
One useful way to view a deep network with ReLU-like activations is as a function that divides its input space into many regions. Within each region, the function is linear or, more precisely, affine. The network therefore creates a complicated piecewise-linear surface, and the number of regions can become extraordinarily large—far larger than the number of atoms in the universe for many models.

Simon
That picture makes the mystery sharper. A model can have millions or billions of parameters and create an enormous number of possible regions, yet training often finds a useful solution with noisy gradient-based optimization starting from random initialization. We still do not fully understand why this process is reliable, efficient, or capable of finding sensible behavior between the training examples.

Maria
AlexNet provides a striking example. ImageNet images occupy an input space of roughly 150,000 dimensions, with an unimaginably large number of possible images, while the training set contained about one million examples. AlexNet nevertheless used around 60 million parameters and achieved a major improvement over the previous best computer-vision systems.

Simon
At first glance, that seems like a recipe for disaster. The network has enough flexibility to pass through the training data while doing almost anything elsewhere. Yet it performs well on unseen examples. The usual explanations, such as dropout or explicit regularization, do not fully solve the mystery, because networks can still generalize reasonably well without those particular ingredients.

Maria
This connects to the apparent reversal of a familiar statistical intuition. Classical thinking suggests that increasing model complexity should eventually hurt generalization. But in deep learning, adding parameters can improve generalization, a phenomenon associated with overparameterization and sometimes with double descent.

Simon
Even the claim that these models are clearly overparameterized needs care. AlexNet had about 60 million parameters and one million original training examples, but the data were augmented with roughly 2,048 transformations. GPT-3 had 175 billion parameters and was trained on about 300 billion tokens. So it is not always obvious how to count the effective data or determine whether the model is genuinely overparameterized.

Maria
The puzzle has several parts. First, it is not obvious that a typical data set contains enough information to characterize the input-output relationship. Second, deep networks represent extremely complicated functions. Third, generalization can improve as the number of parameters increases, even though that gives the model enormous freedom between training points.

Simon
One line of analysis argues that overparameterization and the choice of activation function make optimization tractable. During training, parameters may move through a relatively low-dimensional subspace toward a connected family of global—or effectively equally good—minima, rather than becoming trapped in problematic local minima. But this is not a complete prescriptive theory: we still cannot reliably predict when a particular model will train or generalize successfully.

Maria
The shape of the loss surface also matters. Initialization, learning rate, stochasticity, activation functions, and parameter magnitudes can affect both training time and generalization. If parameters are too large, the network may produce sharp, wildly varying functions; if they are too small, the functions and gradients may become too flat. There seems to be a Goldilocks zone, but the deeper reason for it remains subtle.

Simon
Initialization also relates to exploding and vanishing gradients. Poorly chosen scales can cause activations or gradients to become so large that finite-precision computation fails, or so small that useful signals disappear. Interestingly, the magnitude of the initialization can influence not only whether training works, but also how long training takes and how well the final model generalizes.

Maria
A related phenomenon is grokking. A model may fit the training data perfectly for a long time while generalizing poorly, then later show a sudden improvement in generalization. One interpretation is that the network initially fits the examples with a complicated function and then moves through a family of good solutions toward a smoother one.

Simon
But we should not assume that convergence time directly tells us how difficult a task is. Neural networks can even fit data with randomly shuffled labels or randomly perturbed inputs. They may learn such data more slowly because the function has to contort itself, but the fact that they can fit it demonstrates their enormous flexibility. If the labels contain no meaningful information, however, interpolation between them has no useful meaning.

Maria
The manifold hypothesis offers one possible explanation for generalization. Although the ambient input space may be huge, natural data occupy a much smaller structured subset. Natural images, for example, are not arbitrary arrangements of pixels; they reflect regularities in objects, materials, lighting, and geometry.

Simon
Data augmentation and architectural design can encode some of those regularities. If a transformation should not change the class, the model can be encouraged to be invariant to it. If the output should transform along with the input, the model can be made equivariant. Convolutional networks are one example of restricting the model to a more sensible family than a completely unconstrained fully connected network.

Maria
This is also a bias-variance trade-off. A completely generic multilayer perceptron knows little about the structure of images, so it may need many examples of transformed versions. A model with suitable domain knowledge needs fewer examples, but too much prior structure could prevent it from representing the task. The challenge is finding the useful middle ground.

Simon
Depth is another unresolved issue. The universal approximation theorem says that a sufficiently wide single-hidden-layer network can approximate a broad class of functions to arbitrary precision. But that does not explain why successful modern systems often need many layers. One interpretation is that depth progressively folds, clips, and recombines regions of the input space, producing increasingly structured functions instead of simply memorizing with a huge collection of basis functions.

Maria
The book also discusses training techniques whose real effects are often different from their original motivations. Stochastic gradient descent is not mainly useful because it reliably bounces out of local minima; large-batch or even full-batch methods can also reach good solutions. Stochastic updates are fast and can have an implicit regularization effect that changes the path through the loss surface.

Simon
Batch normalization is another example. It was introduced to address covariate shift, but later work questioned whether that explanation was correct. It can help control exploding gradients, introduce a regularizing noise effect, and allow information to leak between examples in a batch. That is one reason layer normalization is preferred in transformer settings with masked attention, where information from later tokens must not leak backward.

Maria
This illustrates a broader issue with deep-learning research. Experimentalists often discover modifications that improve benchmark performance before theory explains them. Many proposed improvements are small engineering variations, and later ablation studies sometimes show that components believed to be essential make little difference.

Simon
The field is also heavily driven by state-of-the-art results. A tiny benchmark improvement can require enormous computation and data, while offering little scientific insight. Comparisons can be misleading if different systems use different amounts of pretraining, augmentation, or compute. For example, it is not enough to conclude that one architecture is inherently superior until genuinely comparable experiments have been performed.

Maria
The book proposes smaller, more manageable testbeds as a way to do better science. One example is a one-dimensional version of MNIST with 40-dimensional procedurally generated data. Despite its small size, it can display phenomena such as adversarial examples, lottery-ticket behavior, and double descent, while being fast enough to study systematically on a CPU.

Simon
That matters because researchers could vary architectures, data statistics, noise, and optimization settings across many experiments, then try to build actual predictive theories of trainability and generalization. The current culture often rewards large-scale benchmark improvements instead, even though many deep-learning phenomena do not require enormous models or data sets to observe.

Maria
The discussion of language models follows the same cautious spirit. A transformer predicts the next token from its context, and its apparent abilities can reflect the richness of the data it has absorbed. It is useful to describe the model as a very large parameterized equation rather than automatically assuming that it has human-like thoughts or mental states.

Simon
Transformers do have a context window that resembles a kind of short-term memory, but that does not by itself provide a persistent, internally coherent model of the world. A language model can contain statistically supported statements that conflict with one another, such as both flat-Earth and round-Earth claims, without resolving them into a consistent theory.

Maria
Human cognition also involves mistakes and contradictions, but humans generally build working models because they must act in the world. We form hypotheses, notice when they fail, revise them, and use the revised models to guide future actions. A plain feedforward language model does not obviously perform that cycle: it predicts from context and, without an external mechanism, does not permanently learn from the current conversation.

Simon
That is why simply knowing a huge amount of information is not the same as thinking or discovering new facts. A system that learned only historical data before Einstein would not automatically be expected to derive relativity. To create a new theory, a system would need to detect inconsistencies, construct a new model, generate predictions, and test or retain the results.

Maria
The same caution applies to claims about superintelligence or artificial general intelligence. The discussion is clearer when we talk about concrete capabilities rather than using intelligence as if it were a single measurable substance. A model may outperform people on some tasks while remaining unreliable, lacking persistent memory, and failing badly outside the statistical regularities represented in its training data.

Simon
Reinforcement learning is relevant because it explicitly involves an agent interacting with an environment and receiving rewards. But even there, the reward function and the system's structure are designed by people. The question of whether such a system has agency in a rich human sense is much more complicated than the fact that an algorithm explores actions and receives feedback.

Maria
The final major theme is ethics. The book argues that it would be irresponsible to teach deep learning without discussing its consequences. Artificial intelligence could bring major benefits in health care, design, entertainment, transport, education, and commerce, but the potential for harm is also substantial.

Simon
Ethics cannot be reduced to a label such as 'AI for social good.' One project might use AI to support police accountability and alternatives to incarceration, while another might use predictive policing to increase security. Both could be advertised as socially beneficial, but the label itself is a value judgment. What benefits one community may harm another.

Maria
Important practical concerns include bias, explainability, misinformation, fairness, energy use, and the effects of automated decisions. A single objective such as predictive accuracy may conflict with fairness across groups, especially when some populations or intersections of characteristics have very few examples in the training data.

Simon
Researchers should therefore ask who will be affected, which organizations they are willing to work for, and whether those organizations genuinely create mechanisms to stop ethically suspect projects. Some institutions may practice ethics washing—adopting ethical language mainly to reduce reputational risk—without changing their behavior.

Maria
The responsibility is collective, but that does not eliminate individual responsibility. No single computer scientist controls every consequence of a technology, yet individuals can choose employers, research problems, deployment settings, and whether to raise concerns. Scientists and engineers should recognize that technical decisions are never completely value-free.

Simon
The social effects also include employment and deskilling. Automation may not eliminate an entire profession overnight; instead, one worker may be able to perform the work formerly done by many. That can reduce the number of people hired, alter the status attached to an occupation, and create social disruption faster than institutions can adapt.

Maria
There is also a danger in gradually surrendering skills. If an automated system handles ordinary situations and calls a human only during rare emergencies, the human may have less experience precisely when expert judgment is most needed. The Air France crash discussed in the source is presented as an example of how reduced recent practice and an unusually dangerous situation can combine.

Simon
So the book does not offer a simple prediction that AI will produce either utopia or catastrophe. It calls for caution, critical reflection, and attention to risks at multiple timescales: current harms such as bias and misinformation, social changes such as employment disruption and deskilling, and more speculative questions about advanced systems.

Maria
That combination captures the purpose of Understanding Deep Learning. It teaches the architectures and techniques, but it also emphasizes how little we know about why deep networks optimize and generalize, why empirical success is not the same as scientific understanding, and why technical capability must be considered alongside social responsibility.

Simon
In short, the book aims to give readers enough conceptual grounding to reason in new situations rather than follow recipes. Deep learning is extraordinarily effective, but its success remains surprising. Understanding both what the models can do and what remains mysterious is essential for using them intelligently and responsibly.

Ask anything
We've read this whole study set, so questions about it get the best answers.