English

Neuro-symbolic Zero-Shot Code Cloning with Cross-Language Intermediate Representation

Artificial Intelligence 2023-04-27 v1 Software Engineering

Abstract

In this paper, we define a neuro-symbolic approach to address the task of finding semantically similar clones for the codes of the legacy programming language COBOL, without training data. We define a meta-model that is instantiated to have an Intermediate Representation (IR) in the form of Abstract Syntax Trees (ASTs) common across codes in C and COBOL. We linearize the IRs using Structure Based Traversal (SBT) to create sequential inputs. We further fine-tune UnixCoder, the best-performing model for zero-shot cross-programming language code search, for the Code Cloning task with the SBT IRs of C code-pairs, available in the CodeNet dataset. This allows us to learn latent representations for the IRs of the C codes, which are transferable to the IRs of the COBOL codes. With this fine-tuned UnixCoder, we get a performance improvement of 12.85 MAP@2 over the pre-trained UniXCoder model, in a zero-shot setting, on the COBOL test split synthesized from the CodeNet dataset. This demonstrates the efficacy of our meta-model based approach to facilitate cross-programming language transfer.

Keywords

Cite

@article{arxiv.2304.13350,
  title  = {Neuro-symbolic Zero-Shot Code Cloning with Cross-Language Intermediate Representation},
  author = {Krishnam Hasija and Shrishti Pradhan and Manasi Patwardhan and Raveendra Kumar Medicherla and Lovekesh Vig and Ravindra Naik},
  journal= {arXiv preprint arXiv:2304.13350},
  year   = {2023}
}

Comments

10 pages, 4 tables, 2 figures

R2 v1 2026-06-28T10:18:11.487Z