ChatPaper.aiChatPaper

보장된 추측: 테스트 보장을 통한 CISC-to-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) 하드웨어 아키텍처 간의 변환은 명령어 복잡성, 메모리 모델 및 실행 패러다임의 근본적인 차이로 인해 매우 어려운 과제로 여겨진다. 본 연구에서는 사전 훈련된 대규모 언어 모델(LLM)의 번역 능력과 확립된 소프트웨어 테스트 구조의 엄격함을 결합한 ISA 중심의 변환 파이프라인인 GG(Guaranteed Guess)를 소개한다. 우리의 방법은 LLM을 사용하여 한 ISA에서 다른 ISA로의 후보 번역을 생성하고, 이러한 번역을 소프트웨어 테스트 프레임워크 내에 포함시켜 번역에 대한 정량적 신뢰를 구축한다. 우리는 GG 접근법을 두 가지 다양한 데이터셋에 대해 평가하고, 단위 테스트에서 높은 코드 커버리지(>98%)를 강제하며, HumanEval 프로그램에서 99%, BringupBench 프로그램에서 49%의 기능적/의미적 정확성을 달성했다. 또한, 우리의 접근법을 Apple Silicon의 최신 Rosetta 2 프레임워크와 비교하여, 변환된 코드가 1.73배 더 빠른 런타임 성능, 1.47배 더 나은 에너지 효율성 및 2.41배 더 나은 메모리 사용량을 보여주며, GG가 실제 CISC-to-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