Is generalization compressed memorization?
What if the distinction between memorization and generalization is partly a distinction between representations of the same knowledge? A conversation about machine learning led me to a deliberately small example: the six faces of a die.
1. A closed world
Imagine a die whose six possible face values are the complete set of target states. Start with six canonical images, one per face. Every image is a 7 × 7 square grid with one black pixel per pip, white spacing between possible pip locations and padding around the boundary.
To serialize a grid, read each row left to right, starting at the top. The diagram shows how three rows become one sequence. The interactive below does the same for die faces 1 and 5, recording a 1 for each black pixel and a 0 for each white pixel.
Die face 1
Serialized version
Row 4, column 4 → bit 25 · value 1
Die face 5
Serialized version
Row 4, column 4 → bit 25 · value 1
The distinction matters: the state is the face value; the observation is a 49-bit image of it. The images are familiar to humans because we already understand dice. To a computer, they are initially just arrays of bits. The six images occupy 294 raw bits before metadata or shared encoding.
2. Compression by elimination
Suppose we remove a pixel and test whether the remaining representation still permits perfect identification across all six images. If no information necessary to the task disappears, the pixel was redundant for that task. Repeat the experiment, retaining only reductions that preserve accuracy.
- 49Original face 56 of 6 faces distinguishable
- 48Remove row 1, column 76 of 6 faces distinguishable
- 47Remove row 1, column 66 of 6 faces distinguishable
- 46Remove row 1, column 56 of 6 faces distinguishable
Tap squares to retain them. Tap again to remove them from the function. Red borders indicate the selected squares in both representations.
Serialized version
0 selected squares · Sum for face 5: 0
Selected bits: —
1 distinct signature across 6 faces
Try the automatic elimination sequence
Move through the successful deletions to select the pixels remaining at that step.
Step 0 · 49 pixels retained
We could also search rectangular resolutions: 7 × 7 → 7 × 6 or 6 × 7 → 6 × 6, and so on. At each step we must specify the transformation (for example, deleting rows or columns, pooling or re-encoding), apply it consistently to every observation, and assess whether any distinct face values become indistinguishable.
- 49Original binary pixelsFace 5 on a 7 × 7 grid
- 7Possible pip positionsGray cells are discarded
- 4Selected original pixelsA B C M →
1110 - 3New binary codeCode assigned to face 5
100
1110. A new encoding assigns it the code 100.This is an example of semantic compression: reducing a representation while preserving the meaning relevant to a particular task. We do not need to reproduce the entire image if all we want is the face value. How much can we remove before we can no longer resolve the symbol?
In Tesla's driving AI, the model maps a stream of video and vehicle data to driving commands. Details of leaves on a tree may be irrelevant to those commands, whereas a pedestrian or a traffic light is not. The meaning worth preserving depends on the task.
In this fixed dataset, 42 positions are always white. They can be omitted losslessly if their locations are known. The seven remaining positions contain all the varying visual information. A smaller subset can still preserve identity.
3. Selecting pixels is not the same as re-encoding
For these exact orientations, select the top-left pip (A), top-right pip (B), center pip (C), and left-middle pip (M). Each face produces a distinct signature. The other pip positions duplicate one of these four signals.
| Face | A B C M | 3-bit code |
|---|---|---|
| 1 | 0010 | 000 |
| 2 | 1000 | 001 |
| 3 | 1010 | 010 |
| 4 | 1100 | 011 |
| 5 | 1110 | 100 |
| 6 | 1101 | 101 |
Four original pixel positions are necessary: faces 1 and 3 require A (or its duplicate), 2 and 4 require B (or its duplicate), 4 and 5 require C, and 4 and 6 require M (or its duplicate). These four disjoint requirements establish the minimum for pixel selection. This is different from constructing a new code, where three binary bits suffice.
Three bits support 2³ = 8 distinct codes. Two bits support only 2² = 4. Since there are six target classes, a fixed-length binary representation requires at least ⌈log₂ 6⌉ = 3 bits. No clever encoding can make two bits distinguish six values without additional information.
But there is another way to represent the same knowledge. Rather than remembering where the black pixels are, count them. For our canonical binary images, the function f(I) = sum(I) returns the face value, even if the five black pixels move to different locations. We have exchanged a collection of memorized examples for a rule.
The interesting question is whether a learning algorithm could discover such a rule from the examples alone. Pixel elimination is one small step in that direction, but discovering a counting function requires a different kind of transformation. It is not a guaranteed consequence of deletion. The three-bit result also describes the output, not the complete storage or computational cost of the function that produces it.
4. Local versus global minimality
Removing one feature at a time until no further deletion works yields a locally minimal subset. It need not have the fewest elements among all possible subsets. To guarantee the global minimum under pixel selection, one could enumerate every subset and retain the smallest one that preserves all six identities. For 49 pixels, there are 2⁴⁹ = 562,949,953,421,312 possible subsets. The search is finite, but exponential.
Allowing transformations rather than deletion alone expands the search space. A three-bit code is an information-theoretic floor for the output representation, not a proof that the encoder implementing it is small or computationally efficient.
5. Expanding the observation space
Now run the thought experiment in reverse. A die might be represented by a 10 × 10 raster, a million-pixel photograph, or a camera image taken at a different angle. Pips may be circles, squares or stars. Color, texture, illumination, perspective and background can all vary.
These variations increase the observation space without necessarily increasing the number of target classes. A representation that discards the variations while preserving face value is invariant to them. The desired abstraction maps all observations of the same value to a common representation, while maintaining separation between different values.
6. When memorization and generalization meet
Imagine photographing every face of every die in a fixed universe, from every permitted camera angle and under every permitted condition. Assume the face value is determinable from each observation, and that the collection really does cover the observation domain. A lookup table could memorize the entire mapping and achieve perfect accuracy. A compressed model could achieve the same accuracy with a more economical representation.
Within that closed domain, there are no unseen observations on which to distinguish the two by predictive accuracy. We can instead distinguish them by storage, computational cost, and the structure of their representations. In an open world, however, generalization retains its usual meaning: performance on observations not used to fit the model. Compression can encourage it but does not guarantee it.
Hypothesis: under complete state coverage, we can search for increasingly compact task-sufficient representations, until an information-theoretic or representation-specific limit prevents further reduction.
7. What this suggests about intelligence
Perhaps an important aspect of intelligence is the discovery of invariants: recognizing what can change without changing the answer. The die experiment gives a concrete way to investigate that idea. Starting from an exhaustive set of observations, propose a reduction, check whether the task still works, and continue while information remains redundant.
The analogy is intentionally limited. Complete coverage is an idealization, and a compact latent code does not account for the cost of the encoder, nor prove transfer to new tasks. An exhaustive search over a finite set of allowed transformations can establish a minimum within that set; an arbitrary greedy compression path cannot. Nonetheless, this toy problem separates three ideas that are often conflated: memorization stores observations or answers, abstraction constructs a representation, and generalization measures its ability to work beyond the examples used to construct it.
This is the beginning of an ongoing exploration: how far can we take the relationship between compression, abstraction, memorization and intelligence?