/ Модель

Характеристики

Контекст
32 768 токенов
Параметры
1,5 млрд
Лицензия
Apache 2.0
Архитектура
qwen2 · dense
Базовая модель
Qwen2.5-Coder-1.5B-Instruct
Библиотека
transformers
Опубликована
5 авг 2026

pybytecode-v3-1.5b

Генерация текстаТекст → текст3 профессии

Модель восстанавливает исходный код отдельных функций Python 3.12 по текстовому дизассемблированию байткода и позволяет проверять результат сравнением скомпилированного кода.

260скачиваний за 30 дней0лайковвеса обновлены11 сен 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

PyBytecode v3 — компактная модель на 1,5 млрд параметров, разработанная BlazingCustoms для восстановления исходного кода Python по дизассемблированному байткоду Python 3.12. Это плотная авторегрессионная модель семейства Qwen2, дообученная с помощью LoRA на 48 196 парах «дизассемблированный код — исходный код»; адаптер объединён с базовой моделью Qwen/Qwen2.5-Coder-1.5B-Instruct. Модель принимает текстовое представление байткода и генерирует исходный код Python. Контекст составляет 32 768 токенов, указанная лицензия — Apache-2.0.

В опубликованном тесте на 600 функциях Python 3.12 модель восстановила код, прошедший проверку эквивалентности байткода, в 84,33% случаев за одну попытку и в 93,67% случаев при выборе из 32 вариантов. Проверка подтверждает соответствие поведения при совпадении отпечатка скомпилированного кода, но отсутствие совпадения не доказывает, что восстановление неверно. Лучше всего модель работает с функциями короче 100 строк дизассемблированного кода; качество заметно падает на длинных входах, а свыше примерно 400 строк в тесте не было подтверждённых результатов даже при 32 попытках.

Модель предназначена для анализа и восстановления отдельных функций из байткода, а не целых модулей. Она обучена и оценена для Python 3.12; поддержка других минорных версий Python, Nuitka, не-CPython-сборок и обфусцированного байткода не проверена. Проверка может не подтвердить правильный результат при несовпадении уровня оптимизации компилятора или версии CPython; восстановление логики реального вредоносного ПО также не продемонстрировано. Доступны веса Safetensors и вариант GGUF для llama.cpp, LM Studio и Ollama.

Сценарии применения

  • восстановление исходного кода Python-функций из байткода
  • анализ дизассемблированных функций Python 3.12
  • проверка восстановленного кода сравнением отпечатков байткода
  • восстановление исходников из отдельных функций в файлах .pyc
  • генерация нескольких вариантов декомпиляции с отбором подтверждённого результата

Ограничения

Предназначена для Python 3.12 и отдельных функций: качество существенно снижается на длинных дизассемблированиях, а входы свыше примерно 400 строк не дали подтверждённых результатов в опубликованном тесте. Работа с другими версиями и реализациями Python, обфусцированным байткодом и реальным вредоносным ПО не подтверждена; строгая проверка может не подтвердить правильный код при различии уровня оптимизации или версии CPython.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

PyBytecode v3 — 1.5B

Turns Python 3.12 bytecode back into Python source. Hand it a disassembled code object, get source code back.

The unusual part: you can check every answer. Recompile what the model wrote and compare it against the bytecode you started with — if they match, that file is exactly right, and you know it without trusting an accuracy number.

Weights are Apache-2.0. A GGUF build ships alongside for llama.cpp / LM Studio / Ollama.

Quickstart

from transformers import AutoModelForCausalLM, AutoTokenizer

tok = AutoTokenizer.from_pretrained("BlazingCustoms/pybytecode-v3-1.5b")
model = AutoModelForCausalLM.from_pretrained(
    "BlazingCustoms/pybytecode-v3-1.5b", torch_dtype="bfloat16", device_map="auto")

INSTRUCTION = ("Decompile this Python 3.12 bytecode disassembly back into the original Python "
               "source code. Output only the source code.")

# `disasm` comes from harness/pybytecode_core/rep.py: disassemble_v2(code_object)
msgs = [{"role": "user", "content": f"{INSTRUCTION}\n\n{disasm}"}]
batch = tok.apply_chat_template(msgs, add_generation_prompt=True,
                                return_tensors="pt", return_dict=True).to(model.device)
prediction = tok.decode(model.generate(**batch, max_new_tokens=2048,
                                       do_sample=False)[0][batch["input_ids"].shape[1]:],
                        skip_special_tokens=True)

Greedy decoding (temperature 0) for a single shot; temperature ~0.8 when you sample several candidates.

Checking the answer

Compile the model's output and compare the resulting code object to the one you were decompiling. Same code object means same behaviour, so a match tells you this answer is correct:

