-
Out of style: Misadventures with LLMs and code style transfer
Authors:
Karl Munson,
Chih-Kai Ting,
Serenity Wade,
Anish Savla,
Julian Dolby,
Kiran Kate,
Kavitha Srinivas
Abstract:
Like text, programs have styles, and certain programming styles are more desirable than others for program readability, maintainability, and performance. Code style transfer, however, is difficult to automate except for trivial style guidelines such as limits on line length. Inspired by the success of using language models for text style transfer, we investigate if code language models can perform…
▽ More
Like text, programs have styles, and certain programming styles are more desirable than others for program readability, maintainability, and performance. Code style transfer, however, is difficult to automate except for trivial style guidelines such as limits on line length. Inspired by the success of using language models for text style transfer, we investigate if code language models can perform code style transfer. Code style transfer, unlike text transfer, has rigorous requirements: the system needs to identify lines of code to change, change them correctly, and leave the rest of the program untouched. We designed CSB (Code Style Benchmark), a benchmark suite of code style transfer tasks across five categories including converting for-loops to list comprehensions, eliminating duplication in code, adding decorators to methods, etc. We then used these tests to see if large pre-trained code language models or fine-tuned models perform style transfer correctly, based on rigorous metrics to test that the transfer did occur, and the code still passes functional tests. Surprisingly, language models failed to perform all of the tasks, suggesting that they perform poorly on tasks that require code understanding. We will make available the large-scale corpora to help the community build better code models.
△ Less
Submitted 14 June, 2024;
originally announced June 2024.
-
Influence of Rhenium Concentration on Charge Do** and Defect Formation in MoS2
Authors:
Kyle T. Munson,
Riccardo Torsi,
Fatimah Habis,
Lysander Huberich,
Yu-Chuan Lin,
Yue Yuan,
Ke Wang,
Bruno Schuler,
Yuanxi Wang,
John B. Asbury,
Joshua A. Robinson
Abstract:
Substitutionally doped transition metal dichalcogenides (TMDs) are the next step towards realizing TMD-based field effect transistors, sensors, and quantum photonic devices. Here, we report on the influence of Re concentration on charge do** and defect formation in MoS2 monolayers grown by metal-organic chemical vapor deposition. Re-MoS2 films can exhibit reduced sulfur-site defects; however, as…
▽ More
Substitutionally doped transition metal dichalcogenides (TMDs) are the next step towards realizing TMD-based field effect transistors, sensors, and quantum photonic devices. Here, we report on the influence of Re concentration on charge do** and defect formation in MoS2 monolayers grown by metal-organic chemical vapor deposition. Re-MoS2 films can exhibit reduced sulfur-site defects; however, as the Re concentration approaches 2 atom%, there is significant clustering of Re in the MoS2. Ab Initio calculations indicate that the transition from isolated Re atoms to Re clusters increases the ionization energy of Re dopants, thereby reducing Re-do** efficacy. Using photoluminescence spectroscopy, we show that Re dopant clustering creates defect states that trap photogenerated excitons within the MoS2 lattice. These results provide insight into how the local concentration of metal dopants affect carrier density, defect formation, and exciton recombination in TMDs, which can aid the development of future TMD-based devices with improved electronic and photonic properties.
△ Less
Submitted 3 January, 2024; v1 submitted 28 December, 2023;
originally announced December 2023.
-
Dilute Rhenium Do** and its Impact on Intrinsic Defects in MoS2
Authors:
Riccardo Torsi,
Kyle T. Munson,
Rahul Pendurthi,
Esteban A. Marques,
Benoit Van Troeye,
Lysander Huberich,
Bruno Schuler,
Maxwell A. Feidler,
Ke Wang,
Geoffrey Pourtois,
Saptarshi Das,
John B. Asbury,
Yu-Chuan Lin,
Joshua A. Robinson
Abstract:
Substitutionally-doped 2D transition metal dichalcogenides are primed for next-generation device applications such as field effect transistors (FET), sensors, and optoelectronic circuits. In this work, we demonstrate substitutional Rhenium (Re) do** of MoS2 monolayers with controllable concentrations down to 500 parts-per-million (ppm) by metal-organic chemical vapor deposition (MOCVD). Surprisi…
▽ More
Substitutionally-doped 2D transition metal dichalcogenides are primed for next-generation device applications such as field effect transistors (FET), sensors, and optoelectronic circuits. In this work, we demonstrate substitutional Rhenium (Re) do** of MoS2 monolayers with controllable concentrations down to 500 parts-per-million (ppm) by metal-organic chemical vapor deposition (MOCVD). Surprisingly, we discover that even trace amounts of Re lead to a reduction in sulfur site defect density by 5-10x. Ab initio models indicate the free-energy of sulfur-vacancy formation is increased along the MoS2 growth-front when Re is introduced, resulting in an improved stoichiometry. Remarkably, defect photoluminescence (PL) commonly seen in as-grown MOCVD MoS2 is suppressed by 6x at 0.05 atomic percent (at.%) Re and completely quenched with 1 at.% Re. Furthermore, Re-MoS2 transistors exhibit up to 8x higher drain current and enhanced mobility compared to undoped MoS2 because of the improved material quality. This work provides important insights on how dopants affect 2D semiconductor growth dynamics, which can lead to improved crystal quality and device performance.
△ Less
Submitted 31 January, 2023;
originally announced February 2023.
-
Exploring Code Style Transfer with Neural Networks
Authors:
Karl Munson,
Anish Savla,
Chih-Kai Ting,
Serenity Wade,
Kiran Kate,
Kavitha Srinivas
Abstract:
Style is a significant component of natural language text, reflecting a change in the tone of text while kee** 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 wor…
▽ More
Style is a significant component of natural language text, reflecting a change in the tone of text while kee** 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.
△ Less
Submitted 13 September, 2022;
originally announced September 2022.