Artificial intelligence algorithms have been studied intensively by computer scientists for decades in various forms. Chatbots like ELIZA and ChatGPT, chess engines like Deep Blue, video game NPCs, and Neural Networks are all different forms of AI algorithms, and interestingly, all have wildly different implementations. It sometimes seems like the term "artificial intelligence" is amorphous to the point of being specious. However, there are many algorithms that are very rarely, if ever referred to as artificial intelligence. Producer/consumer algorithms, A* graph searches, and linear programs tend to just be referred to as *algorithms*. So what makes an algorithm an AI algorithm? For most algorithms we expect some sort of *well defined* outcome. We want data transferred from A to B with producer consumer algorithms, we want the shortest path from one point to another when we run A*, and we want some combination of equation parameters optimized when we run a linear program. However, for AI algorithms we expect *reasonable* outcomes. We expect ELIZA and ChatGPT to respond *reasonably* to the messages they receive. We expect video game AI to take cover from a player shooting at them, since that is a *reasonable* action. We expect Deep Blue to search in terms of *reasonable* states on a chess board, and we expect neural networks to *reasonably* classify inputs based on their training sets. That being said, it is self-evident that conventional AI algorithms are not fully capable of reasoning. Take this humorous (and slightly morbid) example where Meta's messenger LLM (LLaMA) is unable to deduce what I told it is self-contradictory: ![[Pasted image 20241211222048.png]] A human is able to understand that a baby is too young to have children but a grandfather must have a child by definition, so there is no way for a grandfather to die as a baby. This common way of tripping up LLMs shows they are incapable of *deductive reasoning*, or reasoning by way of making logical arguments. That being said, the LLM's reply loosely makes sense. It's reasonable to offer condolences over a dead relative. It's reasonable to try and bring up happy memories of the deceased. It's also reasonable to lend an ear to someone in a bad spot. And most importantly, these are reasonable *without any formal proof*. So what's going on here? I would argue that Meta's LLM is performing *inductive reasoning*, which is a form of reasoning where conclusions are made from observations. When someone experiences a relative die for the first time, there's no way to logically deduce how to handle the situation. Instead that person will (hopefully) be around family and friends, notice them giving words of kindness and support, and come to a reasonable generalization that this is *probably* appropriate behavior for any time a relative passes away. The word "probably" is extremely important here. Without it, we would have to say mourning a grandfather that died as a baby is actually reasonable! Let's think about this in terms of LLaMA's training corpus. Throughout the internet, there are almost definitely examples of people writing that a loved one has passed away, and there are almost definitely responses of care and support to these people. When LLaMA trains on these texts, it builds high probabilities for words of condolences surrounding mentions of death. When a user sends a message to the model about a loved one dying, these highly likely terms are then sent back to the user. More generally, we can argue almost by definition that any deep learning algorithm that is trained on observations and makes some probabilistic conclusion is capable of inductive reasoning. However, this is a massive statement, and it leads to a paradox. Inductive reasoning's [Wikipedia article](https://en.wikipedia.org/wiki/Inductive_reasoning) notes it can exist in various specific types. Despite being capable of the general definition, I can show deep learning is not capable of these specific types of inductive reasoning. ### - Let's start with inductive generalization. *Inductive generalization* is a form of inductive reasoning where observations of one population are projected onto a broader population. It takes the following form: ``` The proportion Q of the sample has attribute A. Therefore, the proportion Q of the population has attribute A. ``` As an example, if I observe one out of ten people with freckles, I can reasonably say in a group of one hundred people, approximately ten will have freckles. The Wikipedia article then splits this kind of reasoning out into two forms. The statistical form applies to large sample sizes, and the anecdotal form applies to small sample sizes. In either form of reasoning, we can see how the observations in a sample population generalize to larger populations in a linear manner. However, deep learning explicitly has nonlinearities introduced into its algorithms, making it unable to perform this form of reasoning. Interestingly, a simple algorithm that takes the ratio ``observed population/total population`` and multiplies it by a larger population can perform this form reasoning in isolation, but that algorithm can no longer perform inductive reasoning in its most basic sense (you can't multiply your way into finding kind words for a funeral). ### - With generalization out of the way we can move on to inductive prediction. As opposed to generalization, *inductive prediction* makes conclusions from its observed populations. Wikipedia formalizes an inductive prediction as such: ``` Proportion Q of observed members of group G have had attribute A. Therefore, there is a probability corresponding to Q that other members of group G will have attribute A when next observed. ``` Let's say we are training a deep learning model to predict if members of G have attribute A. For this we need samples annotated as either having attribute A, or not having attribute A. Getting samples annotated with attribute A is simple. We can pick from Q. However, within the rest of G that does not include Q, we have no way of knowing whether or not these samples do or don't have A, so there's no way to pick the ones without A. We also cannot only train on Q as our model would overfit. This argument applies to statistical syllogism as well, where a single member of G is examined instead of multiple members. ### - This leaves us see if deep learning can perform an *argument from analogy*, where two objects with observed similar properties are assumed to additionally have unobserved similar properties. This argument has the following form: ``` P and Q are similar with respect to properties a, b, and c. Object P has been observed to have further property x. Therefore, Q probably has property x also. ``` This fails simply because we only have two objects to train on, P and Q. These examples show several ways deep learning cannot perform these more specific forms of inductive reasoning, but are not exhaustive proofs that no form of artificial intelligence can perform these tasks. Between this and the way I was able to find other algorithms to perform some of these kinds of reasoning, I think my paradox is resolvable. Outside of deep learning, there are many other machine learning algorithms that perform other computations which I hope to study and apply to this problem in the future. Bayesian inference comes to mind, notably after seeing its prevalence in the [Stanford Encyclopedia of Philosophy's article on inductive logic](https://plato.stanford.edu/entries/logic-inductive/). In the case where no general algorithm can perform inductive reasoning, I also suspect that each of these forms of inductive reasoning can be performed with their own algorithm. If that is the case, it would be interesting to try and develop a "master" AI that would be able to decide which algorithm to run (potentially as an AI agent) based on what it can identify about a given problem. I hope this work on what it means for AI to reason contributes not only to forwarding the study of artificial intelligence, but also provides new lenses to analyze what it means to reason in the first place. <font size=1>Published 2025-03-08</font> <font size=2>Follow me on BlueSky! @ryanmichaeltech.net</font>