用动态分析生成代码复杂度嵌入,提升编程竞赛代码分类效果
Complexity-based code embeddings
- 通过动态分析代码在不同输入下的行为,生成复杂度嵌入
- 基于r-Complexity的嵌入使XGBoost在11类多标签数据上平均F1达0.78
- 适合代码理解、自动评测与算法特征提取研究者参考
本文提出一种通用方法,将各类算法的源代码转换为数值嵌入,通过动态分析程序在不同输入下的行为,并针对分析指标定制多种通用复杂度函数。所生成的代码嵌入基于r-Complexity。利用这些嵌入,我们实现了XGBoost算法,在由Codeforces平台真实编程竞赛代码片段构建的11类多标签数据集上,取得了平均F1分数为0.78的性能。
原文摘要 · Abstract (English)
This paper presents a generic method for transforming the source code of various algorithms to numerical embeddings, by dynamically analysing the behaviour of computer programs against different inputs and by tailoring multiple generic complexity functions for the analysed metrics. The used algorithms embeddings are based on r-Complexity . Using the proposed code embeddings, we present an implementation of the XGBoost algorithm that achieves an average F1-score on a multi-label dataset with 11 classes, built using real-world code snippets submitted for programming competitions on the Codeforces platform.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。