Tool

PyLingual

Research decompiler for CPython bytecode from Python 3.6 onward that pairs per-version transformer models with control-flow reconstruction. A segmentation model splits bytecode into statements, a statement model translates each into source, and templates rebuild loops, conditionals, exception handlers, with blocks and match statements. The result is recompiled with the target Python version and its control flow compared with the original bytecode, and failing segments are retried with alternative segmentations; the design is described in the IEEE S&P 2025 paper “PyLingual: Toward Perfect Decompilation of Evolving High-Level Languages”.

Requirements and limitations

  • First release at review: v0.0.1, published 2026-09-21, whose notes report decompilation rates of about 82–87% for Python 3.6–3.12 and about 71% for 3.13–3.15 on the separate pylingual_eval_dataset; these are project-reported figures. The reviewed main commit is 67 commits later and declares version 0.1.0. The README warns that this readability-focused codebase may initially regress in control-flow accuracy compared with the hosted service.
  • Installed from a clone with uv tool install; pyproject.toml requires Python 3.12+ and pulls in PyTorch, Transformers, Hugging Face Hub and xdis. Per-version segmentation and statement models are downloaded from the syssec-utd Hugging Face organization at their unpinned main revision and run on CUDA when available, otherwise on CPU. Model cards differ in declared licenses: the 3.12 statement model states Apache-2.0, while its segmenter states none.
  • Checking a reconstruction compiles it in the target version: uv-managed interpreters cover 3.8–3.15, while 3.6 and 3.7 need pyenv or pyenv-win, which --init-pyenv can install. An optional Redis instance caches model predictions, keyed by version and normalized bytecode but not by model revision. The pylingual.io web service is a hosted alternative, so confidential .pyc files should stay with the local CLI.
  • GPL-3.0-only. Passing the control-flow check does not prove that the recovered source is identical to the original, and recovered code keeps the original owner’s rights. Nothing was installed, no models were run and the paper was checked only for its bibliographic record.

About this entry

Type
Tool
Category
Native analysis tools
Relationship
Foundation tool
Targets
App · Binary

Sources reviewed

The description was reviewed against primary sources. This does not establish runtime testing, security auditing or verified compatibility.

Primary sources

  1. README.md GitHub · syssec-utd/pylingual · Revision 509ea92
  2. pyproject.toml GitHub · syssec-utd/pylingual · Revision 509ea92
  3. pylingual/decompiler_config.yaml GitHub · syssec-utd/pylingual · Revision 509ea92
  4. pylingual/decompiler.py GitHub · syssec-utd/pylingual · Revision 509ea92
  5. pylingual/equivalence_check.py GitHub · syssec-utd/pylingual · Revision 509ea92
  6. pylingual/models.py GitHub · syssec-utd/pylingual · Revision 509ea92
  7. pylingual/control_flow_reconstruction/templates GitHub · syssec-utd/pylingual · Revision 509ea92
  8. LICENSE GitHub · syssec-utd/pylingual · Revision 509ea92
  9. https://github.com/syssec-utd/pylingual/releases/tag/v0.0.1
  10. https://huggingface.co/syssec-utd/py312-pylingual-v1-statement
  11. https://doi.org/10.1109/SP61157.2025.00052