DOBF: A Deobfuscation Pre-Training Objective for Programming Languages

Baptiste Roziere, Marie-Anne Lachaux, Marc Szafraniec, Guillaume Lample
2/15/2021
179 citations
cs.CL

Official code: facebookresearch/CodeGen (778 stars, Python, MIT, last commit 2026-03-12).

Abstract

Recent advances in self-supervised learning have dramatically improved the state of the art on a wide variety of tasks. However, research in language model pre-training has mostly focused on natural languages, and it is unclear whether models like BERT and its variants provide the best pre-training when applied to other modalities, such as source code.

Show full abstract

In this paper, we introduce a new pre-training objective, DOBF, that leverages the structural aspect of programming languages and pre-trains a model to recover the original version of obfuscated source code. We show that models pre-trained with DOBF significantly outperform existing approaches on multiple downstream tasks, providing relative improvements of up to 13% in unsupervised code translation, and 24% in natural language code search. Incidentally, we found that our pre-trained model is able to de-obfuscate fully obfuscated source files, and to suggest descriptive variable names.

View on arXivView PDF

Code Implementations(1)

MIT

Reference implementation of code generation projects from Facebook AI Research. General toolkit to apply machine learning to code, from dataset creation to model training and evaluation. Comes with pretrained models.

778143Python, RustJul 19, 20218 months agoMIT

Similar Papers

Cite this paper

@article{roziere2021dobf,
  title  = {DOBF: A Deobfuscation Pre-Training Objective for Programming Languages},
  author = {Baptiste Roziere and Marie-Anne Lachaux and Marc Szafraniec and Guillaume Lample},
  year   = {2021},
  eprint = {2102.07492},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2102.07492}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2102.07492.svg)](https://codeofpaper.com/paper/2102.07492)

Discussion