Lune

ICLR2024Top-tier venue

Guess & Sketch: Language Model Guided Transpilation

Celine Lee, Abdulrahman Mahmoud, Michal Kurek, Simone Campanoni, David Brooks, Stephen Chong, Gu-Yeon Wei, Alexander M. Rush

Abstract

Maintaining legacy software requires many software and systems engineering hours. Assembly code programs, which demand low-level control over the computer machine state and have no variable names, are particularly difficult for humans to analyze. Existing conventional program translators guarantee correctness, but are hand-engineered for the source and target programming languages in question. Learned transpilation, i.e. automatic translation of code, offers an alternative to manual re-writing and engineering efforts. Automated symbolic program translation approaches guarantee correctness but struggle to scale to longer programs due to the exponentially large search space. Their rigid rule-based systems also limit their expressivity, so they can only reason about a reduced space of programs. Probabilistic neural language models (LMs) produce plausible outputs for every input, but do so at the cost of guaranteed correctness. In this work, we leverage the strengths of LMs and symbolic solvers in a neurosymbolic approach to learned transpilation for assembly code. Assembly code is an appropriate setting for a neurosymbolic approach, since assembly code can be divided into shorter non-branching basic blocks amenable to the use of symbolic methods. GUESS & SKETCH extracts alignment and confidence information from features of the LM then passes it to a symbolic solver to resolve semantic equivalence of the transpilation input and output. We test GUESS & SKETCH on three different test sets of assembly transpilation tasks, varying in difficulty, and show that it successfully transpiles 57.6% more examples than GPT-4 and 39.6% more examples than an engineered transpiler. We also share a training and evaluation dataset for this task.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

4 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • LoRA: Low-Rank Adaptation of Large Language Models cites Language Models are Few-Shot Learners
  • CASS: Nvidia to AMD Transpilation with Data, Models, and Benchmark cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Large Language Models Struggle to Learn Long-Tail Knowledge cites Language Models are Few-Shot Learners
  • SchemaPile: A Large Collection of Relational Database Schemas cites LoRA: Low-Rank Adaptation of Large Language Models
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers4

  1. SchemaPile: A Large Collection of Relational Database SchemasTill Döhmen, Radu Geacu, Madelon Hulsebos, Sebastian SchelterSIGMOD 2024 · 9 citations
  2. CASS: Nvidia to AMD Transpilation with Data, Models, and BenchmarkAhmed Heakl, Gustavo Bertolo Stahl, Sarim Hashmi, Seung Hun Eddie Han et al.ACL 2026 · 2 citations
  3. Arancini: A Hybrid Binary Translator for Weak Memory Model ArchitecturesSebastian Reimers, Dennis Sprokholt, Martin Fink, Theofilos Augoustis et al.ASPLOS 2026 · 1 citation
  4. No More Translation at Runtime: LLM-Empowered Static Binary TranslationZhibo Liu, Huaijin Wang, Wai Kin Wong, Daoyuan Wu et al.EuroSys 2026 · 1 citation

Builds on10

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu et al.ICLR 2022 · 18,833 citations
  3. CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan et al.EMNLP Findings 2020 · 2,828 citations
  4. Large Language Models Struggle to Learn Long-Tail KnowledgeNikhil Kandpal, Haikang Deng, Adam Roberts, Eric Wallace et al.ICML 2023 · 623 citations
  5. Unsupervised Translation of Programming LanguagesBaptiste Rozière, Marie-Anne Lachaux, Lowik Chanussot, Guillaume LampleNeurIPS 2020 · 606 citations

Related papers

  1. StackSight: Unveiling WebAssembly through Large Language Models and Neurosymbolic Chain-of-Thought DecompilationWeike Fang, Zhejian Zhou, Junzhou He, Weihang WangICML 2024 · 5 citations
  2. Introducing Compiler Semantics into Large Language Models as Programming Language Translators: A Case Study of C to x86 AssemblyShuoming Zhang, Jiacheng Zhao, Chunwei Xia, Zheng Wang et al.EMNLP Findings 2024 · 1 citation
  3. Guaranteed Guess: A Language Modeling Approach for CISC-to-RISC Transpilation with Testing GuaranteesAhmed Heakl, Sarim Hashmi, Chaimaa Abi, Celine Lee et al.EMNLP Findings 2025
  4. Neural Program Generation Modulo Static AnalysisRohan Mukherjee, Yeming Wen, Dipak Chaudhari, Thomas W. Reps et al.NeurIPS 2021 · 28 citations
  5. QiMeng-Xpiler: Transcompiling Tensor Programs for Deep Learning Systems with a Neural-Symbolic ApproachShouyang Dong, Jun Bi, Di Huang, Jiaming Guo et al.OSDI 2025 · 6 citations
Dusk over the sea between two cliffs drawn in fine vertical lines