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

The learning principle

Encoding a task

Before Algebraic Machine Learning (AML) can learn a task, the task has to be written in the algebra. This step is called a semantic embedding.

Axioms

The task is written as a set of axioms. Each axiom relates two terms and says either that the first is contained in the second, or that it is not. “This image is a 7” is an axiom of the first kind: the label is contained in the image. “This image is not a 3” is an axiom of the second kind. The first kind is called positive and the second negative.

An axiom is given by a duple, an ordered pair of terms \(r \equiv (T_L, T_R)\). In a model \(M\) the duple is positive, written \(r^+\), if \(M \models T_L \leq T_R\), and negative, written \(r^-\), if \(M \models T_L \not\leq T_R\). The notation \((T_L, T_R)\) by itself is silent about which of the two holds.1 A task is a set of positive duples \(R^+\) and a set of negative duples \(R^-\), and its axioms are \(R = R^+ \cup R^-\).2

Everything the learner is told takes this one form. Labelled examples become axioms. So do the goal of the task and anything known in advance, such as the rules of a game or the shape of a graph. A task can therefore be made of data, of rules, or of both.

The name

Semantic embeddings were introduced by mathematical logicians as encodings of algebraic structures within other algebraic structures, and have been used extensively in the study of undecidability. Types of semilattice embeddings are studied, with examples, in Semantic embeddings in semilattices.3

Encodings in use

Black-and-white images. At each pixel location one constant represents the pixel in black and another represents it in white. An image is the term formed by the idempotent summation of its pixel constants.4

Labels. A class is a constant, such as \(digit_i\) for the ten classes of handwritten digits. A labelled training example becomes the positive duple \(digit_i \leq image_k\), and the other classes give negative duples of the form \(digit_{j \neq i} \not\leq image_k\).4

Greyscale and colour. In place of two constants per pixel, two sets of constants are used for each pixel position \(i, j\) and colour channel \(k\), with as many constants as intensities. The sets are ordered as chains, one ascending and one descending:

\[l_{i,j,k}(intensity) \leq l_{i,j,k}(intensity + 1), \qquad g_{i,j,k}(intensity + 1) \leq g_{i,j,k}(intensity).\]

An intensity value is embedded as the idempotent summation \(l_{i,j,k}(intensity) \odot g_{i,j,k}(intensity)\), and an image as the idempotent summation of these over all pixel locations and colour channels. The embedding uses \(2 \times resolution\) constants and \(2 \times (resolution - 1)\) positive duples for each pixel and colour channel.4

Constraints and goals. A problem can be embedded with no data at all. For Hamiltonian cycles the embedding has constants for the nodes and edges of the graph and for the path sought, and axioms that describe the graph and what a Hamiltonian cycle is.5 See Hamiltonian cycles and Sudoku.

Explicit embeddings. One further notion matters for problems given by a specification. For a type of embedding called an explicit embedding, each solution of the problem has a model atomized by a subset of the non-redundant atoms of the freest model of the axioms. The result is proved in Semantic embeddings in semilattices.5

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.
  • Martin-Maroto and de Polavieja (2022), Semantic embeddings in semilattices, arXiv:2205.12618.

See also

Try it

The Vertical Bar and Hamiltonian Graph tutorials each build an embedding step by step, the first from images and the second from the description of a graph.

Footnotes

  1. Martin-Maroto et al. (2025), Supplementary section “Atomized Semilattices”, Definition 3. ↩

  2. Martin-Maroto et al. (2025), section “Encoding a task as axioms of an algebraic structure”; Supplementary section “Sparse crossing”. ↩

  3. Martin-Maroto et al. (2025), section “Encoding a task as axioms of an algebraic structure”. ↩

  4. Martin-Maroto et al. (2025), section “Learning from data”. ↩ ↩2 ↩3

  5. Martin-Maroto et al. (2025), section “Learning without data”. ↩ ↩2