Exploring Code Style Transfer with Neural Networks
Karl Munson, Anish Savla, Chih-Kai Ting, Serenity Wade, Kiran Kate,, Kavitha Srinivas

TL;DR
This paper investigates the concept of code style in Python, defining style attributes through hierarchical clustering and evaluating the ability of pre-trained language models to transfer code style.
Contribution
It introduces a novel method to define code style attributes without explicit transformations and assesses pre-trained models' effectiveness in style transfer tasks.
Findings
Hierarchical clustering effectively captures Python code style attributes.
Pre-trained code language models can be fine-tuned for code style transfer.
The approach provides a new way to quantify and manipulate programming style.
Abstract
Style is a significant component of natural language text, reflecting a change in the tone of text while keeping the underlying information the same. Even though programming languages have strict syntax rules, they also have style. Code can be written with the same functionality but using different language features. However, programming style is difficult to quantify, and thus as part of this work, we define style attributes, specifically for Python. To build a definition of style, we utilized hierarchical clustering to capture a style definition without needing to specify transformations. In addition to defining style, we explore the capability of a pre-trained code language model to capture information about code style. To do this, we fine-tuned pre-trained code-language models and evaluated their performance in code style transfer tasks.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Computational Physics and Python Applications · Topic Modeling
