An AI gets the sum right. Which digits did it see?

NEUROSYMBOLIC INTELLIGENCE · VISION AND LEARNING FROM INDIRECT EVIDENCE

Place a handwritten 1 beside a 2. One reader predicts a total of 3. Another predicts 13. Both readers have answered every previous addition question correctly. What did those earlier questions tell us about their ability to recognise a digit?

In a neurosymbolic system, a learned visual component can assign a value to each image and an explicit arithmetic rule can add the values. If the only feedback during training is the total, an error in one reading can cancel an error in the other. Which pairs the learner sees can matter as much as how many answers it gets right.

Two readings both give eight for the pairs 1 and 7, and 2 and 6. For the new pair 1 and 2, reading A gives 3. Reading B assigns the values 6 and 7 and gives 13.
Two ways of reading four digits agree on the observed totals. A new pair distinguishes them. Original teaching illustration by The Bible of AI (BAI), CC BY-SA 4.0. The digit pairs and values form a constructed example.

What does the learner get to see?

DeepProbLog provides a concrete experimental setting. Each input consists of two images of handwritten digits and a label giving their sum. A neural network estimates the possible values of each digit. A probabilistic logic program combines those estimates according to the ordinary rule of addition. The learner receives evidence about the pair even though the training label leaves the identity of each operand unstated. For example, a total of eight is consistent with several pairs of digits. Other examples can supply information that this one lacks. [1]

A reader who knows the decimal digits comes to the experiment with knowledge gathered over years of seeing them named and written. To see what the sums themselves disclose, imagine someone looking at four unfamiliar signs. The person knows the four values available and knows how to add. The remaining question is which value belongs to each sign.

Four correct answers, two possible readings

For this example, the four signs have the familiar shapes 1, 2, 6 and 7. Each sign always receives one of those four values, whether it appears on the left or on the right. Initially, different signs may receive the same value. The following four totals are the only numerical evidence supplied. Reading A assigns each sign its conventional value. Reading B exchanges the values of 1 and 6, and also exchanges those of 2 and 7.

Four observed totals in the constructed example
Signs shownObserved totalReading AReading B
1 and 671 + 66 + 1
1 and 781 + 76 + 2
2 and 682 + 67 + 1
2 and 792 + 77 + 2

Every pair contains one sign from the group {1, 2} and one from {6, 7}. Reading B adds five to the conventional value of the first group and subtracts five from that of the second. The two changes cancel on every observed pair. Reversing their order, or repeating these four questions a thousand times, would preserve the ambiguity.

There are exactly two solutions under the stated assumptions. Compare the first and third rows, which share the sign 6. The value assigned to the sign 2 must exceed the value assigned to 1 by exactly one. The only consecutive values available are 1 and 2, or 6 and 7. Each choice fixes the other two signs through the first two rows. Enumerating all 256 assignments gives the same two solutions. Both achieve four correct totals out of four, although Reading B misidentifies every sign.

One more observation

Now pair the signs 1 and 2. Reading A predicts 3. Reading B treats them as 6 and 7 and predicts 13. Observing the total of 3 selects Reading A from the two surviving alternatives. Another mixed pair would have been uninformative. The gain comes from choosing an observation on which the rival interpretations disagree.

This is an example of identifiability. A correspondence is identifiable within a specified class of possible readings when the observations determine it uniquely. Here the alphabet is fixed, the readings are deterministic, addition is known and every total is exact. Allow a sign to change value according to its neighbour, and the argument that two readings exhaust the possibilities no longer applies.

What experiments have found

The rsbench research suite provides an independent example using images of handwritten digits. In its MNAdd-Half task, four particular combinations of digits from zero to four are used during training. The researchers list three assignments that fit those combinations perfectly. Only one retains the conventional values of all five digits. The suite supplies 1,080 test examples with combinations outside the training distribution. Three is a count of possible optimal assignments in that task. It says nothing by itself about how often a particular training procedure converges on each one. [2]

Experiments reported at NeurIPS in 2025 used a small number of labelled examples as prototypes, giving the model direct information about what particular concepts look like. The researchers report improvements in concept learning on several tasks, including a handwritten-digit task and reasoning about geometric patterns. Such evidence bears on the value of a particular form of supervision. A separate study at KR 2026 gives a formal method for testing whether a specified set of constraints admits another assignment. Together these studies address two complementary questions. What interpretations does the evidence permit, and which interpretation does a learner actually acquire? [3, 4]

How to test a reader

A useful evaluation would keep three records. First, score the predicted sums on fresh images of familiar digit combinations. Second, compare the predicted value of each individual digit with an independent label, and report errors for each class. Third, score the sums again on combinations withheld from training. Using independent images in both sets makes it possible to investigate the additional difficulty of an unfamiliar combination. Recording whose handwriting appears in each set would also allow a separate test with previously unseen writers.

These observations answer different practical questions. A transcribed serial number preserves the position and identity of every digit. Two mistakes that cancel in an addition problem can change that number completely. Before reusing a digit recogniser for transcription, one can ask for a direct reading test and inspect which digits it confuses. The small example supplies a reason to ask for that evidence and a way to choose the next informative observation.

Sources and image credit

  1. DeepProbLog: Neural Probabilistic Logic Programming. NeurIPS 2018.
  2. A Neuro-Symbolic Benchmark Suite for Concept Quality and Reasoning Shortcuts. NeurIPS 2024. MNAdd-Half task and evaluation sets.
  3. Right for the Right Reasons: Avoiding Reasoning Shortcuts via Prototypical Neurosymbolic AI. NeurIPS 2025.
  4. Constraint-Based Analysis of Reasoning Shortcuts in Neurosymbolic Learning. KR 2026, pp. 1132–1142.

The cover, interior illustration and four-sign example are original to The Bible of AI (BAI), CC BY-SA 4.0. The arithmetic example can be checked by enumeration. Experimental findings are attributed to the cited studies.

Liked this post? Follow this blog to get more.