Skip to main content
QUICK REVIEW

[Paper Review] Predicting Tags For Programming Tasks by Combining Textual And Source Code Data

Artyom Lobanov, Egor Bogomolov|arXiv (Cornell University)|Jan 11, 2023
Software Engineering ResearchComputer Science3 citations
TL;DR

This paper proposes a hybrid deep learning approach that combines BERT for natural language processing of problem statements and a Gated Graph Neural Network with attention for source code analysis to predict multi-label tags in competitive programming problems. By ensembling both models, the method achieves a 0.175 improvement in PR-AUC over existing state-of-the-art models, demonstrating that combining textual and code-based signals significantly enhances tag prediction performance.

ABSTRACT

Competitive programming remains a very popular activity that combines both software engineering and education. In order to prepare and to practice, contestants use extensive archives of problems from past contents available on various competitive programming platforms. One way to make this process more effective is to provide an automatic tag system for the tasks. Prior works do that by either using the tasks' problem statements or the code of their solutions. In this study, we investigate which information source is more valuable for tag prediction. To answer that question, we compare existing approaches of both types on the same dataset and with the same set of tags. Then, we propose a novel approach, which is an ensemble of the Gated Graph Neural Network model for analyzing solutions and the Bidirectional Encoder Representations from Transformers model for processing statements. Our experiments show that our approach outperforms previously proposed models by 0.175 of the PR-AUC metric.

Motivation & Objective

  • To address the challenge of inconsistent and time-consuming manual tagging of competitive programming problems.
  • To investigate whether textual problem statements or source code solutions are more informative for tag prediction.
  • To develop a unified, robust model that leverages both textual and code-based features for improved multi-label tag prediction.
  • To provide a reproducible benchmark by implementing and evaluating 13 existing tag prediction approaches on the same dataset.
  • To release a trained model and codebase to support future research and practical applications in automated problem tagging.

Proposed method

  • Fine-tune a pre-trained BERT model to encode problem statements into contextual embeddings for tag prediction.
  • Train a Gated Graph Neural Network with attention to extract semantic representations from abstract syntax trees of submitted solutions.
  • Combine predictions from the BERT and GNN models via an ensemble averaging strategy to improve robustness and coverage.
  • Use multi-label classification with sigmoid activation and binary cross-entropy loss to predict multiple tags per problem.
  • Evaluate model performance using PR-AUC, F1, precision, and recall on a large-scale dataset from Codeforces.
  • Reproduce and evaluate 13 existing tag prediction models from five prior works using identical data and evaluation protocols for fair comparison.

Experimental results

Research questions

  • RQ1Which data source—problem statements or source code—provides more reliable signals for predicting competitive programming tags?
  • RQ2Can combining textual and code-based representations lead to better tag prediction than using either modality alone?
  • RQ3How do existing tag prediction models compare in performance when evaluated under identical conditions?
  • RQ4To what extent does an ensemble of text and code models improve multi-label tag prediction over state-of-the-art baselines?
  • RQ5Can the proposed model detect inconsistencies or errors in existing manual tag assignments?

Key findings

  • The proposed ensemble model achieves a PR-AUC of 0.542, outperforming the best existing model by 0.175 points.
  • The BERT-based model alone achieved a PR-AUC of 0.273, demonstrating strong performance on problem statement analysis.
  • The Gated GNN model for code analysis achieved a PR-AUC of 0.377, showing that source code contains valuable signals for tag prediction.
  • Text-based models were more effective for topic-related tags (e.g., 'graphs', 'strings'), while code-based models excelled at predicting algorithmic approach tags (e.g., 'dynamic programming', 'binary search').
  • The ensemble model improved PR-AUC by 0.264 over the best text-only model and by 0.175 over the best code-only model.
  • The study confirms that combining both modalities leads to more robust and accurate predictions than using either source in isolation.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.