LGSEOct 7, 2020

PyMT5: multi-mode translation of natural language and Python code with transformers

arXiv:2010.03150v11040 citations
Originality Incremental advance
AI Analysis

This addresses the need for automated software development tools by enabling bidirectional translation between code and documentation, though it is incremental as it builds on existing transformer methods.

The paper tackles the problem of translating between Python code and natural language docstrings by introducing PyMT5, a transformer model trained on 26 million Python methods and 7.7 million pairs, which outperforms GPT2 in generating syntactically correct methods (92.1%) and achieves BLEU scores of 8.59 for method generation and 16.3 for docstring generation.

Simultaneously modeling source code and natural language has many exciting applications in automated software development and understanding. Pursuant to achieving such technology, we introduce PyMT5, the Python method text-to-text transfer transformer, which is trained to translate between all pairs of Python method feature combinations: a single model that can both predict whole methods from natural language documentation strings (docstrings) and summarize code into docstrings of any common style. We present an analysis and modeling effort of a large-scale parallel corpus of 26 million Python methods and 7.7 million method-docstring pairs, demonstrating that for docstring and method generation, PyMT5 outperforms similarly-sized auto-regressive language models (GPT2) which were English pre-trained or randomly initialized. On the CodeSearchNet test set, our best model predicts 92.1% syntactically correct method bodies, achieved a BLEU score of 8.59 for method generation and 16.3 for docstring generation (summarization), and achieved a ROUGE-L F-score of 24.8 for method generation and 36.7 for docstring generation.

Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes