mlsanityData to 7 Oct 2026

Out of style: Misadventures with LLMs and code style transfer

arXiv 2406.10320 ↗First posted 14 Jun 2024cs.SE cs.AIcited by 1

Not on the map. Why?

Abstract (arXiv)

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.

Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 14 of its 22 references that are in the map. First posted on arXiv 14 Jun 2024.

Builds on

14 of 22 references.

References · 14

  1. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  2. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  3. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  4. 2023StarCoder: may the source be with you!cited by 790
  5. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  6. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
  7. 2021Unified Pre-training for Program Understanding and Generationcited by 361
  8. 2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Taskscited by 199
  9. 2020Deep Learning for Text Style Transfer: A Surveycited by 161
  10. 2021A Recipe For Arbitrary Text Style Transfer with Large Language Modelscited by 107
  11. 2020Exploring Software Naturalness through Neural Language Modelscited by 32
  12. 2014Learning Natural Coding Conventionscited by 28
2 more
  1. 2019Style Transfer for Texts: Retrain, Report Errors, Compare with Rewritescited by 19
  2. 2022Automated Transpilation of Imperative to Functional Code using Neural-Guided Program Synthesis (Extended Version)cited by 7

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 1.

1 paper.