Is GPT-3 “reasonable” enough to detect logical fallacies?

Exploring the reasoning capabilities of GPT-3 through common logical fallacies

Alperen Gundogan
Towards Data Science

--

In May 2020, OpenAI research team has introduced their new language model called GPT-3 in the paper “Language Models are Few-Shot Learners”. On June 11, 2020, OpenAI released an API for some beta users to test and develop GPT-3 based applications. Since then, there are hundreds of tweets on GPT-3 demos with the #gpt3 hashtag and many blog posts about the experience of users. It is possible to generate various types of applications using GPT-3, some of them are context analyzing, writing poetry, blog posts, creative fictions, codes, summarizing texts, etc. You can check the link to find out different GPT-3 demos.

Image by Gerd Altmann from Pixabay

I had a chance to get access to GPT-3 API and to explore its capabilities. Among the other GPT-3 demos, I haven’t come across any demo that addresses the capabilities of the GPT-3 to detect logical fallacies. A logical fallacy is an error in reasoning that can impair the logic of an argument.

Fallacies are commonly divided into formal and informal. A formal fallacy can be expressed neatly in a standard system of logic, such as propositional logic, while an informal fallacy originates in an error in reasoning other than an improper logical form. Arguments containing informal fallacies may be formally valid, but still fallacious[wiki].

In this post, we will explore the effectiveness of GPT-3 to recognize some of the common informal fallacies which cater to the understanding of reasoning capabilities of GPT-3. In the following, I will try to shed light on crucial details of the GPT-3 model, then I will ask GPT-3 some examples about the common logical fallacies through the playground of the OpenAI API.

What is GPT-3?

GPT-3 stands for Generative Pretrained Transformer 3rd generation and comes in eight sizes[paper]. The largest model includes 175 Billion parameters which expand the capacity of GPT-3's predecessor GPT-2 by two orders of magnitudes. All GPT-3 models use a transformer-based neural network, as their predecessor (the popular NLP model BERT also use transformers) but with more, wider layers and more data (the largest model has 96 attention layers, each with 96x128-dimension heads). GPT-3 175B is trained on an unlabeled text dataset that contains almost everything present on the internet with 499 Billion tokens from multiple sources including Wikipedia(3%), books(16%), and Common Crawl(60%), etc. The ginormous size of the GPT-3 makes its training too expensive. It is expected to cost over $4.6M using Tesla V100 cloud instance (with Lambda GPU instance).

GPT-3 is a language model with deep neural networks that simply tries to predict the next word from previously given words. The language model selects the next word which makes the sentence more probable in the literature. For example; the sentence “I bought avocados for Guacamole” is more probable to exist on the internet than “I bought chocolate for Guacamole”.

Common Crawl corpus contains petabytes of data collected over 8 years of web crawling. The corpus contains raw web page data, metadata extracts and text extracts with light filtering.

The magical part that differentiates GPT-3 from the other language models is that it can do a specific task without requiring any fine-tuning. Other popular language models like BERT require a huge amount of task-specific datasets for training such as translation or summarization tasks. These requirements make data cumbersome to obtain and lead to perform poorly in other tasks. On the contrary, we can instruct GPT-3 by the formulation of a task in a language model way, simply prompting. You can find more detailed information about GPT-3 in the following references.

OpenAI’s GPT-3 Language Model: A Technical Overview

Architectural details of GPT-2

Detailed examination of the paper by Yannic Kilcher

GPT-3 Playground

As mentioned above, GPT-3 does not require any fine-tuning, we simply tell the model what we want to do and the model tries its best to follow our instructions. GPT-3 is a stochastic model (does not always return the same response), however, we can control the stochasticity through some parameters defined in the playground. For example; a parameter called temperature that is between 0 and 1 control randomness, low values leads to deterministic results. Another one is the frequency penalty that controls the model’s likelihood to talk about a new topic. I used the default values on the playground provided by OpenAI during the experiments i.e. temperature is 0.7.

