The Magic of IF: Investigating Causal Reasoning Abilities in Large Language Models of Code

05/30/2023
by   Xiao Liu, et al.
0

Causal reasoning, the ability to identify cause-and-effect relationship, is crucial in human thinking. Although large language models (LLMs) succeed in many NLP tasks, it is still challenging for them to conduct complex causal reasoning like abductive reasoning and counterfactual reasoning. Given the fact that programming code may express causal relations more often and explicitly with conditional statements like “if“, we want to explore whether Code-LLMs acquire better causal reasoning abilities. Our experiments show that compared to text-only LLMs, Code-LLMs with code prompts are significantly better in causal reasoning. We further intervene on the prompts from different aspects, and discover that the programming structure is crucial in code prompt design, while Code-LLMs are robust towards format perturbations.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/12/2023

Is ChatGPT a Good Causal Reasoner? A Comprehensive Evaluation

Causal reasoning ability is crucial for numerous NLP applications. Despi...
research
01/26/2023

Causal Reasoning of Entities and Events in Procedural Texts

Entities and events have long been regarded as the crux of machine reaso...
research
10/21/2022

A Causal Framework to Quantify the Robustness of Mathematical Reasoning with Language Models

We have recently witnessed a number of impressive results on hard mathem...
research
08/29/2023

When Do Program-of-Thoughts Work for Reasoning?

The reasoning capabilities of Large Language Models (LLMs) play a pivota...
research
01/30/2023

Specializing Smaller Language Models towards Multi-Step Reasoning

The surprising ability of Large Language Models (LLMs) to perform well o...
research
06/18/2023

Efficiently Measuring the Cognitive Ability of LLMs: An Adaptive Testing Perspective

Large language models (LLMs), like ChatGPT, have shown some human-like c...
research
06/21/2022

Using cognitive psychology to understand GPT-3

We study GPT-3, a recent large language model, using tools from cognitiv...

Please sign up or login with your details

Forgot password? Click here to reset