DATASCI 447 Lecture 7: What do Neural Networks Actually Learn?

Kevin McAlister

February 3, 2026

Administrative Stuff

RECAP: THE CURSE OF DIMENSIONALITY

Stone’s Minimax Theorem: The best achievable rate of convergence is

\[O\left(N^{-\frac{2S}{2S+P}}\right)\]

As \(P\) increases, this rate becomes glacially slow

  • \(P = 10\): Need \(\sim 10^{12}\) samples for 1% error
  • \(P = 100\): Need \(\sim 10^{102}\) samples for 1% error

No algorithm can escape this — it’s a fundamental property of high-dimensional learning

Question: Is there any hope? What assumption might let us escape this bound?

RECAP: THE MANIFOLD HYPOTHESIS

Real high-dimensional data doesn’t fill the ambient space

The hypothesis: Data lies on \(\mathcal{M}^K\) embedded in \(\mathbb{R}^P\) where \(K \ll P\)

Real images, text, and audio occupy a tiny fraction of the possible space

If we can find \(\phi: \mathbb{R}^P \rightarrow \mathbb{R}^K\) that captures manifold structure, we can learn in \(K\) dimensions instead of \(P\)

Question: How do we actually find this mapping \(\phi\)?

RECAP: THE REPRESENTATION LEARNING FRAMEWORK

┌─────────────┐     ┌────────────┐     ┌─────────────────┐     ┌───────────┐
│ Raw Features│     │ Projection │     │ Representation  │     │  Simple   │
│     ℝᴾ      │ ──▶ │     φ      │ ──▶ │       ℝᴷ        │ ──▶ │ Classifier│
│(e.g., 4096  │     │            │     │  (e.g., 50 dims)│     │(e.g., log)│
│   pixels)   │     │            │     │                 │     │           │
└─────────────┘     └────────────┘     └─────────────────┘     └───────────┘

The heavy lifting is in the projection \(\phi\), not the classifier!

Question: What’s the simplest projection \(\phi\) we could use? Does it have a closed-form solution?

RECAP: PCA AS LINEAR φ

We explored PCA as a linear projection:

Closed-form solution: Top \(K\) eigenvectors of covariance matrix \(S = \frac{1}{N}X^TX\)

Optimal for reconstruction: Minimizes \(\sum_{i=1}^{N} \|x_i - \hat{x}_i\|^2\)

Equivalent to linear autoencoder: Encoder and decoder are tied

\[z = W^T x, \quad \hat{x} = W z\]

Question: PCA is optimal for linear projections and autoencoding. When might it fail? What kinds of transformations can it do?

RECAP: PCA FAILS ON NONLINEAR MANIFOLDS

Swiss roll: PCA rotates but cannot unroll

Rotated horses: Linear interpolation gives ghostly blends

The core problem: Covariance only captures linear relationships

\[\text{Cov}(X_i, X_j) = \mathbb{E}[(X_i - \mu_i)(X_j - \mu_j)]\]

This misses circular patterns, rotations, and nonlinear deformations

THE NEURAL NETWORK ANSWER

Replace linear projection with a learned nonlinear projection:

\[\phi(x) = \varphi(Wx + b)\]

Where:

  • \(W \in \mathbb{R}^{M \times P}\) — learned weight matrix
  • \(b \in \mathbb{R}^M\) — learned bias vector
  • \(\varphi(\cdot)\) — elementwise nonlinearity (e.g., ReLU)

The classifier on top is still just logistic regression!

All the representational work happens in learning \(\phi\)

TODAY’S KEY QUESTIONS

  1. Why should this work at all? What guarantees that such a \(\phi\) exists?

  2. When does this approach actually help? Versus simpler methods like trees?

  3. What does the network actually learn? Can we interpret the representation?

THE GOAL: TASK-OPTIMAL REPRESENTATIONS

With PCA, we found \(\phi\) that minimizes reconstruction error

But we don’t care about reconstruction — we care about classification or regression

The new goal: Find \(\phi\) such that a simple classifier achieves low task loss

\[\min_{\phi, \theta} \sum_{i=1}^{N} L(y_i, f_\theta(\phi(x_i)))\]

Where \(L\) is cross-entropy (classification) or MSE (regression)

The representation should be optimized for what we actually want to do

WHAT DOES “OPTIMAL” MEAN FOR CLASSIFICATION?

For classification, the ideal representation makes classes linearly separable

If classes are linearly separable in \(\phi\)-space, logistic regression achieves zero training error

The question: Does such a \(\phi\) always exist?

LINEAR SEPARABILITY IN HIGH DIMENSIONS

Theorem: Any \(N\) points with distinct locations can be perfectly separated by a hyperplane in \(N-1\) dimensions or higher

Intuition: More dimensions = more degrees of freedom for placing a hyperplane

Extreme case: Map each point to its own dimension

\[\phi(x_i) = e_i = (0, \ldots, 0, 1, 0, \ldots, 0)\]

Now any labeling is trivially separable — but this is just memorization!

A SIMPLE EXAMPLE: CONCENTRIC CIRCLES

No line can separate blue from red!

THE KEY INSIGHT: ADD A DIMENSION

What if we add a third dimension based on distance from origin?

\[\phi(x_1, x_2) = (x_1, x_2, x_1^2 + x_2^2)\]

The inner circle has small \(x_1^2 + x_2^2\), the outer circle has large \(x_1^2 + x_2^2\)

CONCENTRIC CIRCLES IN 3D

A horizontal plane now separates the classes!

THE TRANSFORMATION MADE IT POSSIBLE

The transformation \(\phi(x) = (x_1, x_2, x_1^2 + x_2^2)\) “lifted” the data into a space where a hyperplane works

But: We had to know the right transformation! What if we don’t?

THE PROBLEM WITH HAND-CRAFTED FEATURES

For concentric circles, \(\phi(x) = (x_1, x_2, x_1^2 + x_2^2)\) works perfectly

But:

  • How did we know to use \(x_1^2 + x_2^2\)?
  • What if the pattern is more complex?
  • What if we’re in 1000 dimensions?

We need a way to learn the right transformation from data

NEURAL NETWORKS: LEARNING THE TRANSFORMATION

A single hidden layer with \(M\) units:

\[\phi(x) = \sigma(Wx + b), \quad W \in \mathbb{R}^{M \times P}, \quad b \in \mathbb{R}^M\]

This maps \(\mathbb{R}^P \rightarrow \mathbb{R}^M\)

Key insight: The network learns \(W\) and \(b\) to make the classification easy

THE MODEL PATH: FROM LINEAR TO INTERPOLATION

Hidden Units \(M\) Representation Capability
\(M = 0\) \(\phi(x) = x\) Linear classifier only
\(M\) small Low-dimensional nonlinear Limited flexibility
\(M\) moderate Rich nonlinear features Good generalization (hopefully)
\(M \to \infty\) Can separate any configuration Perfect training accuracy

We have a dial that goes from underfitting to interpolation

\(M = 0\): THE LINEAR BASELINE

With no hidden layer:

\[\hat{y} = \text{softmax}(Vx + c)\]

This is just multinomial logistic regression

  • Decision boundaries are hyperplanes in input space
  • Cannot separate XOR, circles, or any nonlinearly separable data

HOW RELU CREATES “FOLDS”

Each hidden unit computes:

\[h_j = \varphi(w_j^T x + b_j) = \max(0, w_j^T x + b_j)\]

This creates a fold in the input space along the hyperplane \(\{x : w_j^T x + b_j = 0\}\)

  • Positive side: unit outputs the linear function
  • Negative side: unit outputs zero (folded flat)

THE ADDITIVE STRUCTURE

The full model:

\[f(x) = \sum_{j=1}^{M} v_j \cdot h_j + c = \sum_{j=1}^{M} v_j \cdot \max(0, w_j^T x + b_j) + c\]

\[P(y=1) = \sigma(f(x)) = \frac{1}{1 + e^{-f(x)}}\]

Each hidden unit contributes a scaled fold to the linear predictor

The decision boundary is where \(f(x) = 0\)

M = 1: ORIGINAL RELU OUTPUT

\[h_1 = \max(0, w_1^T x + b_1)\]

One fold — a single tilted plane clipped at zero

M = 1: SCALED RELU OUTPUT

\[v_1 \cdot h_1\]

The coefficient \(v_1\) scales the fold (positive → blue, negative → red)

M = 1: LINEAR PREDICTOR (SUM)