Relevance Transformer: Generating Concise Code Snippets with Relevance Feedback
Carlos Gemmell, Federico Rossetto, Jeffrey Dalton

TL;DR
This paper introduces the Relevance Transformer, a novel Transformer-based model for automatic code generation that incorporates pseudo-relevance feedback to improve output relevance and diversity, demonstrating superior performance on standard benchmarks.
Contribution
The paper proposes the Relevance Transformer, which integrates external knowledge via pseudo-relevance feedback into Transformer architectures for enhanced code generation.
Findings
Outperforms state-of-the-art methods on BLEU scores
Effectively incorporates pseudo-relevance feedback during inference
Shows potential of Transformer architectures for code generation
Abstract
Tools capable of automatic code generation have the potential to augment programmer's capabilities. While straightforward code retrieval is incorporated into many IDEs, an emerging area is explicit code generation. Code generation is currently approached as a Machine Translation task, with Recurrent Neural Network (RNN) based encoder-decoder architectures trained on code-description pairs. In this work we introduce and study modern Transformer architectures for this task. We further propose a new model called the Relevance Transformer that incorporates external knowledge using pseudo-relevance feedback. The Relevance Transformer biases the decoding process to be similar to existing retrieved code while enforcing diversity. We perform experiments on multiple standard benchmark datasets for code generation including Django, Hearthstone, and CoNaLa. The results show improvements over…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
MethodsLinear Layer · Absolute Position Encodings · Position-Wise Feed-Forward Layer · Multi-Head Attention · Residual Connection · Attention Is All You Need · *Communicated@Fast*How Do I Communicate to Expedia? · Adam · Softmax · Dense Connections
