Learning to Mine Aligned Code and Natural Language Pairs from Stack Overflow
Not on the map. Why?
Abstract (arXiv)
For tasks like code synthesis from natural language, code retrieval, and code summarization, data-driven models have shown great promise. However, creating these models require parallel data between natural language (NL) and code with fine-grained alignments. Stack Overflow (SO) is a promising source to create such a data set: the questions are diverse and most of them have corresponding answers with high-quality code snippets. However, existing heuristic methods (e.g., pairing the title of a post with the code in the accepted answer) are limited both in their coverage and the correctness of the NL-code pairs obtained. In this paper, we propose a novel method to mine high-quality aligned data from SO using two sets of features: hand-crafted features considering the structure of the extracted snippets, and correspondence features obtained by training a probabilistic model to capture the correlation between NL and code using neural networks. These features are fed into a classifier that determines the quality of mined NL-code pairs. Experiments using Python and Java as test beds show that the proposed method greatly expands coverage and accuracy over existing mining methods, even when using only a small number of labeled examples. Further, we find that reasonable results are achieved even when training the classifier on one language and testing on another, showing promise for scaling NL-code mining to a wide variety of programming languages beyond those for which we are able to annotate data.
Key facts. Cited by 165 papers in the map (data through 7 Oct 2026). First posted on arXiv 23 May 2018.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 17; 2022: 34; 2023: 24; 2024: 49; 2025: 31; 2026: 10.
165 papers.
Sort:
By area:
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2024A Survey on Large Language Models for Code Generationcited by 646
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
- 2022DS-1000: A Natural and Reliable Benchmark for Data Science Code Generationcited by 442
- 2024CodeAgent: Enhancing Code Generation with Tool-Integrated Agent Systems for Real-World Repo-level Coding Challengescited by 278
- 2024CodeS: Towards Building Open-source Language Models for Text-to-SQLcited by 183
- 2023OctoPack: Instruction Tuning Code Large Language Modelscited by 178
- 2024SciCode: A Research Coding Benchmark Curated by Scientistscited by 172
- 2023ClassEval: A Manually-Crafted Benchmark for Evaluating LLMs on Class-level Code Generationcited by 166
- 2022Multi-lingual Evaluation of Code Generation Modelscited by 158
- 2022DocPrompting: Generating Code by Retrieving the Docscited by 151
- 2022Large Language Models Meet NL2Code: A Surveycited by 135
38 more
- 2022MultiPL-E: A Scalable and Extensible Approach to Benchmarking Neural Code Generationcited by 132
- 2024OpenFedLLM: Training Large Language Models on Decentralized Private Data via Federated Learningcited by 124
- 2022Natural Language to Code Translation with Executioncited by 122
- 2023CodeBERTScore: Evaluating Code Generation with Pretrained Models of Codecited by 101
- 2022Execution-Based Evaluation for Open-Domain Code Generationcited by 89
- 2021CoSQA: 20,000+ Web Queries for Code Search and Question Answeringcited by 74
- 2023Can ChatGPT replace StackOverflow? A Study on Robustness and Reliability of Large Language Model Code Generationcited by 72
- 2024EvoCodeBench: An Evolving Code Generation Benchmark Aligned with Real-World Code Repositoriescited by 71
- 2024DevEval: A Manually-Annotated Code Generation Benchmark Aligned with Real-World Code Repositoriescited by 71
- 2022Out of the BLEU: how should we assess quality of the Code Generation models?cited by 65
- 2022Parsel: Algorithmic Reasoning with Language Models by Composing Decompositionscited by 62
- 2024What's Wrong with Your Code Generated by Large Language Models? An Extensive Studycited by 52
- 2023ICE-Score: Instructing Large Language Models to Evaluate Codecited by 50
- 2023xCodeEval: A Large Scale Multilingual Multitask Benchmark for Code Understanding, Generation, Translation and Retrievalcited by 46
- 2023SelfEvolve: A Code Evolution Framework via Large Language Modelscited by 43
- 2021SpreadsheetCoder: Formula Prediction from Semi-structured Contextcited by 41
- 2022MCoNaLa: A Benchmark for Code Generation from Multiple Natural Languagescited by 41
- 2024CodeJudge: Evaluating Code Generation with Large Language Modelscited by 41
- 2024LAB: Large-Scale Alignment for ChatBotscited by 39
- 2025LessLeak-Bench: A First Investigation of Data Leakage in LLMs Across 83 Software Engineering Benchmarkscited by 34
- 2024EvoCodeBench: An Evolving Code Generation Benchmark with Domain-Specific Evaluationscited by 33
- 2023Measuring The Impact Of Programming Language Distributioncited by 32
- 2024Evaluating Language Models as Synthetic Data Generatorscited by 32
- 2025From Language to Action: A Review of Large Language Models as Autonomous Agents and Tool Userscited by 32
- 2022Execution-based Evaluation for Data Science Code Generation Modelscited by 31
- 2023CodeFusion: A Pre-trained Diffusion Model for Code Generationcited by 31
- 2022On the Importance of Building High-quality Training Datasets for Neural Code Searchcited by 30
- 2025MergeBench: A Benchmark for Merging Domain-Specialized LLMscited by 30
- 2022ERNIE-Code: Beyond English-Centric Cross-lingual Pretraining for Programming Languagescited by 29
- 2023Exploring Parameter-Efficient Fine-Tuning Techniques for Code Generation with Large Language Modelscited by 28
- 2024CodeS: Natural Language to Code Repository via Multi-Layer Sketchcited by 28
- 2024Revisiting Code Similarity Evaluation with Abstract Syntax Tree Edit Distancecited by 26
- 2025ProjectEval: A Benchmark for Programming Agents Automated Evaluation on Project-Level Code Generationcited by 26
- 2024Are Large Language Models Reliable Argument Quality Annotators?cited by 24
- 2024HumanEvalComm: Benchmarking the Communication Competence of Code Generation for LLMs and LLM Agentcited by 24
- 2024Automatically Generating UI Code from Screenshot: A Divide-and-Conquer-Based Approachcited by 24
- 2021CoDesc: A Large Code-Description Parallel Datasetcited by 23
- 2021A Survey on Machine Learning Techniques for Source Code Analysiscited by 23
50 most cited of 165 All 165 (JSON)
- 2026Accuracy and Satisfaction in Multi-Turn LLM Dialogues for NFR Assessment23 Jun 2026
- 2026CodeTeam: An LLM-Powered Multi-Agent Framework for Repository-Level Code Generation20 Jun 2026
- 2026HyperLens: Quantifying Cognitive Effort in LLMs with Fine-grained Confidence Trajectory7 May 2026
- 2026Multimodal Data Curation Through Ranked Retrieval1 May 2026
- 2026RAG-Reflect: Agentic Retrieval-Augmented Generation with Reflections for Comment-Driven Code Maintenance on Stack Overflow24 Apr 2026
- 2026Precise Debugging Benchmark: Is Your Model Debugging or Regenerating?19 Apr 2026
- 2026Why Gaussian Diffusion Models Fail on Discrete Data and How to Prevent It?2 Apr 2026
- 2026LLM-Based Multi-Agent Systems for Code Generation: A Multi-Vocal Literature Review25 Feb 2026
- 2026DevBench: A Realistic, Developer-Informed Benchmark for Code Generation Models17 Jan 2026
- 2026CSSG: Measuring Code Similarity with Semantic Graphs7 Jan 2026
- 2025SoK: Understanding (New) Security Issues Across AI4Code Use Cases20 Dec 2025
- 2025PEFT-Factory: Unified Parameter-Efficient Fine-Tuning of Autoregressive Large Language Models2 Dec 2025
38 more
- 2025PEFT-Bench: A Parameter-Efficient Fine-Tuning Methods Benchmark26 Nov 2025
- 2025MATCH: Task-Driven Code Evaluation through Contrastive Learning27 Oct 2025
- 2025David vs. Goliath: A comparative study of different-sized LLMs for code generation in the domain of automotive scenario generation15 Oct 2025
- 2025Guided Star-Shaped Masked Diffusion9 Oct 2025
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approaches6 Oct 2025
- 2025Handling Open-Vocabulary Constructs in Formalizing Specifications: Retrieval-Augmented Parsing with Expert Knowledge10 Sep 2025
- 2025Granite Embedding R2 Models26 Aug 2025
- 2025From Language to Action: A Review of Large Language Models as Autonomous Agents and Tool Users24 Aug 2025
- 2025RegMean++: Enhancing Effectiveness and Generalization of Regression Mean for Model Merging5 Aug 2025
- 2025EAC-MoE: Expert-Selection Aware Compressor for Mixture-of-Experts Large Language Models3 Aug 2025
- 2025Enhancing Project-Specific Code Completion by Inferring Internal API Information28 Jul 2025
- 2025Improving LoRA with Variational Learning17 Jun 2025
- 2025LASER: Stratified Selective Sampling for Instruction Tuning with Dedicated Scoring Strategy28 May 2025
- 2025Large Language Models for IT Automation Tasks: Are We There Yet?26 May 2025
- 2025MergeBench: A Benchmark for Merging Domain-Specialized LLMs16 May 2025
- 2025CoCo-Bench: A Comprehensive Code Benchmark For Multi-task Large Language Model Evaluation29 Apr 2025
- 2025CodeVisionary: An Agent-based Framework for Evaluating Large Language Models in Code Generation18 Apr 2025
- 2025DDPT: Diffusion-Driven Prompt Tuning for Large Language Model Code Generation6 Apr 2025
- 2025Sigma: A dataset for text-to-code semantic parsing with statistical analysis5 Apr 2025
- 2025A Study of LLMs' Preferences for Libraries and Programming Languages21 Mar 2025
- 2025CoDet-M4: Detecting Machine-Generated Code in Multi-Lingual, Multi-Generator and Multi-Domain Settings17 Mar 2025
- 2025A Semantic-based Optimization Approach for Repairing LLMs: Case Study on Code Generation17 Mar 2025
- 2025ProjectEval: A Benchmark for Programming Agents Automated Evaluation on Project-Level Code Generation10 Mar 2025
- 2025Benchmarking AI Models in Software Engineering: A Review, Search Tool, and Unified Approach for Elevating Benchmark Quality7 Mar 2025
- 2025ThrowBench: Benchmarking LLMs by Predicting Runtime Exceptions6 Mar 2025
- 2025URECA: The Chain of Two Minimum Set Cover Problems exists behind Adaptation to Shifts in Semantic Code Search11 Feb 2025
- 2025SnipGen: A Mining Repository Framework for Evaluating LLMs for Code10 Feb 2025
- 2025LessLeak-Bench: A First Investigation of Data Leakage in LLMs Across 83 Software Engineering Benchmarks10 Feb 2025
- 2025An Empirical Study of Retrieval-Augmented Code Generation: Challenges and Opportunities23 Jan 2025
- 2024SPDZCoder: Combining Expert Knowledge with LLMs for Generating Privacy-Computing Code31 Dec 2024
- 2024Selective Shot Learning for Code Explanation17 Dec 2024
- 2024Evaluating Language Models as Synthetic Data Generators4 Dec 2024
- 2024AutoPLC: Generating Vendor-Aware Structured Text for Programmable Logic Controllers3 Dec 2024
- 2024Understanding the Fundamental Design Decisions of Retrieval-Augmented Generation Systems29 Nov 2024
- 2024A Preliminary Study of Multilingual Code Language Models for Code Generation Task Using Translated Benchmarks23 Nov 2024
- 2024Model Editing for LLMs4Code: How Far are We?11 Nov 2024
- 2024Assessing the Answerability of Queries in Retrieval-Augmented Code Generation8 Nov 2024
- 2024GitChameleon: Unmasking the Version-Switching Capabilities of Code Generation Models5 Nov 2024
50 newest of 165 All 165 (JSON)
- 2024CodeAgent: Enhancing Code Generation with Tool-Integrated Agent Systems for Real-World Repo-level Coding Challengescited by 278
- 2025From Language to Action: A Review of Large Language Models as Autonomous Agents and Tool Userscited by 32
- 2025ProjectEval: A Benchmark for Programming Agents Automated Evaluation on Project-Level Code Generationcited by 26
- 2024HumanEvalComm: Benchmarking the Communication Competence of Code Generation for LLMs and LLM Agentcited by 24
- 2024CoSQA+: Pioneering the Multi-Choice Code Search Benchmark with Test-Driven Agentscited by 11
- 2025CodeVisionary: An Agent-based Framework for Evaluating Large Language Models in Code Generationcited by 6
- 2026LLM-Based Multi-Agent Systems for Code Generation: A Multi-Vocal Literature Reviewcited by 2
- 2026CodeTeam: An LLM-Powered Multi-Agent Framework for Repository-Level Code Generationcited by 2
- 2026CodeTeam: An LLM-Powered Multi-Agent Framework for Repository-Level Code Generation20 Jun 2026
- 2026LLM-Based Multi-Agent Systems for Code Generation: A Multi-Vocal Literature Review25 Feb 2026
- 2025From Language to Action: A Review of Large Language Models as Autonomous Agents and Tool Users24 Aug 2025
- 2025CodeVisionary: An Agent-based Framework for Evaluating Large Language Models in Code Generation18 Apr 2025
- 2025ProjectEval: A Benchmark for Programming Agents Automated Evaluation on Project-Level Code Generation10 Mar 2025
- 2024CoSQA+: Pioneering the Multi-Choice Code Search Benchmark with Test-Driven Agents17 Jun 2024
- 2024HumanEvalComm: Benchmarking the Communication Competence of Code Generation for LLMs and LLM Agent31 May 2024
- 2024CodeAgent: Enhancing Code Generation with Tool-Integrated Agent Systems for Real-World Repo-level Coding Challenges14 Jan 2024
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approachescited by 20
- 2025An Empirical Study of Retrieval-Augmented Code Generation: Challenges and Opportunitiescited by 17
- 2024Understanding the Fundamental Design Decisions of Retrieval-Augmented Generation Systemscited by 7
- 2024Evaluating the Effectiveness and Efficiency of Demonstration Retrievers in RAG for Coding Taskscited by 2
- 2026RAG-Reflect: Agentic Retrieval-Augmented Generation with Reflections for Comment-Driven Code Maintenance on Stack Overflowcited by 1
- 2024Assessing the Answerability of Queries in Retrieval-Augmented Code Generationcited by 0
- 2025Handling Open-Vocabulary Constructs in Formalizing Specifications: Retrieval-Augmented Parsing with Expert Knowledgecited by 0
- 2026RAG-Reflect: Agentic Retrieval-Augmented Generation with Reflections for Comment-Driven Code Maintenance on Stack Overflow24 Apr 2026
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approaches6 Oct 2025
- 2025Handling Open-Vocabulary Constructs in Formalizing Specifications: Retrieval-Augmented Parsing with Expert Knowledge10 Sep 2025
- 2025An Empirical Study of Retrieval-Augmented Code Generation: Challenges and Opportunities23 Jan 2025
- 2024Understanding the Fundamental Design Decisions of Retrieval-Augmented Generation Systems29 Nov 2024
- 2024Assessing the Answerability of Queries in Retrieval-Augmented Code Generation8 Nov 2024
- 2024Evaluating the Effectiveness and Efficiency of Demonstration Retrievers in RAG for Coding Tasks12 Oct 2024
- 2023CodeFusion: A Pre-trained Diffusion Model for Code Generationcited by 31
- 2025Guided Star-Shaped Masked Diffusioncited by 5
- 2026Why Gaussian Diffusion Models Fail on Discrete Data and How to Prevent It?cited by 3
- 2025DDPT: Diffusion-Driven Prompt Tuning for Large Language Model Code Generationcited by 2
- 2026Why Gaussian Diffusion Models Fail on Discrete Data and How to Prevent It?2 Apr 2026
- 2025Guided Star-Shaped Masked Diffusion9 Oct 2025
- 2025DDPT: Diffusion-Driven Prompt Tuning for Large Language Model Code Generation6 Apr 2025
- 2023CodeFusion: A Pre-trained Diffusion Model for Code Generation26 Oct 2023
- 2024Evaluating Language Models as Synthetic Data Generatorscited by 32
- 2024Evaluating Language Models as Synthetic Data Generators4 Dec 2024
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2024A Survey on Large Language Models for Code Generationcited by 646
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
- 2022DS-1000: A Natural and Reliable Benchmark for Data Science Code Generationcited by 442
- 2024CodeS: Towards Building Open-source Language Models for Text-to-SQLcited by 183
- 2023OctoPack: Instruction Tuning Code Large Language Modelscited by 178
- 2024SciCode: A Research Coding Benchmark Curated by Scientistscited by 172
- 2023ClassEval: A Manually-Crafted Benchmark for Evaluating LLMs on Class-level Code Generationcited by 166
- 2022Multi-lingual Evaluation of Code Generation Modelscited by 158
- 2022DocPrompting: Generating Code by Retrieving the Docscited by 151
- 2022Large Language Models Meet NL2Code: A Surveycited by 135
- 2022MultiPL-E: A Scalable and Extensible Approach to Benchmarking Neural Code Generationcited by 132
12 most cited of 141 All 141 (JSON)
- 2026Accuracy and Satisfaction in Multi-Turn LLM Dialogues for NFR Assessment23 Jun 2026
- 2026HyperLens: Quantifying Cognitive Effort in LLMs with Fine-grained Confidence Trajectory7 May 2026
- 2026Multimodal Data Curation Through Ranked Retrieval1 May 2026
- 2026Precise Debugging Benchmark: Is Your Model Debugging or Regenerating?19 Apr 2026
- 2026DevBench: A Realistic, Developer-Informed Benchmark for Code Generation Models17 Jan 2026
- 2026CSSG: Measuring Code Similarity with Semantic Graphs7 Jan 2026
- 2025SoK: Understanding (New) Security Issues Across AI4Code Use Cases20 Dec 2025
- 2025PEFT-Factory: Unified Parameter-Efficient Fine-Tuning of Autoregressive Large Language Models2 Dec 2025
- 2025PEFT-Bench: A Parameter-Efficient Fine-Tuning Methods Benchmark26 Nov 2025
- 2025MATCH: Task-Driven Code Evaluation through Contrastive Learning27 Oct 2025
- 2025David vs. Goliath: A comparative study of different-sized LLMs for code generation in the domain of automotive scenario generation15 Oct 2025
- 2025Granite Embedding R2 Models26 Aug 2025
12 newest of 141 All 141 (JSON)