Are you Synthesizing or Recalling? Evaluating LLMs on Algorithmic Code Retrieval
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) have demonstrated strong performance in code generation, where success depends on both recalling relevant algorithmic knowledge and reasoning about how to apply it. However, existing LLM pipelines are opaque, with no explicit separation between these two components. We argue that for well-known algorithms whose canonical implementations are widely accessible in pretraining corpora, code generation is better measured as textitparametric code retrieval: reproducing a named algorithm from internalised knowledge rather than synthesizing a novel one. We introduce AlgoREval, a benchmark of 599 problems spanning classical 77 algorithms across 14 domains, 7 programming languages, and 4 graph-input representations to evaluate this capability in isolation, and assess 15 models (7B--34B parameters) in a zero-shot setting. We find substantial variation in retrieval accuracy across languages and input representations, even for widely documented algorithms and show that prompt augmentation with retrieved code snippets or structured algorithmic hints improve accuracy on complex algorithms, while SFT achieves broader language gains and GRPO achieves larger per-language gains on specific languages. Together, our results establish parametric code retrieval as a distinct, measurable capability and caution against deploying AI-generated algorithmic code without systematic validation.footnoteCode and dataset are available at https://github.com/Nickil21/AlgoREval
Key facts. No citing papers in the map yet (data through 7 Oct 2026). First posted on arXiv 1 Oct 2026.
Builds on
No reference list yet.
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2024CodeGRAG: Bridging the Gap between Natural Language and Programming Language via Graphical Retrieval Augmented Generation
- 2024Context-Augmented Code Generation Using Programming Knowledge Graphs
- 2025Evaluating the Generalization Capabilities of Large Language Models on Code Reasoning
- 2026Diagnosing Knowledge Gaps in LLM Tool Use: An Agentic Benchmark for Novel API Acquisition
- 2025Beyond Synthetic Benchmarks: Evaluating LLM Performance on Real-World Class-Level Code Generation
- 2026Context-Augmented Code Generation Using Programming Knowledge Graphs
- 2024Retrieval-augmented code completion for local projects using large language models
- 2025An Empirical Study of Retrieval-Augmented Code Generation: Challenges and Opportunities