“Learning C to X86 Translation: An Experiment in Neural Compilation”, Jordi Armengol-Estapé, Michael F. P. O’Boyle2021-08-17 (; similar)⁠:

Deep learning has had an impact on many fields. Recently, code-to-code neural models have been used in code translation, code refinement and decompilation. However, the question of whether these models can automate compilation has yet to be investigated.

In this work, we explore neural compilation: building and evaluating Transformer models that learn how to produce x86 assembler from C code.

Although preliminary results are relatively weak, we make our data, models and code publicly available to encourage further research in this area.

… While we can successfully generate syntactically correct assembler >80% of the time and obtain high BLEU scores ~90%, generating semantically correct assembler is more challenging. The best model can only compile correctly ~33% of the functions in a benchmark built from an existing program synthesis evaluation set4; it specially struggles to compile functions with numerous arguments and arrays.