Loading…
Loading…
Qwen/Qwen2.5-Coder-1.5B-InstructLoRA fine-tune of Qwen/Qwen2.5-Coder-1.5B-Instruct that suggests a name for a function from its
assembly. The function name in the input is masked as <FUNC>.
Output format: {"name": "snake_case_name"}
adapter/ : LoRA adapter (requires the base model)model-Q4_K_M.gguf : merged and quantized model for llama.cpp / Ollamahistory.csv, curves.png : training historyHeld-out part of the validation set (444 functions, projects disjoint from train, not used for checkpoint selection):
| F1 (name tokens) | Exact match | Valid JSON | |
|---|---|---|---|
| Base model, no training | 0.003 | 0.000 | 1.00 |
| This adapter (step 400) | 0.124 | 0.000 | 0.98 |
Not tested yet on other datasets or on real game binaries.
Apply the model's chat template with this system prompt:
You are a reverse engineering assistant. Given an assembly function whose name is masked as <FUNC>, reply with JSON: {"name": "<snake_case_name>"}.
The user message is the assembly text with the function name replaced by <FUNC>.
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
SYSTEM = 'You are a reverse engineering assistant. Given an assembly function whose name is masked as <FUNC>, reply with JSON: {"name": "<snake_case_name>"}.'
tok = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-Coder-1.5B-Instruct")
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-1.5B-Instruct", torch_dtype="auto", device_map="auto")
model = PeftModel.from_pretrained(base, "AtesiT/re-func-namer-qwen2.5-coder-1.5b", subfolder="adapter")
asm = open("func.asm").read() # replace the function name with <FUNC>
msgs = [{"role": "system", "content": SYSTEM}, {"role": "user", "content": asm}]
text = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True)
inputs = tok(text, return_tensors="pt", add_special_tokens=False).to(model.device)
out = model.generate(**inputs, max_new_tokens=32, do_sample=False)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Run llama-server -m model-Q4_K_M.gguf -c 2048 and send chat requests to
/v1/chat/completions with the system prompt above, so the chat template is applied.
LLM4Binary/decompile-bench (21434 train examples after filtering); duplicates and
name leaks removed; train/val split by source group.For research, modding of single-player games, interoperability and learning. Do not use it to cheat in online games: this violates their terms of service and anti-cheat systems may ban you. Check the licenses of the base model and of the training data before reuse.