UniGenCoder: Merging Seq2Seq and Seq2Tree Paradigms for Unified Code Generation

Liangying Shao, Yanfu Yan, Denys Poshyvanyk, Jinsong Su
2/18/2025
cs.CL

No confident code implementation found for this paper.

Abstract

Deep learning-based code generation has completely transformed the way developers write programs today. Existing approaches to code generation have focused either on the Sequence-to-Sequence paradigm, which generates target code as a sequence of tokens, or the Sequence-to-Tree paradigm, which outputs code as a sequence of actions.

Show full abstract

While these two paradigms are intuitively complementary, their combination has not been previously explored. By comparing the code generated under these two paradigms, we find that integrating them holds significant potential. In this paper, we propose UniGenCoder for code-related generation tasks, which consists of a shared encoder, a shared decoder with a minimal set of additional parameters to unify two paradigms, and a selector that dynamically chooses optimal paradigm for each instance. Also, during the model training, we first perform the multi-task learning and distillation strategies to facilitate knowledge transfer between two paradigms, and then leverage contrastive learning to train the selector. Experimental results on the text-to-code and code-to-code generation tasks demonstrate the effectiveness of our proposed model. We release our code at https://github.com/DeepLearnXMU/UniGenCoder.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{shao2025unigencoder,
  title  = {UniGenCoder: Merging Seq2Seq and Seq2Tree Paradigms for Unified Code Generation},
  author = {Liangying Shao and Yanfu Yan and Denys Poshyvanyk and Jinsong Su},
  year   = {2025},
  eprint = {2502.12490},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.12490v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.12490.svg)](https://codeofpaper.com/paper/2502.12490)

Discussion