atlas

Research map / Large language models / Agents, code and math

Guess & Sketch: Language Model Guided Transpilation

ICLR 2024 · Large language models › Agents, code and math · approach: Neural program synthesis and transpilation · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes Guess & Sketch, a neurosymbolic assembly-to-assembly transpiler (ARMv8 <-> RISC-V) where an LM supplies candidate translations, attention-based alignments and low-confidence flags, and a Rosette SMT-based solver repairs flagged basic blocks.

Problem

Automatically translating assembly code between ISAs (ARMv8 and RISC-V) is hard: rule-based transpilers are hand-engineered and don't scale to new ISAs, symbolic synthesis scales poorly beyond a few lines, and pure LMs lack guaranteed correctness.

Approach

Extract sequence-level alignment (from cross-/self-attention) and token-level confidence from a trained LM, mark potentially erroneous pure basic blocks, and pass those aligned input/output subsequences as sketches with specifications to a symbolic solver (Rosette) that fills holes so output is semantically equivalent; falls back to the LM output if no solution.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
add symbolic sketch solving guided by language-model alignments and confidenceEncoder-Decoder · Project Euler, RISC-V to ARMv8full program accuracy: 68.9% -> 80%Helped
add symbolic sketch solving guided by language-model alignments and confidenceEncoder-Decoder · Benchmarks, RISC-V to ARMv8full program accuracy: 6.3% -> 18.8%Helped
add symbolic sketch solving guided by language-model alignments and confidenceEncoder-Decoder · Unix Commands, RISC-V to ARMv8full program accuracy: 36.4% -> 81.2%Helped
add symbolic sketch solving guided by language-model alignments and confidenceEncoder-Decoder · Project Euler, ARMv8 to RISC-Vfull program accuracy: 66.7% -> 75.6%Helped
add symbolic sketch solving guided by language-model alignments and confidenceEncoder-Decoder · Benchmarks, ARMv8 to RISC-Vfull program accuracy: 6.25% -> 25.0%Helped
add symbolic sketch solving guided by language-model alignments and confidenceEncoder-Decoder · Unix Commands, ARMv8 to RISC-Vfull program accuracy: 81.2% -> 81.2%No clear effect
add symbolic sketch solving guided by language-model alignments and confidenceEncoder-Decoder · Project Euler, RISC-V to ARMv8 (additional problems)full program accuracy: 34.1% -> 41.5%Helped
add symbolic sketch solving guided by language-model alignments and confidenceEncoder-Decoder · Project Euler, ARMv8 to RISC-V (additional problems)full program accuracy: 37.8% -> 51.2%Helped
add symbolic sketch solving guided by language-model alignments and confidenceEncoder-Decoder · Project Euler, RISC-V to ARMv8average number of samples: 30.1 -> 21.3Helped
add symbolic sketch solving guided by language-model alignments and confidenceEncoder-Decoder · Project Euler, ARMv8 to RISC-Vaverage number of samples: 34.3 -> 25.3Helped
vary confidence threshold gamma from 0.8 to 0.95 (ablation)Guess & Sketch · Project Eulernumber of corrected programsNo clear effect
increase confidence threshold gamma from 0.8 to 0.95 (ablation)Guess & Sketch · Project Eulerinference runtime: 2.2xHurt

Surprising findings

Limitations

Experimental setup

Datasets: The Stack (C files compiled to ARMv8 and RISC-V assembly pairs) Project Euler C implementations Benchmarks Game C implementations Basic Unix Commands C implementations Additional 82 Project Euler C problems

Benchmarks: Project Euler Benchmarks Game Unix Commands

Metrics: full program accuracy (execution output match) average samples used

Baselines: Few-shot GPT-4 Engineered ARMv8-to-RISC-V transpiler (IBM Haifa arm2riscv) FT StarCoder FT CodeLLaMA Encoder-Decoder

Builds on: BART Rosette Sketching (program synthesis) LoRA Transcoder

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy