AML Wiki Review copy, version 1.1, 12 November 2026
algebraic.ai

Examples

The 4×4 image example

Stub

This page is a stub: a first draft that has not yet been reviewed.

One small example shows the whole method of Algebraic Machine Learning (AML) at a size where every atom can be inspected: a rule about small black-and-white images is recovered from the images alone.

The task

The task concerns black-and-white images of 4×4 pixels. A set of 3,375 of them share a hidden rule: the first column is entirely black, and none of the other three columns is entirely black. The learner is not told the rule. It is given the images, each with the statement that the image has a certain property. The property is written \(p\).1

The embedding

There are 32 constants for the 16 pixels in black or in white, and one constant for the property \(p\): 33 constants in all. Each image is a term \(T_i\) with 16 component constants, and each training example is a positive duple \(p \leq T_i\).

Full Crossing

The initial model is the freest semilattice, atomized by \(\{\phi[c_1], \phi[c_2], \dots, \phi[c_{32}], \phi[c_p]\}\). The 3,375 duples are enforced one by one.

The number of atoms

As the procedure progresses, the number of non-redundant atoms increases to approximately 6,000 and then decreases to 51. Grouped by size, that is, by the number of constants in the upper constant segment, the atoms with 1, 2, 3 and 5 constants quickly stabilize at 32, 4, 12 and 3 atoms. Larger atoms appear early, increase in number, and are then removed by further full-crossings.2

The final model

The 51 atoms of the final model fall into four groups.3

AtomsConstants in each atomWhat they capture
32One constant: a pixel in a colourThese atoms were already in the initial model
4\(p\) and one of the four constants for a black pixel in the first columnAll images contain a black vertical bar in the first column
12\(p\) and the black and the white constant of one pixel of the last three columnsEach pixel in the last three columns can be either black or white
3\(p\) and the four white constants of one of the last three columnsEach of the last three columns is never completely black

The final freest model thus reveals the hidden rule explicitly in its non-redundant atoms.4

An intermediate model

After 200 full-crossings the model already contains all the atoms of the final model. It also contains larger atoms, all of which are eventually removed in later crossings.5 Extracting the non-redundant atoms of the final model at 200 crossings would give a perfect generalizing model.

Extracting the rule early

The selection method uses a training set of negative duples: counterexample images that do not follow the hidden rule. Before 200 crossings, the method extracts the 4 atoms that contain \(p\) and one other constant, and the 3 atoms that contain \(p\) and four white-pixel constants. It does not extract the 12 atoms that contain \(p\) and the black and white constants of the same pixel. Those atoms encode that every positive example has either the black or the white constant at each location of the last three columns; since the counterexamples are also images, the atoms do not discriminate any of them. The subset extracted is “a generalization model with zero error”.4

In general, the method finds the atoms that correspond to rules satisfied by the positive examples and not by the negative examples of the training set.

References

  • Martin-Maroto, Abderrahaman, Méndez and de Polavieja (2025), Algebraic Machine Learning: Learning as computing an algebraic decomposition of a task, arXiv:2502.19944.

See also

Try it

The Vertical Bar tutorial runs this example with Sparse Crossing and plots the atoms it finds beside the atoms of the exact solution.

Footnotes

  1. Martin-Maroto et al. (2025), section “Freest atomized model of the task’s axioms”. ↩

  2. Martin-Maroto et al. (2025), Figure 2b. ↩

  3. Martin-Maroto et al. (2025), Figure 2c. ↩

  4. Martin-Maroto et al. (2025), section “Generalizing models”. ↩ ↩2

  5. Martin-Maroto et al. (2025), Figure 2d. ↩