from harness.pybytecode_core.verify import code_fingerprint

def certified(prediction: str, reference_code_object) -> bool:
    got = compile(prediction, "<pred>", "exec", dont_inherit=True, optimize=0)
    return code_fingerprint(got) == code_fingerprint(reference_code_object)

Two things follow. A failed check means "not confirmed", not "wrong" — a correct rewrite that compiles differently (a while where the original had a for) won't match, so the accuracy figures below are a floor, not an estimate. And because the check is cheap and reliable, sampling several answers and keeping the first one that passes is a real gain rather than a nicer guess.

Results

On the benchmark published with this model:

certified
PyBytecode v3, one attempt506 / 600 = 84.33%
PyBytecode v3, up to 32 tries562 / 600 = 93.67%
Qwen2.5-Coder-1.5B-Instruct before fine-tuning, one attempt4 / 600 = 0.67%

The benchmark is csn-3.12-licensed: 600 real functions from 117 GitHub repositories, compiled to 3.12 bytecode, shipped with the model. The base model before fine-tuning gets essentially none of them, so this is not something a general code model can guess its way through.

Full numbers, confidence intervals, method, per-budget curve and the comparison with other systems: EVAL.md.

PyLingual is another system that does this task, by symbolic reconstruction rather than generation. On our earlier benchmarks it scores about the same as we do, and the two miss on different inputs — so running both and keeping whichever answer passes the check gets you more than either alone. Numbers in EVAL.md.

When it works well, and when it doesn't

It is good on individual functions and gets much worse on long ones. Size is measured in disassembly lines — how long the input you hand the model is. One line tells you:

from harness.pybytecode_core.rep import disassemble_v2
rep_lines = disassemble_v2(code_object).count("\n")
disassembly linesrowsone attemptup to 32 tries
under 10044892.86%98.21%
100–19911265.18%85.71%
200–3993253.12%81.25%
400+80.00%0.00%

Below ~100 lines it is on home ground. Accuracy starts dropping around 200, and above ~400 lines nothing certified at all, even with 32 tries. Sampling more buys roughly one bucket of headroom; it does not remove the limit. For big units, a symbolic decompiler is the better tool. The full seven-bucket curve is in EVAL.md.

Limits

  • Long inputs. The table above is the honest specification: trained on functions, not modules, and it fails above ~400 disassembly lines.
  • Python 3.12 only. Trained and measured on 3.12; the checker refuses other minor versions by design.
  • If the .pyc was built with -O, compile at the same level or the check will not match. Wrong level collapses to ~24%, so try all three — it costs three compiles. At -O and above, docstrings aren't in the .pyc at all, so docstring recovery can't be confirmed against one.
  • A .pyc built by someone else can fail the check even when the answer is right — about 0.33% of the time, because CPython patch releases compile the same source differently. It always fails in the safe direction: "unknown" about a correct answer, never "confirmed" about a wrong one.
  • It has not been shown to work on real malware. On the one packed sample we tried, the entry-point module produced nothing certifiable. Extraction worked; decompiling the actual malware logic did not.
  • Untested: Python 3.13, Nuitka, non-CPython builds, obfuscated bytecode.

Details on all of these in EVAL.md and ORACLE-LIMITS.md.

Model details

Fine-tuned from Qwen/Qwen2.5-Coder-1.5B-Instruct (Apache-2.0) with LoRA on 48,196 pairs of Python 3.12 disassembly → source, adapter merged. The corpus was filtered to permissive licences before training and is not redistributed — per-row attribution was not retained, so shipping it would strip required notices. Lineage: DATA-CARD-training-corpus.md. Training settings: EVAL.md.

Licence

Apache-2.0. See LICENSE and NOTICE.

Derived from Qwen/Qwen2.5-Coder-1.5B-Instruct, which is Apache-2.0. Under Apache-2.0 §4 we ship the licence, retain attribution, and state our changes (LoRA fine-tune, adapter merged; no architecture, vocabulary or tokenizer change). The same obligations pass to you if you redistribute these weights or build derivatives.

Decompilation has obvious dual use. Apache-2.0 imposes no field-of-use restriction and we have not added one. Complying with the law where you operate is your responsibility.

Citation

@software{pybytecode2026,
  title  = {PyBytecode: verified neural decompilation for Python 3.12 bytecode},
  author = {Blazing Customs},
  year   = {2026},
  note   = {Fine-tuned from Qwen2.5-Coder-1.5B-Instruct},
  url    = {https://huggingface.co/BlazingCustoms/pybytecode-v3-1.5b}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
Qwen2ForCausalLM
Ревизия весов
28ff805

0 моделей