Learning to mine aligned code and natural language pairs from stack overflow
Open accessThe DOI matches its Crossref record; 53 of the 53 references it cites were found in a registry or an index.
Abstract
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.
Overview
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Integrity signals
Registry
Cites
Statistics
Verification
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
The check wasn’t confident either way, so it gives no verdict — never disputed.
In the citing paper
“This model reports state-of-the-art accuracy on the CoNaLa benchmark dataset [122]”
From In-IDE Code Generation from Natural Language: Promise and Challenges (2022) · cites this paper as [122]
Experimental — accuracy not yet measured
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Citations
Cites
Adam: A Method for Stochastic Optimization
Kingma, D. P., & Ba, J. (2014) · arXiv · doi:10.48550/arxiv.1412.6980 · Cited by 98,946 · cited 1×
“vent overfitting, on the input of the last softmax layer over target words (p = 0.5), and recurrent dropout [11] on RNNs (p = 0.2). We train the network using the widely used optimization method Adam [18]. To evaluate the neural network, we use the remaining 10% of pairs left aside for testing, retaining the model wit…”
MethodInfluential(2014) · Cited by 33,419
Sequence to Sequence Learning with Neural Networks
Sutskever, I., Vinyals, O., & Le, Q. V. (2014) · arXiv · doi:10.48550/arxiv.1409.3215 · Cited by 17,766 · cited 1×
“So how do neural MT models calculate this probability? We will explain a basic outline of a basic model called the encoder-decoder model [39], and refer readers to references for details [4, 25, 39].”
BackgroundEffective Approaches to Attention-based Neural Machine Translation
Luong, T., Pham, H., & Manning, C. D. (2015) · Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing · doi:10.18653/v1/d15-1166 · Cited by 8,382 · cited 1×
“allows the model to “focus” on particular words in the source snippet S when generating the intent I. The details of attention are beyond the scope of this paper, but interested readers can reference [4, 22]. Why attentional neural MT models?: Attention-based neural MT models are well-suited to the task of learning co…”
BackgroundLearning deep structured semantic models for web search using clickthrough data
Huang, P.-S., He, X., Gao, J., Deng, L., Acero, A., & Heck, L. (2013) · Proceedings of the 22nd ACM international conference on Information & Knowledge Management · doi:10.1145/2505515.2505665 · Cited by 2,009 · cited 1×
“Second, they are powerful models that can learn correspondences on a variety of levels; from simple phenomena such as direct word-by-word matches [12], to soft paraphrases [36], to weak correspondences between keywords and large documents for information retrieval [14].”
BackgroundInternational Conference on Learning Representations (ICLR)
Abbas, M. Z. A., Kivinen, J., & Raiko, T. (2016) · Cited by 1,694
A theoretically grounded application of dropout in recurrent neural networks
Gal, Y., & Ghahramani, Z. (2016) · Cambridge University Engineering Department Publications Database · Cited by 1,583
Incorporating Copying Mechanism in Sequence-to-Sequence Learning
Gu, J., Lu, Z., Li, H., & Li, V. O. K. (2016) · Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) · doi:10.18653/v1/p16-1154 · Cited by 1,446 · cited 1×
“classifier, as described in the following paragraph. Second, they are powerful models that can learn correspondences on a variety of levels; from simple phenomena such as direct word-by-word matches [12], to soft paraphrases [36], to weak correspondences between keywords and large documents for information retrieval […”
BackgroundStatistical machine translation
(2010) · Choice Reviews Online · doi:10.5860/choice.47-6293 · Cited by 1,309
Recurrent Continuous Translation Models
Kalchbrenner, N., & Blunsom, P. (2013) · Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing · doi:10.18653/v1/d13-1176 · Cited by 1,232 · cited 1×
“between natural language and code for the purposes of code summarization [15, 30], code synthesis from natural language [21], and code retrieval [3]. In particular, we use a model based on neural MT [4, 17], a method for MT based on neural networks that is well-suited for this task of learning correspondences for a va…”
Method
Cited by
Items 201–231 of 231
Generating Algorithmic Patterns from Semi-structured Input Using a Transition-Based Neural Network
Rikk, R., Várkonyi, T. A., Borsi, Z. R., Pintér, B., & Gregorics, T. (2022) · Lecture notes in networks and systems · doi:10.1007/978-3-031-16078-3_57
DETECTION OF SOURCE CODE IN INTERNET TEXTS USING AUTOMATICALLY GENERATED MACHINE LEARNING MODELS
Badurowicz, M. (2022) · Applied Computer Science · doi:10.35784/acs-2022-7
“, training ML systems to understand natural language to produce output in a given programming language, starting with CoNaLa dataset (Yin et al., 2018) and currently available commercial products like GitHub Copilot (GitHub Copilot – Your AI Pair Programmer, n.”
BackgroundPeer Review #3 of "Code4ML: a large-scale dataset of annotated Machine Learning code (v0.1)"
(2023) · PeerJ Computer Science · doi:10.7287/peerj-cs.1230v0.1/reviews/3
Peer Review #2 of "Code4ML: a large-scale dataset of annotated Machine Learning code (v0.1)"
(2023) · PeerJ Computer Science · doi:10.7287/peerj-cs.1230v0.1/reviews/2
Peer Review #1 of "Code4ML: a large-scale dataset of annotated Machine Learning code (v0.1)"
(2023) · PeerJ Computer Science · doi:10.7287/peerj-cs.1230v0.1/reviews/1
When self-supervision met Query ExpansionPreprint
Liu, X. (2023) · doi:10.36227/techrxiv.24101100.v1 · Cited by 1
When self-supervision met Query ExpansionPreprint
Liu, X. (2023) · doi:10.36227/techrxiv.24101100
Natural Language Annotations for Reasoning about Program Semantics
Zocca, M. (2023) · Findings of the Association for Computational Linguistics: EMNLP (Findings of EMNLP) · doi:10.18653/v1/2023.findings-emnlp.601
SYNC: A Structurally Guided Hard Negative Curricula for Generalizable Neural Code Search
Naik, A., Das, S., Vedurada, J., & Aditya, S. (2023) · International Joint Conference on Natural Language Processing and Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics (IJCNLP-AACL) · doi:10.18653/v1/2023.ijcnlp-main.7 · Cited by 1
“CoNaLa (Yin et al., 2018) has 600k automatically mined intent-snippet pairs from Stack-Overflow, alongwith 2.9k manually annotated pairs (2.4k/500 train/test).”
MethodA deep learning odyssey on structured natural language processing
Gupta, A. (2022) · doi:10.31274/td-20240329-4 · Cited by 1
Neural code generation for robust automatic program repair
Wang, W. (2024) · DR-NTU (Nanyang Technological University) · doi:10.32657/10356/173910 · Cited by 2
Dheeravath, K., & Saritha, S. J. (2024) · International Journal of Computing and Digital Systems · doi:10.12785/ijcds/160126
“These statistical models necessitate annotated datasets featuring input-output pairs, bypassing the need for explicit rule sets [4].”
Transformers based Python Code Generation from Natural Language
Edem, S., & Vanga, A. R. (2024) · International Conference on Innovative Trends in Information Technology (ICITIIT) · doi:10.1109/icitiit61487.2024.10580762
“The CoNaLa[13] and Django[14] datasets are widely accessible and acknowledged in the public domain.”
BackgroundDataRecipe --- How to Cook the Data for CodeLLM?
Kim, K., Kim, J., Park, B., Kim, D., Chong, C. Y., Wang, Y., Sun, T., Tang, X., Klein, J., & Bissyandé, T. F. (2024) · IEEE/ACM International Conference on Automated Software Engineering (ASE) · doi:10.1145/3691620.3695593 · Cited by 8
Reflexiones y prácticas docentes durante la pandemia de covid-19
Lozano, E. G. M., Mata-López, W. A., Reyes, P. D., Álvarez-Xochihua, O., Alvarado, M. C., Pérez-Hernández, M. G., Preciado, L. O. H., Espinoza, J. A. V., Gonzalez-Fraga, J. A., Pulido, J. R. G., et al. (2024) · Universidad de Colima eBooks · doi:10.53897/li.2024.0037.ucol
SDGNN: Structure-aware Dual Graph Neural Network for Code Summarization
Hao, Z., Lin, Z., Zhang, S., Xu, B., & Cai, R. (2025) · International Journal of Machine Learning and Cybernetics · doi:10.1007/s13042-024-02471-2
MGS3: A Multi-Granularity Self-Supervised Code Search Framework
Li, R., Kang, J., Liu, Q., He, L., Zhang, Z., Sha, Y., Zhu, L., & Huang, Z. (2025) · ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD) · doi:10.1145/3690624.3709263 · Cited by 1
Specializing LLMs for Code: A Framework for Efficient Adaptation and Robust Evaluation
Singh, A., & Chen, J. (2025) · International Conference on Foundation and Large Language Models (FLLM) · doi:10.1109/fllm67465.2025.11391170
“CoNaLa [16] offers a vast collection of code snippet generation pairs, yet its focus on snippet retrieval limits its ability to test multi-step logical reasoning.”
Boosting Code Retrieval Performance on Q\&A Sites with Neural Mutual AttentionsPreprint
Bibi, N., Babar, M., Kaleem, S., Waheed, N., Khan, Z., & Qureshi, B. (2026) · Research Square · doi:10.21203/rs.3.rs-8817065/v1
LLM-based multi-agent systems for code generation: A multi-vocal literature review
Rasheeda, Z., Waseema, M., Kemella, K.-K., Saari, M., & Abrahamsson, P. (2026) · Journal of Systems and Software · doi:10.1016/j.jss.2026.113142 · Cited by 3
“As shown in Table 8, this category includes APPS [38], CodeContests [39], CodeContests-Test [39], LiveCodeBench [40], Vsplot-Bench, CoNaLa [41], Galeras [42], and MathQA [30], all of which consist of multi-task programming or reasoning problems designed to reflect competitive or real-world…”
Covert Knowledge Poisoning Attacks in Retrieval-Augmented Code Generation
Zhang, Y., Chen, M., He, X., Cong, T., Xu, K., & Li, Q. (2026) · IEEE Transactions on Dependable and Secure Computing · doi:10.1109/tdsc.2026.3686845
Zhang, F., Wu, L., Bai, H., Lin, G., Li, X. F., Yu, X., Wang, Y., Chen, B., & Keung, J. (2026) · ACM Transactions on Software Engineering and Methodology · doi:10.1145/3813804 · Cited by 1
Zhang, Y., Yao, K., Zhang, L., & Zhao, C. (2026) · Expert Systems with Applications · doi:10.1016/j.eswa.2026.133242 · Cited by 2
CupCleaner: a hybrid data cleaning approach for comment updating
Liang, Q., Sun, Z., Zhu, Q., Hu, J., Zhao, Y., Zhang, Y., & Zhang, L. (2026) · Science China Information Sciences · doi:10.1007/s11432-024-4637-2 · Cited by 4
SPDZCoder: Combining Expert Knowledge with LLMs for Generating Privacy-Computing Code
Dong, X., Xin, P., Huang, L., Wang, Y., Li, J., & Xu, W. (2026) · ACM Transactions on Software Engineering and Methodology · doi:10.1145/3845985 · Cited by 1
“Using a non-zero temperature is necessary for meaningful pass@k evaluation: when the temperature approaches 0 , the model becomes nearly deterministic, resulting in 𝑘 identical samples and causing pass@k to collapse to pass@1.”
Optimization-Free Repair of Code LLMs: A Closed-Form Fisher-Guided Bayesian Approach
Duan, Z., Bian, C., Zhang, Y., & Yang, S. (2026) · IEEE/ACM International Conference on Automated Software Engineering (ASE) · doi:10.1145/3832783.3834442
From Vibe to Spec: An Empirical Study to Demystify Specifications in Code Generation
He, R., Lu, H., Ma, L., Ye, K., Wu, Q., Liu, S., Bu, L., & Li, X. (2026) · IEEE/ACM International Conference on Automated Software Engineering (ASE) · doi:10.1145/3832783.3837515 · Cited by 1
Liguori, P., Benedictis, A. D., Prisco, G., & Cotroneo, D. (2026) · Journal of Systems Architecture · doi:10.1016/j.sysarc.2026.104049
Understanding Robustness of Model Editing in Code LLMs
Chhetri, V., Fereidouni, M., Siddique, A. B., & Farooq, U. (2025) · arXiv · doi:10.48550/arxiv.2511.03182
“However, CLMEEval relies on existing datasets such as CoNaLa (released in 2018) [46] and CodeSearchNet (released in 2019) [22], making it susceptible to pretraining data leakage and limiting control over what models have previously seen.”
Yu, T., Zhang, R., Yang, K., Yasunaga, M., Wang, D., Li, Z., Ma, J., Li, I., Yao, Q., Roman, S., et al. (2018) · arXiv · doi:10.48550/arxiv.1809.08887 · Cited by 193
“, 2018), and CoNaLa (Yin et al., 2018).”
Background
Metadata
- Authors
- Yin, P., Deng, B., Chen, E., Vasilescu, B., & Neubig, G.
- Affiliations
- Carnegie Mellon University (US)
- Venue
- Proceedings of the 15th International Conference on Mining Software Repositories
- Publisher
- ACM
- Published
- 2018-05-28
- Pages
- 476-486
- OpenAlex
- W2964315653
- Semantic Scholar
- 1a53e7446274016f737236bdd48e3ff05d966384
- Cited by
- 218
- References
- 51
- Citations by year
- 2026: 17 · 2025: 20 · 2024: 32 · 2023: 33 · 2022: 28 · 2021: 35 · 2020: 37 · 2019: 14 · 2018: 2
- FWCI
- 17.27
- Type
- conference paper
- Language
- en
- Open access
- green
- arxiv.org
- Locations
- International Conference on Mining Software Repositories (MSR) (publishedVersion)
- arXiv (Cornell University) (submittedVersion, other-oa)
- arXiv (Cornell University)
- Topics
- Physical Sciences › Computer Science › Information Systems › Software Engineering Research
- Physical Sciences › Computer Science › Artificial Intelligence › Natural Language Processing Techniques
- Physical Sciences › Computer Science › Computer Science Applications › Teaching and Learning Programming
- Keywords
- Stack Overflow, code mining, code search, code summarization, program synthesis, stochastic modeling, handcrafted features, cross-lingual generalization, programming languages
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.