atlas

Research map / Image generation / Text-to-image diffusion

PinNet: Pinpoint Instructive Information for Retrieval Augmented Code-to-Text Generation

ICML 2024 · Image generation › Text-to-image diffusion · approach: Text generation and structured prediction

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes PinNet, a retrieval-augmented code-to-text model whose discriminator scores how well a retrieved reference matches the input code and whose representations steer decoder attention (PinAttention), plus a hierarchical contrastive retrieval loss.

Problem

Retrieval-augmented code-to-text generation is hurt when retrieved descriptions are irrelevant or misleading, and dense retrievers trained with contrastive loss suffer a train/inference mismatch because all non-ground-truth descriptions are treated as negatives.

Approach

A discriminator over the retrieved reference is trained to predict BLEU-based relevance classes; its last-layer representations are injected into decoder cross-attention (PinAttention) to emphasize useful reference content, and a hierarchical triplet retrieval loss ranks relevant-but-not-ground-truth descriptions between random and ground-truth ones.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Add PinNet-Dis (ablation)PinNet · CodeXGLUE PythonBLEU-4: 18.52 -> 21.83Helped
Add PinNet-Dis (ablation)PinNet · CodeXGLUE JavaBLEU-4: 21.65 -> 23.48Helped
Add hierarchical retrieval loss LHR (ablation)PinNet · CodeXGLUE PythonBLEU-4: 19.93 -> 21.83Helped
Add hierarchical retrieval loss LHR (ablation)PinNet · CodeXGLUE JavaBLEU-4: 21.78 -> 23.48Helped
Add PinNet-Dis and LHR (ablation)PinNet · CodeXGLUE PythonBLEU-4: 17.88 -> 21.83Helped
Add PinNet-Dis and LHR (ablation)PinNet · CodeXGLUE JavaBLEU-4: 20.31 -> 23.48Helped
Add PinNet-Dis (ablation)PinNet · WikiSQLBLEU: 37.8 -> 38.4Helped
Add PinNet-Dis (ablation)PinNet · StackOverflowBLEU: 20.4 -> 21.9Helped
Add hierarchical retrieval loss LHR (ablation)PinNet-Ret · CodeXGLUE Python retrievalBLEU-4: 15.13 -> 16.15Helped
Add hierarchical retrieval loss LHR (ablation)PinNet-Ret · CodeXGLUE Java retrievalBLEU-4: 15.88 -> 17.07Helped

Surprising findings

Limitations

Experimental setup

Datasets: CodeXGLUE WikiSQL StackOverflow

Benchmarks: CodeXGLUE Python CodeXGLUE Java WikiSQL StackOverflow

Metrics: BLEU-4 BLEU METEOR ROUGE-L SentenceBERT

Baselines: Seq2Seq Transformer RoBERTa (code) CodeBERT GraphCodeBERT CodeT5 UniXcoder PLBART CodeT5+ kNN-Transformer BM25 + PLBART REDCODER

Builds on: REDCODER GraphCodeBERT CodeBERT Transformer BM25

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy