A newer version of the Gradio SDK is available: 6.20.0
title: N64LLMDecompile
emoji: ๐ฎ
colorFrom: indigo
colorTo: purple
sdk: gradio
app_file: app.py
pinned: false
license: apache-2.0
tags:
- build-small-hackathon
- backyard-ai
- thousand-token-wood
- best-demo
- best-use-of-modal
- best-use-of-codex
- track:backyard
- track:wood
- sponsor:openai
- sponsor:nvidia
- sponsor:modal
- achievement:offgrid
- achievement:welltuned
- achievement:fieldnotes
N64LLMDecompile ๐ฎ
Decompile Nintendo 64 MIPS functions back into C with a fine-tuned LLM, with compiler-verified scoring against the original target objects.
Built for the Hugging Face Build Small hackathon.
Links:
- ๐ป Source code: github.com/MatthewLReingold/N64LLMDecompile
- ๐ฅ Demo video: YouTube link
- ๐ Writeup: blog link
- ๐ฃ Social post: LinkedIn Post
What it does
Given the Ghidra pseudo-C of an N64 MIPS function, the model rewrites it into C
source. Optionally, the Space compiles that C with the original compiler and flags
and diffs the result against the target object using asm-differ โ giving a
byte-level match score, where 0 means a byte-perfect match (the metric the decomp
community uses to confirm a function is "matched").
Two ways to use it:
- Paste Ghidra pseudo-C โ get C back.
- Also upload the target object and pick the compiler + flags โ get a match score.
The model
MatthewReingold/llm4decompile-9b-v2-n64-finetune โ a fine-tune of
LLM4Decompile-9B-v2 on verified N64 scratches from decomp.me.
Results & writeup
Full results, methodology, and what I learned are covered in the blog post:
[ writeup link coming soon ]
Acknowledgments
Thank you to the work of these teams who all gave the resources used during development:
- decomp.me โ the scratch database and compiler-toolchain packaging the dataset is built from
- decompals โ IDO static recompilation, and the MIPS GCC / binutils builds
- Paper Mario team (pmret) โ the GCC 2.8.1 compiler
- LLM4Decompile (LLM4Binary) โ the base model this fine-tune is built on
- asm-differ (simonlindholm) โ the assembly diffing used for scoring
- Ghidra (NSA) โ pseudo-C generation in the data pipeline
- NVIDIA โ the Nemotron models, used during experimentation
- Modal โ cloud GPU infrastructure and compute credits
- OpenAI โ Codex, used during development
- Hugging Face โ hosting the hackathon and ZeroGPU access
License
Apache-2.0. The base model and the decomp toolchains retain their own respective licenses.