I provided the same prompt 5 times to deal with the stochasticity. In the next section, we will check the responses of GPT-3 on some of the common fallacies.

I believe that logical fallacies represent a very interesting framework to understand the reasoning capabilities of GPT-3. I refer to the article “15 Logical Fallacies You Should Know Before Getting Into a Debate” by TBS Staff for the 4 common fallacies that I have picked for the experiments. You may check the article for more information on fallacies.

The School of Athens by the Italian Renaissance artist Raphael

Experiment 1: Ad Hominem Fallacy

Ad hominem is an insult used as if it were an argument or evidence in support of a conclusion.

Bold sentences are prompt and each of the italic sentences are separated by a line to represent different attempts are the response of the GPT-3

Ad Hominem Fallacy and GPT-3 responses

In all 5 attempts, GPT-3 found the correct example as Ad Hominem Fallacy and I think the explanations of GPT-3 are also satisfactory.

Ad Hominem Fallacy demo

It is worth mentioning that I have not provided any example in the prompt to guide the GPT-3 for the topic, rather I directly asked the GPT-3. In their paper, authors mention that the accuracy of the result increases if a user provides some examples of the task in the prompt before asking or requesting something.

Experiment 2: Circular Argument (petitio principii)

If a claim is using its own conclusion as to its proposal, and vice versa, in the form of “If A is true because B is true; B is true because A is true”, then it is called a circular argument. I would say that this is rather easy to detect. Let’s see how GPT-3 behaves. This time, I have changed the order of the examples to confuse the model.

Circular Argument detection by GPT-3

GPT-3 found the correct answer in 80% of the attempts. Just for curiosity, I reduced the temperature to 0.2 (reduce the randomness of responses), and GPT-3 found 100% the correct option this time. So, the temperature really affects how the GPT-3 will respond and its correctness of the results at the end.

Experiment 3: Hasty Generalization

Hasty generalization fallacy may be one of the most common fallacies which relies on a claim that is supported by very little evidence.

Hasty Generalization performance of GPT-3

This time GPT-3 detected the correct answer in all of the five attempts. I have to admit that hasty generalization might be the easiest ones for GPT-3 to detect because it can differentiate the qualifiers e.g. “some”, “maybe”, “often”, etc. to avoid hasty generalization.

Experiment 4: Red Herring Fallacy (ignoratio elenchi)

A “red herring fallacy” is a distraction from the argument typically with some sentiment that seems to be relevant but isn’t really on-topic. This tactic is common when someone doesn’t like the current topic and wants to detour into something else instead, something easier or safer to address.

I think red herring fallacy is the most challenging fallacy for GPT-3 (also for people I guess) since it may not be obvious how different topics intervene.

Red Herring Fallacy with GPT-3 (temp=0.7)

The correct answer should be the first example, where a person is trying to change the topic (distract the other person) to escape from cleaning out the garage. GPT-3 performed worse in this task and it was able to detect the correct answer only in the two attempts. Interestingly, when I increased the temperature to 1.0, I was able to receive quite sensible responses. Not in all attempts again but GPT-3 was able to find the correct result and interpret “reasonable”.

Red Herring Fallacy with GPT-3 (temp=1.0)

Conclusion

The responses of GPT-3 are quite comprehensible in the first three experiments. The last experiment was challenging for GPT-3 and the responses were not fulfilling, however, still GPT-3 was able to generate “reasonable” outputs when I raised the temperature.

It is hard to answer where this “reasonability” comes from. Is it generated based on all data on the internet compressed on the 175B parameters(like fuzzy lookup table) or interpretations of semantic structure in language or something on top of those? One thing is for sure the enhancements on the algorithms, computational power, and even data will continue to surprise us in the following years.

One possible application of detecting logical fallacies is to use it as a filter for discerning fake news. For example, an application can identify defective reasoning, illogical arguments, or lack of evidence for the given news and filter them.

--

--

Wireless Researcher Engineer at Apple. Interested in 5G/6G mobility, deep reinforcement learning, and NLP.