Instructions to use ylfeng/ReF-Decompile with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ylfeng/ReF-Decompile with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ylfeng/ReF-Decompile") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ylfeng/ReF-Decompile") model = AutoModelForCausalLM.from_pretrained("ylfeng/ReF-Decompile") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use ylfeng/ReF-Decompile with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ylfeng/ReF-Decompile" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ylfeng/ReF-Decompile", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ylfeng/ReF-Decompile
- SGLang
How to use ylfeng/ReF-Decompile with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ylfeng/ReF-Decompile" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ylfeng/ReF-Decompile", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ylfeng/ReF-Decompile" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ylfeng/ReF-Decompile", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ylfeng/ReF-Decompile with Docker Model Runner:
docker model run hf.co/ylfeng/ReF-Decompile
metadata
library_name: transformers
license: mit
model-index:
- name: ref-decompile
results: []
pipeline_tag: text-generation
datasets:
- ylfeng/ReF-Decompile-dataset
ReF Decompile
This model is a fine-tuned version of LLM4Binary/llm4decompile-6.7b-v1.5.
Results
| Model/Metrics | Re-executability Rate (%) | Readability (#) | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| O0 | O1 | O2 | O3 | AVG | O0 | O1 | O2 | O3 | AVG | |
| Rule Based Decompiler | ||||||||||
| ghidra | 34.76 | 16.46 | 15.24 | 14.02 | 20.12 | 2.98 | 2.41 | 2.52 | 2.38 | 2.57 |
| Refine-Based Method | ||||||||||
| GPT-4o | 46.95 | 34.15 | 28.66 | 31.10 | 35.22 | 2.82 | 2.35 | 2.29 | 2.31 | 2.44 |
| LLM4Decompile-Ref | 74.39 | 46.95 | 47.56 | 42.07 | 52.74 | 4.08 | 3.38 | 3.34 | 3.19 | 3.50 |
| End-to-End Method | ||||||||||
| LLM4Decompile-End | 69.51 | 44.51 | 39.63 | 38.41 | 48.02 | 4.07 | 3.46 | 3.40 | 3.23 | 3.54 |
| FAE Decompile | 67.68 | 48.78 | 45.73 | 42.07 | 51.07 | 3.94 | 3.46 | 3.40 | 3.25 | 3.51 |
| FAE Decompile+SCC | 70.24 | 48.54 | 47.56 | 43.29 | 52.41 | 3.97 | 3.48 | 3.41 | 3.23 | 3.52 |
| ReF Decompile | 85.37 | 56.10 | 51.83 | 52.43 | 61.43 | 4.13 | 3.60 | 3.54 | 3.49 | 3.69 |
Resources
Reference
@misc{feng2025refdecompilerelabelingfunction,
title={ReF Decompile: Relabeling and Function Call Enhanced Decompile},
author={Yunlong Feng and Bohan Li and Xiaoming Shi and Qingfu Zhu and Wanxiang Che},
year={2025},
eprint={2502.12221},
archivePrefix={arXiv},
primaryClass={cs.SE},
url={https://arxiv.org/abs/2502.12221},
}