Not working on CPU only

Author: DelitantsCreated May 25, 2026Updated Jun 26, 2026

I have integrated LLM4Decompile in Pi coder via Qwen3.6, but when model attempted to use LLM4Decompile to refine Ghidra output, I've got this response:

"The LLM4Decompile output on CPU is very garbled — lots of tmp variables and the formatting isn't clean. The model needs GPU for proper refinement."

Why it can't be used on CPU only?

`source llm4decompile_venv/bin/activate && python3 -c " import torch from transformers import AutoTokenizer, AutoModelForCausalLM

model = AutoModelForCausalLM.from_pretrained('LLM4Binary/llm4decompile-6.7b-v2', device_map='cpu') tokenizer = AutoTokenizer.from_pretrained('LLM4Binary/llm4decompile-6.7b-v2')

with open('/tmp/ghidra_46b220.txt') as f: pseudo = f.read()

prompt = f'# This is the decompiled pseudo-code from Ghidra:\n{pseudo}\n# What is the refined C source code?' inputs = tokenizer(prompt, return_tensors='pt')

outputs = model.generate(**inputs, max_new_tokens=512) refined = tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True) print(refined.strip()) " 2>&1 (timeout 300s)

... (3 earlier lines, ctrl+o to expand) voidĠFUN_0046b220(void){Ċint32_tĠtmpĠ;Ċint32_tĠtmp___0Ġ;Ċint32_tĠtmp___1Ġ;Ċint32_tĠtmp___2Ġ;Ċint32_tĠtmp___3Ġ;Ċint32_tĠtmp___4Ġ;Ċint32_tĠtmp___5Ġ;Ċint32_tĠtmp___6Ġ;Ċint32_tĠtmp___7Ġ;Ċint32_tĠtmp___8Ġ;Ċint32_tĠtmp_ _9Ġ;Ċint32_tĠtmp___10Ġ;Ċint32_tĠtmp___11Ġ;Ċint32_tĠtmp___12Ġ;Ċint32_tĠtmp___13Ġ;Ċint32_tĠtmp___14Ġ;Ċint32_tĠtmp___15Ġ;Ċint32_tĠtmp___16Ġ;Ċint32_tĠtmp___17Ġ;Ċint32_tĠtmp___18Ġ;Ċint32_tĠtmp___19Ġ;Ċint32_tĠtmp___20Ġ ;Ċint32_tĠtmp___21Ġ;Ċint32_tĠtmp___22Ġ;Ċint32_tĠtmp___23Ġ;Ċint32_tĠtmp___24Ġ;Ċint32_tĠtmp___25Ġ;Ċint32_tĠtmp___26Ġ;Ċint32_tĠtmp___27Ġ;Ċint32_tĠtmp___28Ġ;Ċint32_tĠtmp___29Ġ;Ċint32_tĠtmp___30Ġ;Ċint32_tĠtmp___31Ġ;Ċin t32_tĠtmp___32Ġ;Ċint32_tĠtmp___33Ġ;Ċint32_tĠtmp___34Ġ;Ċint32_tĠtmp___35Ġ;Ċint32_tĠtmp___36Ġ;Ċint32_tĠtmp___37Ġ;Ċint32_tĠtmp___38Ġ;Ċint32_tĠtmp___39Ġ;Ċint32_tĠtmp___40Ġ;Ċint32_tĠtmp___41Ġ;Ċint32_tĠtmp___42Ġ;Ċint32 tĠtmp___43Ġ;Ċint32_tĠtmp___44Ġ;Ċint32`

Source: albertan017/LLM4Decompile