NPHardEval: Dynamic Benchmark on Reasoning Ability of Large Language Models via Complexity Classes

Lizhou FanWenyue HuaLingyao LiHaoyang LingYongfeng Zhang

article2024ACL109 citations

Introduces NPHardEval, a dynamic monthly refreshed benchmark spanning P, NP-complete, and NP-hard complexity classes to rigorously evaluate large language model reasoning while preventing data memorization and overfitting.

Listen

Assessing the true reasoning capabilities of large language models has become increasingly challenging because static, publicly available benchmarks allow models to memorize answers or overfit to evaluation metrics. This can lead organizations to overestimate model competencies on complex, real-world tasks. The article addresses this issue by introducing NPHardEval, an automated and dynamically refreshed benchmark designed to measure large language model reasoning against established computational complexity classes.

The benchmark establishes a rigorous evaluation framework featuring nine distinct algorithmic reasoning tasks structured across three complexity classes: polynomial time, NP-complete, and NP-hard. Each task contains 100 problem instances distributed over 10 escalating levels of difficulty, for a total of 900 questions per evaluation cycle. To prevent memorization and benchmark hacking, the system uses an automated data synthesis and verification pipeline that refreshes the questions monthly, testing 12 prominent commercial and open-source models under both zero-shot and few-shot conditions.

The evaluation revealed several critical findings regarding model performance and robustness. First, reasoning performance degrades sharply as problem complexity increases; models achieved modest average weighted accuracies of 0.24 in polynomial-time and 0.25 in NP-complete tasks, but collapsed to an average of 0.02 on NP-hard tasks. Second, closed-source models consistently outperformed open-source models in both reasoning accuracy and adherence to formatting, with GPT-4 Turbo leading across most tasks. Third, few-shot prompting revealed that closed-source models demonstrated generalized algorithmic learning across varying prompt difficulties, whereas open-source models showed high performance variability, suggesting pattern mimicry rather than genuine rule internalization. Finally, fine-tuning experiments demonstrated that training open-source models on past benchmark versions improved performance only on simple, same-difficulty polynomial problems, while failing or degrading performance on more complex tasks and harder problem instances.

These findings have direct operational implications for organizations deploying artificial intelligence in decision-critical workflows such as logistics, resource scheduling, and combinatorial optimization. Leaders cannot assume that strong conversational proficiency translates into complex problem-solving abilities. Relying on current models for complex optimization carries significant operational risk, as even top-tier systems struggle to solve higher-order algorithmic challenges.

Organizations should treat conversational AI models as non-authoritative when addressing complex planning and optimization tasks, pairing them with classical algorithmic solvers rather than relying on pure model generation. For research and evaluation teams, adopting dynamic, frequently updated benchmarks is essential to prevent inflated performance metrics caused by data contamination. Future work should explore iterative self-correction mechanisms and collaborative multi-agent systems to enhance underlying model reasoning. Users must remain cautious, however, as the current benchmark uses a linear difficulty weighting scheme that may simplify real-world complexity, and rapid foundational model updates require ongoing re-evaluation.

arXiv: 2312.14890casmlab/NPHardEval

No sufficiently relevant recommendations were found.

No sufficiently relevant recommendations were found.

Cover for NPHardEval: Dynamic Benchmark on Reasoning Ability of Large Language Models via Complexity Classes

Abstract

Complex reasoning ability is one of the most important features of Large Language Models (LLMs). Numerous benchmarks have been established to assess the reasoning abilities of LLMs. However, they are inadequate in offering a rigorous evaluation and prone to the risk of overfitting and memorization, as these publicly accessible and static benchmarks allow models to potentially tailor their responses to specific benchmark metrics, thereby inflating their performance. Addressing these limitations, we introduce a new benchmark NPHard-Eval. It contains a broad spectrum of 900 algorithmic questions belonging up to the NP-Hard complexity class, offering a rigorous measure of the reasoning ability of LLMs utilizing computational complexity. Moreover, this benchmark is designed with a dynamic update mechanism, where the datapoints are refreshed on a monthly basis. Such regular updates play a crucial role in mitigating the risk of LLMs overfitting or memorizing the benchmark, promoting a more accurate and reliable assessment of their reasoning capabilities. The benchmark dataset and code of NPHardEval are available at https://github.com/casmlab/NPHardEval.

Citation

MLA
Fan, L., et al. “NPHardEval: Dynamic Benchmark on Reasoning Ability of Large Language Models via Complexity Classes”. Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 2024, pp. 4092–114, https://doi.org/10.18653/v1/2024.acl-long.225.
APA
Fan, L., Hua, W., Li, L., Ling, H., & Zhang, Y. (2024). NPHardEval: Dynamic Benchmark on Reasoning Ability of Large Language Models via Complexity Classes. Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 4092–4114. https://doi.org/10.18653/v1/2024.acl-long.225
Chicago
Fan, L., W. Hua, L. Li, H. Ling, and Y. Zhang. 2024. “NPHardEval: Dynamic Benchmark on Reasoning Ability of Large Language Models via Complexity Classes”. Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 4092–4114. https://doi.org/10.18653/v1/2024.acl-long.225.
Harvard
Fan, L. et al. (2024) “NPHardEval: Dynamic Benchmark on Reasoning Ability of Large Language Models via Complexity Classes”, Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). Association for Computational Linguistics, pp. 4092–4114. Available at: https://doi.org/10.18653/v1/2024.acl-long.225.
Vancouver
1. Fan L, Hua W, Li L, Ling H, Zhang Y (2024) NPHardEval: Dynamic Benchmark on Reasoning Ability of Large Language Models via Complexity Classes. In: Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). Association for Computational Linguistics, pp 4092–4114

BibTeX

@inproceedings{fan-etal-2024-nphardeval,
    title = "{NPH}ard{E}val: Dynamic Benchmark on Reasoning Ability of Large Language Models via Complexity Classes",
    author = "Fan, Lizhou  and
      Hua, Wenyue  and
      Li, Lingyao  and
      Ling, Haoyang  and
      Zhang, Yongfeng",
    editor = "Ku, Lun-Wei  and
      Martins, Andre  and
      Srikumar, Vivek",
    booktitle = "Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",
    month = aug,
    year = "2024",
    address = "Bangkok, Thailand",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2024.acl-long.225/",
    doi = "10.18653/v1/2024.acl-long.225",
    pages = "4092--4114"
}
Metadata:ACL Anthology

Source Code

This paper has an official code repository available. Click below to access the source code.

View Repository

Access the Paper

This paper is available from its original source. Click below to access the PDF.

Open PDF
License: https://creativecommons.org/licenses/by/4.0/