Style2Code: A Style-Controllable Code Generation Framework with Dual-Modal Contrastive Representation Learning
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.
Code (1)
Tasks
Code GenerationContrastive LearningLanguage ModelingLanguage ModellingRepresentation LearningMethods 이 논문이 사용한 방법론
Similar Papers 제목 키워드 기반
StyleTalk: One-shot Talking Head Generation with Controllable Speaking Styles
Different people speak with diverse personalized speaking styles. Although existing one-shot talking head methods have made significant progress in lip sync, natural facial expressions, and stable head motions, they stil…
DecoderFace GenerationTalking Face GenerationTalking Head GenerationControllable 3D Face Generation with Conditional Style Code Diffusion
Generating photorealistic 3D faces from given conditions is a challenging task. Existing methods often rely on time-consuming one-by-one optimization approaches, which are not efficient for modeling the same distribution…
Data AugmentationFace GenerationStyleTalk++: A Unified Framework for Controlling the Speaking Styles of Talking Heads
Individuals have unique facial expression and head pose styles that reflect their personalized speaking styles. Existing one-shot talking head methods cannot capture such personalized characteristics and therefore fail t…
Face GenerationTalking Face GenerationControlSpeech: Towards Simultaneous and Independent Zero-shot Speaker Cloning and Zero-shot Language Style Control
In this paper, we present ControlSpeech, a text-to-speech (TTS) system capable of fully cloning the speaker's voice and enabling arbitrary control and adjustment of speaking style. Prior zero-shot TTS models only mimic t…
Speech Synthesistext-to-speechText to SpeechPromptTTS: Controllable Text-to-Speech with Text Descriptions
Using a text description as prompt to guide the generation of text or images (e.g., GPT-3 or DALLE-2) has drawn wide attention recently. Beyond text and image generation, in this work, we explore the possibility of utili…
DecoderSpeech Synthesistext-to-speechText to Speech