arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2305.19213cs.CL
收藏

IF的魔力:探究代码大语言模型的因果推理能力

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

Peking University(北京大学);University of California, Los Angeles(加利福尼亚大学洛杉矶分校);Beijing Institute for General Artificial Intelligence(北京通用人工智能研究院)

Xiao Liu, Da Yin, Chen Zhang, Yansong Feng, Dongyan Zhao

AI总结:

本文探究代码大语言模型是否因代码中“if”等条件语句对因果关系的显式表达而具备更强的因果推理能力,实验证明使用代码提示的Code-LLMs显著优于纯文本LLMs,且编程结构对提示设计至关重要。

摘要:

因果推理,即识别因果关系的能力,在人类思维中至关重要。尽管大语言模型(LLMs)在许多自然语言处理任务中取得了成功,但进行溯因推理和反事实推理等复杂因果推理对它们而言仍然具有挑战性。鉴于编程代码可能通过“if”等条件语句更频繁、更明确地表达因果关系,我们希望探究代码大语言模型(Code-LLMs)是否获得了更强的因果推理能力。我们的实验表明,与纯文本大语言模型相比,使用代码提示的代码大语言模型在因果推理方面表现显著更优。我们进一步从不同方面对提示进行干预,发现编程结构在代码提示设计中至关重要,而代码大语言模型对格式扰动具有鲁棒性。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