Code Simulation Challenges for Large Language Models

要約

推論、計画、および問題解決のタスクの多くは、本質的なアルゴリズムの性質を共有しています。つまり、各ステップを正しくシミュレートすることが、それらを正しく解決するための十分な条件です。
この研究では、大規模言語モデル (LLM) がコーディングおよびアルゴリズム タスクをどの程度シミュレートできるかを研究し、そのようなアルゴリズム推論タスクの一般的な機能についての洞察を提供します。
直線的なプログラム、クリティカル パスを含むコード、近似命令や冗長命令のベンチマークを紹介します。
さらに、ソート アルゴリズムと入れ子ループを使用して LLM のシミュレーション機能を評価し、ルーチンの計算の複雑さが LLM の実行シミュレーション能力に直接影響することを示します。
最も強力な LLM は比較的強力なシミュレーション機能を示しますが、プロセスは脆弱で、パターン認識に大きく依存しているようで、記憶の影響を受けます。
我々は、LLM にコード実行を行ごとにシミュレートする/コンパイラの計算パターンに従うように指示する、新しい既製のプロンプト手法であるシミュレーション チェーン (CoSm) を提案します。
CoSm は、LLM がシミュレーションのパフォーマンスを向上させながら、記憶と浅いパターン認識を削減するのに効率的に役立ちます。
私たちは、コード シミュレーションにおける CoSm の成功は、他の一般的な日常的なシミュレーション推論タスクにもインスピレーションを与えるものであると考えています。

要約(オリジナル)

Many reasoning, planning, and problem-solving tasks share an intrinsic algorithmic nature: correctly simulating each step is a sufficient condition to solve them correctly. This work studies to what extent Large Language Models (LLMs) can simulate coding and algorithmic tasks to provide insights into general capabilities in such algorithmic reasoning tasks. We introduce benchmarks for straight-line programs, code that contains critical paths, and approximate and redundant instructions. We further assess the simulation capabilities of LLMs with sorting algorithms and nested loops and show that a routine’s computational complexity directly affects an LLM’s ability to simulate its execution. While the most powerful LLMs exhibit relatively strong simulation capabilities, the process is fragile, seems to rely heavily on pattern recognition, and is affected by memorisation. We propose a novel off-the-shelf prompting method, Chain of Simulation (CoSm), which instructs LLMs to simulate code execution line by line/follow the computation pattern of compilers. CoSm efficiently helps LLMs reduce memorisation and shallow pattern recognition while improving simulation performance. We consider the success of CoSm in code simulation to be inspirational for other general routine simulation reasoning tasks.

arxiv情報

著者 Emanuele La Malfa,Christoph Weinhuber,Orazio Torre,Fangru Lin,Samuele Marro,Anthony Cohn,Nigel Shadbolt,Michael Wooldridge
発行日 2024-05-29 17:56:58+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AI, cs.CL, cs.LG, cs.PL パーマリンク