mlsanityData to 14 Oct 2026

Large Language Models as Code Executors: An Exploratory Study

arXiv 2410.06667 ↗First posted 9 Oct 2024cs.CL cs.AIcited by 12

Not on the map. Why?

Abstract (arXiv)

The capabilities of Large Language Models (LLMs) have significantly evolved, extending from natural language processing to complex tasks like code understanding and generation. We expand the scope of LLMs' capabilities to a broader context, using LLMs to execute code snippets to obtain the output. This paper pioneers the exploration of LLMs as code executors, where code snippets are directly fed to the models for execution, and outputs are returned. We are the first to comprehensively examine this feasibility across various LLMs, including OpenAI's o1, GPT-4o, GPT-3.5, DeepSeek, and Qwen-Coder. Notably, the o1 model achieved over 90% accuracy in code execution, while others demonstrated lower accuracy levels. Furthermore, we introduce an Iterative Instruction Prompting (IIP) technique that processes code snippets line by line, enhancing the accuracy of weaker models by an average of 7.22% (with the highest improvement of 18.96%) and an absolute average improvement of 3.86% against CoT prompting (with the highest improvement of 19.46%). Our study not only highlights the transformative potential of LLMs in coding but also lays the groundwork for future advancements in automated programming and the completion of complex tasks.

Key facts. Cited by 12 papers in the map (data through 14 Oct 2026). Builds on 14 of its 19 references that are in the map. First posted on arXiv 9 Oct 2024.

Builds on

14 of 19 references.

References · 14

  1. 2020Language Models are Few-Shot Learnerscited by 32,419
  2. 2023GPT-4 Technical Reportcited by 18,396
  3. 2022Training language models to follow instructions with human feedbackcited by 15,971
  4. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
  5. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  6. 2022Large Language Models are Zero-Shot Reasonerscited by 4,374
  7. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
  8. 2023A Multitask, Multilingual, Multimodal Evaluation of ChatGPT on Reasoning, Hallucination, and Interactivitycited by 894
  9. 2024A Survey on Large Language Models for Code Generationcited by 658
  10. 2024BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructionscited by 546
  11. 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 333
  12. 2023Document-Level Machine Translation with Large Language Modelscited by 90
2 more
  1. 2023What Makes Good In-context Demonstrations for Code Intelligence Tasks with LLMs?cited by 47
  2. 2024A Systematic Evaluation of Large Code Models in API Suggestion: When, Which, and Howcited by 7

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 10; 2026: 2.

12 papers.