Research map / Large language models / Reasoning and chain of thought
StackSight: Unveiling WebAssembly through Large Language Models and Neurosymbolic Chain-of-Thought Decompilation
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 StackSight, a neurosymbolic pipeline that annotates WebAssembly text with static-analysis virtual-stack states and applies chain-of-thought prompting to LLMs to decompile WASM into C++.
Problem
WebAssembly decompilation is hard because its implicit stack machine, low-level types, and minified/obfuscated names hinder comprehension, and direct sequence-to-sequence LLM translation performs poorly due to scarce WASM pretraining data.
Approach
Combine a static analysis tool that tracks and annotates the virtual stack state (with symbolic handling of branches) for each WAT line with a three-stage chain-of-thought prompt (data type prediction, variable semantic recovery, function summary) before C++ generation.
Key results
- On HumanEval-X with GPT-3.5, StackSight raises the correct (test-passing) rate from 23.4% (10-shot ICL) to 31.4%; on GPT-4 it reaches 36.5% vs 19.7% for 1-shot.
- On MBXP with GPT-4, StackSight achieves 59.6% correct vs 42.4% for 1-shot ICL.
- In a 15-participant user study, StackSight outputs yielded at least 20% higher correct comprehension answers than the baseline and were more often judged closer to the source.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Use StackSight instead of 10-shot ICL | GPT-3.5 WebAssembly decompilation · HumanEval-X | Correct (%): 23.4 -> 31.4 | Helped |
| Use StackSight instead of 3-shot ICL | GPT-3.5 WebAssembly decompilation · MBXP | Correct (%): 21.1 -> 29.5 | Helped |
| Use StackSight instead of 1-shot ICL | GPT-4 WebAssembly decompilation · HumanEval-X | Correct (%): 19.7 -> 36.5 | Helped |
| Use StackSight instead of 1-shot ICL | GPT-4 WebAssembly decompilation · MBXP | Correct (%): 42.4 -> 59.6 | Helped |
| Add stack visualization (ablation) | StackSight with GPT-3.5 · HumanEval-X | Correct (%): 23.6 -> 31.4 | Helped |
| Add stack visualization (ablation) | StackSight with GPT-3.5 · MBXP | Correct (%): 26.5 -> 29.5 | Helped |
| Use the extended prompt instead of basic CoT (ablation) | StackSight with GPT-3.5 · HumanEval-X | Correct (%): +1.4% | Helped |
| Use the extended prompt instead of basic CoT (ablation) | StackSight with GPT-3.5 · MBXP | Correct (%): +0.3% | Helped |
| Add variable semantics recovery (ablation) | StackSight with GPT-3.5 · HumanEval-X | Correct (%): 24.8 -> 31.4 | Helped |
| Add variable semantics recovery (ablation) | StackSight with GPT-3.5 · MBXP | Correct (%): 22.7 -> 29.5 | Helped |
| Add natural-language function summary (ablation) | StackSight with GPT-3.5 · HumanEval-X | Correct (%): 20.7 -> 31.4 | Helped |
| Add natural-language function summary (ablation) | StackSight with GPT-3.5 · MBXP | Correct (%): 24.3 -> 29.5 | Helped |
Surprising findings
- Naively adding more ICL shots does not reliably improve decompilation; for Code Llama, 10-shot ICL on MBXP reaches only 9.0% correct versus 15.4% for StackSight.
- Performance on MBXP is lower partly because many MBXP canonical snippets are synthetically generated and do not match original functional objectives.
Limitations
- Evaluated only on two small function-level benchmarks (HumanEval-X and MBXP C++ splits), not full WebAssembly binaries.
- Test-pass evaluation requires a manual argument pass-by-reference fix in step 4 of the test oracle.
- Only three LLMs evaluated, with a single 7B open model.
Experimental setup
Datasets: HumanEval-X (C++ split) MBXP (C++ split)
Benchmarks: HumanEval-X MBXP
Metrics: compile rate functional correctness (pass rate) BERTScore SBERT similarity user study correct-answer rate user study win rate
Baselines: few-shot in-context learning (1/3/5/10-shot) wasm2c
Builds on: chain-of-thought prompting HumanEval-X MBXP
Closest papers by meaning
- CoRe: Benchmarking LLMs’ Code Reasoning Capabilities through Static Analysis Tasks (NeurIPS 2025 · similarity 0.85)
- BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructions (ICLR 2025 · similarity 0.84)
- CodeChain: Towards Modular Code Generation Through Chain of Self-revisions with Representative Sub-modules (ICLR 2024 · similarity 0.84)
- SemCoder: Training Code Language Models with Comprehensive Semantics Reasoning (NeurIPS 2024 · similarity 0.83)
- Chain of Execution Supervision Promotes General Reasoning in Large Language Models (NeurIPS 2025 · similarity 0.83)
- ReGAL: Refactoring Programs to Discover Generalizable Abstractions (ICML 2024 · similarity 0.83)
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.
