Learning and Memorization

Satrajit ChatterjeeICML 2018

Can a machine learn if all it can do is memorize? In classical machine learning theory, memorization is often viewed as the enemy of generalization—a phenomenon known as overfitting. However, recent high-profile work has shown that deep neural networks are perfectly capable of memorizing training sets with completely random labels, yet they still generalize well on real data. This raises a fundamental question: if a network has the capacity to memorize everything, why does it bother to learn general patterns?

This paper investigates whether generalization can emerge from "pure" memorization. By stripping away the complexities of gradient descent, continuous weights, and complex activation functions, the author demonstrates that a deep network of simple lookup tables—which "learn" by simply counting occurrences—can generalize to unseen data surprisingly well. The results suggest that the perceived tension between memorization and generalization might be a false dichotomy, and that architectural depth itself may be a primary driver of generalization.

Networks of Lookup Tables

The author proposes a model composed entirely of networks of support-limited lookup tables (LUTs). Instead of traditional artificial neurons, the network uses LUTs arranged in layers. Each LUT takes exactly $k$ bits as input from the previous layer (or the raw input) and outputs a single bit. The $k$ inputs for each LUT are chosen at random during the network's construction.

Training this network is purely a "memorization" step that happens layer-by-layer. For a given LUT, the model looks at all training examples and records which output label (0 or 1) is most commonly associated with each of the $2^k$ possible input patterns. Essentially, it builds a truth table based on the training data. If a pattern hasn't been seen, the tie is broken randomly.

To classify a new image during inference, the bits are simply passed through these pre-computed tables. Crucially, there is no optimization (like Stochastic Gradient Descent) or backpropagation. The model simply "remembers" what it saw locally.

The Mechanics of Memorization and Generalization

A single, massive lookup table would perfectly memorize the training set but fail to generalize to new data. However, a hierarchy of small lookup tables (small $k$) forces the model to find local patterns that repeat across the dataset, leading to generalization.

The size of the lookup table, $k$, acts as a "knob" for the memorization-generalization tradeoff. Small $k$ values generalize better because each row in the table is backed by more training examples, increasing the stability of the predictions. Conversely, large $k$ values allow for perfect memorization of the training set but cause test accuracy to plummet.

Training and test accuracy across different values of k

Furthermore, just like real neural networks, this LUT-based model finds it "harder" to memorize random labels than real labels. It requires a much larger $k$ (more capacity) to hit zero training error on random data than on structured, real-world data. Because the algorithm is so simple—relying just on counting and table lookups—it provides a "clean room" environment to study how depth and stability contribute to learning without the black-box nature of gradient descent.

Performance on Standard Benchmarks

The experiments focus on binary classification tasks derived from two standard benchmarks: Binary-MNIST (classifying 1-bit quantized digits 0-4 vs. 5-9) and Binary-CIFAR-10 (pairwise classification on 1-bit quantized images).

Despite its simplicity, the memorization model achieves competitive performance. On Binary-MNIST, the model reached 90% test accuracy with $k=12$. While lower than a LeNet-style ConvNet (98%), it significantly outperformed standard baselines like Naive Bayes (77%) and Logistic Regression (87%). On Binary-CIFAR-10, the model achieved 63% test accuracy, matching the performance of a 1-Nearest Neighbor classifier.

Accuracy comparison of the memorization model against standard baselines

The paper also highlights that accuracy improves steadily as data moves through the layers. For instance, accuracy might start at 51% at the input layer and climb to 89% by layer 6, demonstrating that depth effectively distills information. Additionally, the model is remarkably stable, yielding consistent results across different random network constructions.

Limitations and Future Directions

While impressive for a "pure memorization" approach, the model has constraints. It is currently limited to Boolean (binary) inputs, and extending this to continuous, real-valued data remains a challenge. Additionally, there is still a performance gap compared to state-of-the-art convolutional neural networks.

Currently, the LUTs are connected randomly. Incorporating structural priors—such as the local connectivity found in convolutions—could significantly boost performance. Finally, the author points toward a deeper connection between this approach and the concept of "algorithmic stability," suggesting that future work could formally link these lookup-table networks to statistical learning theory.

Summary updated

BibTeX
@inproceedings{chatterjee2018learning,
  author = {Satrajit Chatterjee},
  title = {{Learning and Memorization}},
  booktitle = {International Conference on Machine Learning},
  year = {2018},
}
Figure