cs.AIApr 7, 2026

Can Large Language Models Reinvent Foundational Algorithms?

Authors: Jian Zhao, Haoren Luo, Yu Wang, Yuhan Cao, Pingyue Sheng, Tianxing He

Organizations: Xiongan AI Institute · Beijing University of Posts and Telecommunications, Beijing, China · Institute for Interdisciplinary Information Sciences, Tsinghua University · Institute of Information Engineering, Chinese Academy of Sciences, Beijing, China · 

Abstract

LLMs have shown strong potential to advance scientific discovery. Whether they possess the capacity for foundational innovation, however, remains an open question. In this work, we focus on a prerequisite for foundational innovation: can LLMs reinvent foundational algorithms in computer science? We use LLM unlearning methods to suppress direct recall of the target algorithm and let the model reason with the remaining knowledge to recover it. Although unlearning does not guarantee full knowledge removal, LLMs fail to recover nearly half of the target algorithms. Notably, even suppressing the mention of the algorithm's name during decoding without unlearning makes the models' recovery rate drop dramatically (19--39%), suggesting their overreliance on memorized knowledge. We observe that recoverable algorithms tend to be simple in structure or core ideas, whereas the others are less straightforward. We also introduce a generative verifier that sustains models' reasoning strength, helping to avoid the ``thought collapse'' phenomenon. Taken together, by treating the unlearned model's recovery rate as an approximate upper bound, our empirical results suggest that current LLM systems still have limited ability to make foundational algorithm innovation. Our code is available at https://github.com/Algo-Reinvention/algo-reinvention.

Figures & tables

Appendix figures & tables8 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Algorithmic Blindness in Large Language Models: A Calibration Study of Performance Prediction

    Feb 25, 2026Sohan Venkatesh, Ashish Mahendran Kurapath, Tejas MelkoteAlgorithmic ReasoningLLM Evaluation

  2. Initialization Improves LLM-Driven Discovery

    Sep 30, 2026Mansi Sakarvadia, Marco Ciccone, Colin RaffelLarge Language Model-Guided OptimizationLarge Language Model-Guided Scientific Discovery