EMNLP 2022main2 citations
Towards Compositional Generalization in Code Search
Hojae Han, Seung-won Hwang, Shuai Lu, Nan Duan, Seungtaek Choi
Abstract
We study compositional generalization, which aims to generalize on unseen combinations of seen structural elements, for code search. Unlike existing approaches of partially pursuing this goal, we study how to extract structural elements, which we name a template that directly targets compositional generalization. Thus we propose CTBERT, or Code Template BERT, representing codes using automatically extracted templates as building blocks. We empirically validate CTBERT on two public code search benchmarks, AdvTest and CSN. Further, we show that templates are complementary to data flow graphs in GraphCodeBERT, by enhancing structural context around variables.
BibTeX
@inproceedings{han-etal-2022-towards,
title = "Towards Compositional Generalization in Code Search",
author = "Han, Hojae and
Hwang, Seung-won and
Lu, Shuai and
Duan, Nan and
Choi, Seungtaek",
editor = "Goldberg, Yoav and
Kozareva, Zornitsa and
Zhang, Yue",
booktitle = "Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing",
month = dec,
year = "2022",
address = "Abu Dhabi, United Arab Emirates",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2022.emnlp-main.737/",
doi = "10.18653/v1/2022.emnlp-main.737",
pages = "10743--10750"
}