arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2401.08719cs.SEcs.CC
收藏

CodeComplex:用于最坏情况时间复杂度预测的数据集

CodeComplex: Dataset for Worst-Case Time Complexity Prediction

Seung-Yeop Baik, Joonghyuk Hahn, Jungin Kim, Mingi Jeon, Aditi, Yo-Sub Han, Sang-Ki Ko

AI总结:

本文提出了首个用于评估LLMs代码时间复杂度预测推理能力的大规模数据集CodeComplex,包含4900个Java和Python代码及专家标注,并提出了专门的评估指标以提供更精确可靠的评估。

摘要:

大型语言模型(LLMs)的推理能力是一项至关重要的能力,尤其是在复杂的决策任务中。展示LLMs推理能力的一个重要任务是代码时间复杂度预测,它涉及各种复杂因素,如变量的输入范围和条件循环。当前的基准由于数据有限、语言限制和标注不足,未能提供严格的评估。它们不考虑基于输入表示的时间复杂度,仅仅评估预测是否属于同一类别,缺乏对错误预测与正确预测之间接近程度的衡量。为了解决这些依赖问题,我们引入了CodeComplex,这是第一个稳健且广泛的数据集,旨在评估LLMs在预测代码时间复杂度方面的推理能力。CodeComplex包含4,900个Java代码和同等数量的Python代码,克服了语言和标注限制,由算法专家小组根据输入特征仔细标注了复杂度标签。此外,我们提出了针对复杂度预测任务推理的专门评估指标,为LLMs的推理能力提供了更精确和可靠的评估。我们公开发布我们的数据集和基线模型,以鼓励相关的(NLP、SE和PL)社区利用并参与这项研究。

英文摘要:

Reasoning ability of Large Language Models (LLMs) is a crucial ability, especially in complex decision-making tasks. One significant task to show LLMs' reasoning capability is code time complexity prediction, which involves various intricate factors such as the input range of variables and conditional loops. Current benchmarks fall short of providing a rigorous assessment due to limited data, language constraints, and insufficient labeling. They do not consider time complexity based on input representation and merely evaluate whether predictions fall into the same class, lacking a measure of how close incorrect predictions are to the correct ones. To address these dependencies, we introduce CodeComplex, the first robust and extensive dataset designed to evaluate LLMs' reasoning abilities in predicting code time complexity. CodeComplex comprises 4,900 Java codes and an equivalent number of Python codes, overcoming language and labeling constraints, carefully annotated with complexity labels based on input characteristics by a panel of algorithmic experts. Additionally, we propose specialized evaluation metrics for the reasoning of complexity prediction tasks, offering a more precise and reliable assessment of LLMs' reasoning capabilities. We release our dataset (https://github.com/sybaik1/CodeComplex-Data) and baseline models (https://github.com/sybaik1/CodeComplex-Models) publicly to encourage the relevant (NLP, SE, and PL) communities to utilize and participate in this research.

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

↑