Style2Code: A Style-Controllable Code Generation Framework with Dual-Modal Contrastive Representation Learning
Not on the map. Why?
Abstract (arXiv)
Controllable code generation, the ability to synthesize code that follows a specified style while maintaining functionality, remains a challenging task. We propose a two-stage training framework combining contrastive learning and conditional decoding to enable flexible style control. The first stage aligns code style representations with semantic and structural features. In the second stage, we fine-tune a language model (e.g., Flan-T5) conditioned on the learned style vector to guide generation. Our method supports style interpolation and user personalization via lightweight mixing. Compared to prior work, our unified framework offers improved stylistic control without sacrificing code correctness. This is among the first approaches to combine contrastive alignment with conditional decoding for style-guided code generation.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 9 of its 16 references that are in the map. First posted on arXiv 26 May 2025.
Builds on
9 of 16 references.
References · 9
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,744
- 2017Abstract Syntax Networks for Code Generation and Semantic Parsingcited by 92
- 2023Automatic Semantic Augmentation of Language Model Prompts (for Code Summarization)cited by 72
- 2022Out of the BLEU: how should we assess quality of the Code Generation models?cited by 65
- 2020Self-Supervised Contrastive Learning for Code Retrieval and Summarization via Semantic-Preserving Transformationscited by 49
- 2021A Review of Text Style Transfer using Deep Learningcited by 18
- 2023Code-Style In-Context Learning for Knowledge-Based Question Answeringcited by 13
- 2024MPCODER: Multi-user Personalized Code Generator with Explicit and Implicit Style Representation Learningcited by 12
- 2025I Can Find You in Seconds! Leveraging Large Language Models for Code Authorship Attributioncited by 6
Built on by
Citing papers per year: 2026: 1.
1 paper.