ChatPaper.aiChatPaper

保証付き推測:テスト保証を伴うCISCからRISCへのトランスパイレーションのための言語モデリングアプローチ

Guaranteed Guess: A Language Modeling Approach for CISC-to-RISC Transpilation with Testing Guarantees

June 17, 2025
著者: Ahmed Heakl, Sarim Hashmi, Chaimaa Abi, Celine Lee, Abdulrahman Mahmoud
cs.AI

要旨

ハードウェアエコシステムは急速に進化しており、既存のコードの移植性と長期的な維持を向上させるために、低レベルのプログラムを異なる命令セットアーキテクチャ(ISA)間で迅速かつ柔軟かつ正確に変換することに対する関心が高まっています。このトランスパイル問題の中でも特に難しいのは、複雑命令セット(CISC)と縮小命令セット(RISC)ハードウェアアーキテクチャ間の変換です。これは、命令の複雑さ、メモリモデル、実行パラダイムにおける根本的な違いによるものです。本研究では、GG(Guaranteed Guess)を紹介します。これは、事前学習済みの大規模言語モデル(LLM)の翻訳能力と確立されたソフトウェアテスト構造の厳密さを組み合わせたISA中心のトランスパイルパイプラインです。我々の手法は、あるISAから別のISAへの候補翻訳をLLMを使用して生成し、その翻訳をソフトウェアテストフレームワークに組み込むことで、翻訳に対する定量化可能な信頼を構築します。GGアプローチを2つの多様なデータセットで評価し、ユニットテスト全体で高いコードカバレッジ(>98%)を強制し、HumanEvalプログラムでは99%、BringupBenchプログラムでは49%の機能/意味的正確性を達成しました。さらに、Apple Silicon上の最先端のRosetta 2フレームワークと比較し、トランスパイルされたコードにおいて1.73倍のランタイムパフォーマンス、1.47倍のエネルギー効率、2.41倍のメモリ使用効率の向上を示し、GGが現実世界のCISCからRISCへの変換タスクにおいて有効であることを実証しました。我々は、コード、データ、モデル、ベンチマークをオープンソース化し、ISAレベルのコード翻訳研究の共通基盤を確立します。
English
The hardware ecosystem is rapidly evolving, with increasing interest in translating low-level programs across different instruction set architectures (ISAs) in a quick, flexible, and correct way to enhance the portability and longevity of existing code. A particularly challenging class of this transpilation problem is translating between complex- (CISC) and reduced- (RISC) hardware architectures, due to fundamental differences in instruction complexity, memory models, and execution paradigms. In this work, we introduce GG (Guaranteed Guess), an ISA-centric transpilation pipeline that combines the translation power of pre-trained large language models (LLMs) with the rigor of established software testing constructs. Our method generates candidate translations using an LLM from one ISA to another, and embeds such translations within a software-testing framework to build quantifiable confidence in the translation. We evaluate our GG approach over two diverse datasets, enforce high code coverage (>98%) across unit tests, and achieve functional/semantic correctness of 99% on HumanEval programs and 49% on BringupBench programs, respectively. Further, we compare our approach to the state-of-the-art Rosetta 2 framework on Apple Silicon, showcasing 1.73x faster runtime performance, 1.47x better energy efficiency, and 2.41x better memory usage for our transpiled code, demonstrating the effectiveness of GG for real-world CISC-to-RISC translation tasks. We will open-source our codes, data, models, and benchmarks to establish a common foundation for ISA-level code translation research.
PDF102June 18, 2025