Introduction
This is the era of machine learning. Breakthroughs in machine learning have led to impressive tools such as LLMs that are known, if not used, by almost everybody today. The surprising results obtained through generative AI, rooted in machine learning, have also led to the false beliefs that AI is (almost) solved, that generative AI or more broadly machine learning is all what is needed, and that just feeding AI with more data and using larger models will lead to human-level intelligence.
And yet, despite these spectacular results, examples keep on appearing as to where purely data-driven approaches fail. For instance, the ‘Alice in Wonderland’ puzzle [1]:
"Alice has N brothers and she also has M sisters. How many sisters does Alice’s brother have?"
When presenting this puzzle to many large language models (for several values of N and M), they return the incorrect answer M. Another example is that of the boat and the goat [2]:
“A man and a goat are on one side of the river. They have a boat. How can they both go across?”
The answer of ChatGPT was: “The man takes the goat across the river first, leaving the boat on the original side. Then, the man returns alone with the boat. He leaves the goat on the other side and takes the boat back to the original side. Finally, he takes the cabbage across the river.” which is mixing up the nature of the puzzle it has to solve with a famous brainteaser involving a boat, a goat, a wolf and a cabbage, and constraints on which it has received training data [2].
Both examples clearly illustrate the limitations of purely data-driven approaches and of large language models. They are good at pattern matching, but understand neither the contents of the patterns nor the context in which they are applied. They therefore do not properly reason [10,11,12]. This is clear in the boat-and-goat example where a pattern learned on a famous complex puzzle is retrieved and applied to a much simplified variant of the original problem, yielding non-sensical results. This indicates that LLMs perform a kind of memorization and re-use answers to previously seen problems to new situations, with variable success.
As past data may not reflect all subtleties, edge-cases, and patterns that govern a particular domain, this explains why data-driven approaches may lead to incorrect results.
Data is about specific instances, while rules express general regularities and knowledge that hold for most (if not all) instances.
It is not very useful to learn or rediscover rules from data that express what one already knows, certainly given that the learned rules might not be entirely correct.
Instead, one wants learning algorithms that generate new and previously unknown knowledge and that respect what one already knows.
Therefore, the purely data-driven approaches are problematic from the perspective of Trustworthy AI, the hallmark of AI made in Europe.
What is needed are approaches that exploit knowledge for providing guarantees and for reasoning.
Let us illustrate the idea with an example of a self-driving car that needs to decide whether it can go first. It should be able to correctly answer the type of questions asked during driving license tests.
To answer this type of questions, one needs to combine perception to determine where the relevant objects are in the scene (where are the cars, the pedestrian, the traffic signs, … ) and interpret the resulting situation using the rules of traffic. A purely data-driven approach for answering such questions would need vast amounts of training data, while a purely knowledge-driven approach would require encoding a complete and consistent knowledge base.Both would be impractical and would not really work. The data-driven approach would require too much data, would have to relearn the rules of traffic, and cannot guarantee that the decision making process would respect the rules of traffic. A purely knowledge-driven approach cannot solve the problem either. It would not be able to solve the perception task, and it would also require one to encode the knowledge in a model that would need to be complete and consistent, and would need to cover all possible situations. Knowing when there is enough knowledge and finding the best encoding are highly non-trivial tasks. Furthermore, some rules of traffic are soft and therefore difficult to encode in an unambiguous manner (e.g., the (Dutch) traffic law does not state that you have to drive on the righthand side of the road but “to keep right as much as possible” as you are allowed to pass unexpected road blocks [37]). To prepare for our driver’s licence test, people typically learn from a text-book containing the rules of traffic, a few illustrations, and some explanations, which is much more efficient. One might therefore consider multi-modal AI-scenario’s that would involve learning from such textbooks too. Even when a vast number of textbooks would be available, a pure data-driven approach is likely to fail too as it would require learning to reason about traffic. But this is the same type of reasoning that proved to be problematic in the Alice and the boat-and-goat example.
What is needed, therefore, is an integrated learning and reasoning approach to AI that exploits both data and knowledge. We know the rules of traffic, so we should be able to use them to speed up the learning as well as to enforce that the learned model respects the rules of traffic.
Neurosymbolic AI for Learning and Reasoning
While there is a growing consensus that genuine AI should embrace learning as well as reasoning, there are different opinions as to how to integrate the two. To understand the issues, it is instructive to be more precise about machine learning and machine reasoning. The standard view on machine learning is that a machine learns when it gets better at a particular task with experience. Machine learning systems learn a function or model that maps inputs to outputs from data. Thus, they learn general patterns or functions from specific observations. According to Pedro Domingos [4], there are five different ‘schools’ or ‘tribes’ in machine learning that differ in the type of algorithm and model they use, cf. also below.
With regard to reasoning, different notions exist. At an abstract level reasoning can be viewed as using more-or-less rational processes to infer new knowledge from one’s existing knowledge (adapting [5]). What is important is that there is general knowledge as well as inference processes that allow to draw conclusions about specific situations. This view on reasoning leaves room for two well-accepted types of reasoning in AI. The first is common sense reasoning [6], which is the human ability to use common sense knowledge to make presumptions about ordinary situations one encounters every day (adapting [7]). The other is the more formal type of rational reasoning that is guaranteed to be correct and that is found in probability theory and logic; it is this type of reasoning that corresponds to rational thinking according to Russell and Norvig [8]. Probability and logic also represent two of Domingos’ five tribes mentioned above. This type of knowledge is traditionally understood as ‘symbolic AI’ and is incorporated in solvers that search for solutions to particular inference problems while providing guarantees [9]. As the models are symbolic, the knowledge is in principle interpretable and inference can be explained (through traces, derivations or proofs).
While it can be argued there has been a lot of progress in AI with large language models concerning common sense reasoning, it is hard to argue that such models are thinking rationally, let alone provide guarantees (see e.g. [10,11,12]). At the same time, the above examples of Alice and the boat-and-goat, show that there are still deficiencies, even with common sense reasoning.
The difference between learning and reasoning in AI is often linked to the System I and II characterization of thinking that the Nobel prize-winner Daniel Kahnemann makes in his best-selling book “Thinking, fast and slow” [13]. System 1 is about fast thinking, it operates automatically and quickly, and it has learned patterns and associations, very much like what current neural networks and foundation models do. System 2, on the other hand, is about slow thinking, it demands complex multi-step computations or inferences, and it is deliberative and requires effort, which is reminiscent of reasoning.
The differences between learning and reasoning in artificial intelligence can be summarized as follows. Learning using neural networks is data-driven, finds patterns and associations, produces black boxes which are hard to interpret, can be used for perception, operates at the subsymbolic level, and supports fast prediction. It involves inducing general patterns from specific observations. Reasoning on the other hand is knowledge-driven, based on declarative models (such as rules) that can be interpreted and explained, works at the symbol and kowledge level, and supports multi-step complex inferences. It involves making specific inferences using general laws. The subsymbolic level is hard to edit or intervene with, while the symbolic level does not account for perception directly.
The challenge and promise of learning and reasoning is to combine the best of both worlds. This challenge is pursued in the field of neurosymbolic AI, which is viewed as the 3rd wave in AI [14], has been named the ‘most promising approach to a broad AI’ [33], and is an innovation trigger according to Gartner [15]; it is prominently featured in DeepMind’s latests results [16], and is enjoying a lot of attention. It has been the topic of AI debates, online summer schools attended by 1000s of participants [18], and has given rise to a novel journal [19]. The goal of neurosymbolic AI is to answer the longstanding open question in AI about reconciling the symbolic and subsymbolic level, and the data- and knowledge-driven approach.
Neurosymbolic AI is based on some central ideas that can be cast into slogans. The first states that AI models should embrace knowledge as well as data:
The use of the equation symbol reflects two important points. First, the sum of knowledge and data determine the quality of the model, and secondly, the use of addition indicates that knowledge can compensate for data. The more knowledge, the less data will be necessary and vice versa. This knowledge-data trade-off is analogous to the bias-variance trade-off in machine learning. This is well-illustrated by the ROAD-R dataset developed by Eleonara Giunchilla and colleagues as a NeurIPS challenge [20] and illustrated in this demo.
The available knowledge constrains the learned models. Consider, for instance, the constraints that ‘traffic lights do not move’ and that ‘the color of a traffic light is green or orange or red’. When such knowledge is provided to a neurosymbolic AI system, the learned neural networks should respect these constraints. The ensemble of knowledge and data might be insufficient for learning a high-quality model. One indication for this are the reasoning shortcuts [34], which occur when the model learns to respect the constraints but does not capture the desired outcomes. For instance, in the absence of images and objects labeled as a traffic light, a learner might simply conclude that there are no traffic lights, thereby trivially satisfying the first constraint.
The second slogan is that AI involves learners and reasoners.
While it is tempting to define reasoners as working on the symbol level only, this would deny the possibility that neural networks reason. Therefore, I will adapt Hector Geffner’s terminology, who talks about model-free learners and model-based solvers. The learners are the neural networks operating at the subsymbolic level, while the solvers perform sound inference on a given symbolic model, where the semantics of the underlying formal model clearly define what sound means. Unlike model-free learners, model-based solvers provide guarantees w.r.t. the correctness of inference. This is essential for Trustworthy AI [22]; it is central to Technical Robustness and Safety (and its requirements towards accuracy, reliability, and reproducibility), and Transparancy (as inference in such models is traceable and therefore explainable).
From a Trustworthy AI perspective it is therefore relevant to distinguish different types of neurosymbolic AI systems based on whether the neural component or the symbolic solver is doing the reasoning, and on what type of interface and communication is used between the two components (see Kautz for an alternative conceptualization [39]).
A. The symbolic solver as the reasoner.
A standard, pipelining, technique in this category is to transform problems specified in natural language into a formal language that is accepted as input for a symbolic solver, and then mapping the result back. Prime examples that fall into this category include ChatGPT calling WoflramAlpha to solve particular mathematical problems, and the many attempts of coupling LLMs to planners, e.g. [24]. The type of interface in the above two examples is very simple, it is more like a pipeline than a true interface.
Within category A, there also exist tightly integrated systems such as the neural concept learner and the deep probabilistic logics [25,26] that use deep interfaces. The interface for this type of systems is bi-directional, and differentiable, which allows to propagate the learning signal through both the symbolic and the subsymbolic model. This leads to a tight and principled integration between the two models, and the solver and the neural network. This is the ultimate type of neurosymbolic AI system as it has the perception abilities of neural nets, the reasoning abilities of logic, and elegantly bridges the gap between the two. It is however also the most challenging type of system to develop and numerous research questions are still open.
B. The neural network as the reasoner.
In this type of model, the subsymbolic model is restricted by the available knowledge. For instance, graph neural networks [27] are a prime example of this category as they can be trained to predict answers to queries that correspond to particular classes of logical or database queries. The underlying graph structure can be regarded as encoding the knowledge. A further example is that of techniques that use constraints to regularize (i.e. punish) the neural network when learning. Once the neural network has been learned, the constraints are no longer used for prediction or inference. It is therefore not guaranteed that the constraints are satisfied at prediction time. Important representatives of this stream of neurosymbolic AI systems include [28,29,30,38].
C. The symbolic solver as the reasoner, both working in the same conceptual space.
It is also interesting to consider a special type of class A problem in which the neural nets and the solver work together in the same conceptual space. For this variant, DeepMind’s recent results in solving geometry problems are a prime example [16]. They use a LLM like model to guide a theorem prover towards finding a complex proof by proposing potentially interesting proof constructs. The LLM was trained from 100 million synthetic data example proofs. The conceptual space of the symbolic solver is thus the same as that of the neural network: proofs. The approach has been successful at competing in Math Olympiad problems [16].
Another example of this category is the SayCanPay planner [23], which trains three LLMs to select actions, check that the actions are feasible, as well as effective. The LLMs are then used in a traditional heuristic search process to guide the search towards optimal plans. All three models as well as the plans are expressed in natural language.
Further extremes along the spectrum w.r.t. categories A and B are just a neural network (as in foundation or large language models), or just a symbolic solver, for instance, a planner. They either do not exploit knowledge or data, or consist only of either a subsymbolic or a symbolic component.
The above discussion and categorization also points towards the interface as another, key differentiator among different neurosymbolic AI systems. Are the symbolic and subsymbolic components just loosely coupled in a pipeline, or is there a more fundamental deep integration that is bi-directional and differentiable, or are they just operating in the same conceptual space? Furthermore, is the solver or neural network just called once, as in the ChatGPT - WolframAlpha example, or is there an iterative process as in AlphaGeometry? The downside of loosely coupled neurosymbolic approaches is that the two components are independent of one another and that the interface is not really supporting learning. The challenge of deeply integrated neurosymbolic approaches is to design differentiable interfaces [40], differentiability that has proven to be extremely effective for machine learning and optimisation.
Traditionally, neurosymbolic AI focused on logic as the symbolic component. However, logic is discrete while neural networks are continuous. To bridge the two, one needs to introduce numeric information into the logics. This is the motivation for the view that I have been advocating [31] and that forms the basis for our research.
It is also in line with Russell and Norvig’s view on rational thinking [8, Chapter 1]. Probability, however, has to be interpreted broadly. Fuzzy logic has often been used as an alternative [29,30], it is typically more efficient, but suffers from semantic as well convergence issues in the optimisation [32].
The last slogan is important. It connects the stream on neurosymbolic AI to the five tribes of machine learning introduced by Pedro Domingos [4]. In his popular science book, he argues that the race is on to invent the ultimate learning algorithm, the quest for the ultimately master algorithm, which unifies the five tribes of machine learning: the Bayesians (probabilistic graphical models), the Connectionists (neural nets), the Symbolistics (logic), the analogizers (support vectors), and the Evolutionaries (genetic programs). Analyzing these different learning paradigms from a representational perspective reveals that they are essentially based on three representational paradigms: neural nets, logic and probabilistic graphical models as genetic programs and support vectors are typically not viewed as representational paradigms. Therefore, the quest for the master algorithm boils down to a quest for the master representation, the neurosymbolic representation that unifies Neural Networks + Logic + Probability and is to be used in neurosymbolic models. As a unifying representation, it should also have each of its constituents as special cases, that is, it should support the typical inference and learning processes that have made neural nets, logic and probability so successful for AI cf. [31]. It is the quest towards this master representation that our lab is pursuing [40], as many others in neurosymbolic AI.
As a final remark, AI is not just about rational thinking, today AI is more commonly viewed as rational acting, which is about taking the right actions and decisions. Selecting the right actions is based on rational thinking but also has an optimisation component: to decide what is the right action one needs to know what is the utility of different actions, and be able to optimize w.r.t. utility. This implies that AI, as well as learning and reasoning are intimately connected to optimization. This connection is also clear from the many works lying at the intersection of constraint programming, operations research and machine learning (e.g. [35,36]). The ultimate challenge in this regard is to develop neurosymbolic reinforcement learning agents that combine perception with planning and learning. After all, reinforcement learning captures the whole AI-problem in a nutshell.
Acknowledgements
Thanks to the TAILOR project, especially to Fredrik Heintz, to Giuseppe Marra, Trine Platou, Wannes Meert, and to Kristian Kersting for interesting discussions and feedback, and to Hendrik Blockeel, Jens Bürger, Vincent Derkinderen, Jaron Maene, Robin Manhaeve for comments on an earlier version of this manuscript.
References
[1] Nezhurina, M., Cipolina-Kun, L., Cherti, M., & Jitsev, J. (2024). Alice in Wonderland: Simple Tasks Showing Complete Reasoning Breakdown in State-Of-the-Art Large Language Models. arXiv preprint arXiv:2406.02061. 🔗 [2] Smith, G. (2024, May 15). A Man, A Boat, and a Goat — and a Chatbot! Mind Matters. 🔗 [3] Theorie-blokken.be. 🔗 [4] Domingos, P. (2015). The master algorithm: How the quest for the ultimate learning machine will remake our world. Basic Books. [5] Reason. (2024, August 21). In Wikipedia. 🔗. [6] Davis, E., & Marcus, G. (2015, September 1). Commonsense reasoning and commonsense knowledge in Artificial intelligence – Communications of the ACM. 🔗 [7] Commonsense knowledge (artificial intelligence). (2024, August 21). In Wikipedia. 🔗 [8] Russell, S. J., & Norvig, P. (2016). Artificial intelligence: a modern approach (4th Ed). Pearson. 🔗 [9] Geffner, H. (2018). Model-free, Model-based, and General Intelligence. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence. 🔗 [10] Kambhampati, S. (2023, September 12). Can LLMs really reason and plan? – Communications of the ACM. 🔗 [11] Zhang, H., Li, L. H., Meng, T., Chang, K. W., & Van den Broeck, G. (2023). On the Paradox of Learning to Reason from Data. Proceedings of the Thirty-Second International Joint Conference on Artificial Intelligence, IJCAI-23. 🔗 [12] Hazra, R., Venturato, G., Martires, P. Z. D., & De Raedt, L. (2024). Can Large Language Models Reason? A Characterization via 3-SAT. arXiv preprint arXiv:2408.07215. 🔗 [13] Daniel Kahnemann, Thinking, fast, and slow. Penguin Books, 2012. 🔗 [14] Garcez, A. D. A., & Lamb, L. C. (2023). Neurosymbolic AI: The 3rd wave. Artificial Intelligence Review, 56(11), 12387-12406. 🔗 [15] Gartner Research (2024, June 17). Hype Cycle for Artificial Intelligence, 2024. 🔗 [16] Trinh, T.H., Wu, Y., Le, Q.V. et al. (2024). Solving olympiad geometry without human demonstrations. Nature 625, 476–482. 🔗 [17] AI Debate between Yoshua Bengio and Gary Marcus. 🔗 [18] IBM Neuro-Symbolic AI Workshop (January 23-27, 2023). 🔗 [19] Neurosymbolic Artificial Intelligence. IOS Press. 🔗 [20] Giunchiglia, E., Stoian, M. C., Khan, S., Cuzzolin, F., & Lukasiewicz, T. (2023). ROAD-R: the autonomous driving dataset with logical requirements. Machine Learning, 112(9), 3261-3291. 🔗 [21] Manhaeve, R., Dumancic, S., Kimmig, A., Demeester, T., & De Raedt, L. (2018). Deepproblog: Neural probabilistic logic programming. Advances in neural information processing systems, 31. 🔗 [22] European Commission (2019, April 8). Ethics guidelines for trustworthy AI. 🔗 [23] Hazra, R., Dos Martires, P. Z., & De Raedt, L. (2024, March). Saycanpay: Heuristic planning with large language models using learnable domain knowledge. In Proceedings of the AAAI Conference on Artificial Intelligence (Vol. 38, No. 18, pp. 20123-20133). 🔗 [24] Silver, T., Dan, S., Srinivas, K., Tenenbaum, J. B., Kaelbling, L., & Katz, M. (2024, March). Generalized planning in pddl domains with pretrained large language models. In Proceedings of the AAAI Conference on Artificial Intelligence (Vol. 38, No. 18, pp. 20256-20264). 🔗 [25] Giuseppe Marra, Sebastijan Dumancic, Robin Manhaeve, Luc De Raedt: From statistical relational to neurosymbolic artificial intelligence: A survey. Artif. Intell. 328: 104062 (2024)🔗 [26] Robin Manhaeve, Sebastijan Dumancic, Angelika Kimmig, Thomas Demeester, Luc De Raedt: Neural probabilistic logic programming in DeepProbLog. Artif. Intell. 298: 103504 (2021) 🔗 [27] Graph Neural Network. (2024, August 21). In Wikipedia. 🔗 [28] Jingyi Xu, Zilu Zhang, Tal Friedman, Yitao Liang, Guy Van den Broeck: A Semantic Loss Function for Deep Learning with Symbolic Knowledge. ICML 2018 🔗 [29] Samy Badreddine, Artur S. d’Avila Garcez, Luciano Serafini, Michael Spranger: Logic Tensor Networks. Artif. Intell. 303: 103649 (2022) 🔗 [30] Michelangelo Diligenti, Marco Gori, Claudio Saccà: Semantic-based regularization for learning and inference. Artif. Intell. 244: 143-165 (2017) 🔗 [31] Robin Manhaeve, Giuseppe Marra, Thomas Demeester, Sebastijan Dumančić, Angelika Kimmig, Luc De Raedt, Neuro-Symbolic AI = Neural + Logical + Probabilistic AI, Frontiers in Artificial Intelligence and Applications, 2021. 🔗 [32] Emile van Krieken, Erman Acar, Frank van Harmelen: Analyzing Differentiable Fuzzy Logic Operators. Artif. Intell. 302: 103602 (2022) 🔗 [33] Hochreiter, Sepp, Toward a broad AI. Communications of the ACM. 65 (4): 56–57. 🔗 [34] Marconato, E., Teso, S., & Passerini, A. (2023). Neuro-symbolic reasoning shortcuts: Mitigation strategies and their limitations. arXiv preprint arXiv:2303.12578. 🔗 [35] Mandi, J., Demirovic, E., Stuckey, P. J., & Guns, T. (2020). Smart Predict-and-Optimize for Hard Combinatorial Optimization Problems. Proc AAAI. 🔗 [36] Lombardi, M., Milano, M., Bartolini, A. (2017). Empirical decision model learning. Art. Intell. 🔗 [37] Prakken, H. (2017) On the problem of making autonomous vehicles conform to traffic law, Art. Intell. and Law. 🔗 [38] Van Baelen, Q., Karsmakers, P. (2023). Constraint guided gradient descent: Training with inequality constraints with applications in regression and semantic segmentation. Neurocomputing, 556. 🔗 [39] Kautz, H. (2022) “The Third AI Summer: AAAI Robert S. Engelmore Memorial Lecture”. AI Magazine. 43 (1): 93–104. 🔗 [40] De Raedt, L. (2023). ERC AdG DeepLog. 🔗