Code Search Debiasing:Improve Search Results beyond Overall Ranking Performance (2311.14901v2)
Abstract: Code search engine is an essential tool in software development. Many code search methods have sprung up, focusing on the overall ranking performance of code search. In this paper, we study code search from another perspective by analyzing the bias of code search models. Biased code search engines provide poor user experience, even though they show promising overall performance. Due to different development conventions (e.g., prefer long queries or abbreviations), some programmers will find the engine useful, while others may find it hard to get desirable search results. To mitigate biases, we develop a general debiasing framework that employs reranking to calibrate search results. It can be easily plugged into existing engines and handle new code search biases discovered in the future. Experiments show that our framework can effectively reduce biases. Meanwhile, the overall ranking performance of code search gets improved after debiasing.
- Estimating position bias without intrusive interventions. In WSDM, pages 474–482.
- Leveraging usage similarity for effective retrieval of examples in code repositories. In SIGSOFT FSE, pages 157–166.
- Sumon Biswas and Hridesh Rajan. 2021. Fair preprocessing: towards understanding compositional fairness of data transformers in machine learning pipeline. In ESEC/SIGSOFT FSE, pages 981–993.
- Language (technology) is power: A critical survey of "bias" in NLP. In ACL, pages 5454–5476.
- Two studies of opportunistic programming: interleaving web foraging, learning, and writing code. In CHI, pages 1589–1598.
- Leo Breiman. 1996. Bagging predictors. Mach. Learn., 24(2):123–140.
- Optimized pre-processing for discrimination prevention. In NIPS, pages 3992–4001.
- Codebert: A pre-trained model for programming and natural languages. In EMNLP (Findings), pages 1536–1547.
- Yoav Freund and Robert E. Schapire. 1997. A decision-theoretic generalization of on-line learning and an application to boosting. J. Comput. Syst. Sci., 55(1):119–139.
- He is very intelligent, she is very beautiful? on mitigating social biases in language modelling and generation. In ACL/IJCNLP (Findings), pages 4534–4545.
- Luca Di Grazia and Michael Pradel. 2022. Code search: A survey of techniques for finding code. arXiv Preprint. https://arxiv.org/abs/2204.02765.
- Deep code search. In ICSE, pages 933–944.
- Unixcoder: Unified cross-modal pre-training for code representation. In ACL (1), pages 7212–7225.
- Graphcodebert: Pre-training code representations with data flow. In ICLR. https://openreview.net/pdf?id=jLoC4ez43PZ.
- Split, encode and aggregate for long code search. arXiv Preprint. https://arxiv.org/abs/2208.11271.
- Cosqa: 20, 000+ web queries for code search and question answering. In ACL/IJCNLP (1), pages 5690–5700.
- Codesearchnet challenge: Evaluating the state of semantic code search. arXiv Preprint. https://arxiv.org/abs/1909.09436.
- On length divergence bias in textual matching models. In ACL (Findings), pages 4187–4193.
- Multiaccuracy: Black-box post-processing for fairness in classification. In AIES, pages 247–254.
- Learning code-query interaction for enhancing code searches. In ICSME, pages 115–126.
- Mitigating sentiment bias for recommender systems. In SIGIR, pages 31–40.
- Improving code summarization with block-wise abstract syntax tree splitting. In ICPC, pages 184–195.
- Opportunities and challenges in code search tools. ACM Comput. Surv., 54(9):196:1–196:40.
- Refbert: A two-stage pre-trained framework for automatic rename refactoring. In ISSTA, pages 740–752.
- Codexglue: A machine learning benchmark dataset for code understanding and generation. In NeurIPS Datasets and Benchmarks, volume 1.
- Codehow: Effective code search based on API understanding and extended boolean model (E). In ASE, pages 260–270.
- Paul W. McBurney and Collin McMillan. 2016. An empirical study of the textual similarity between source code and source code summaries. Empir. Softw. Eng., 21(1):17–42.
- A survey on bias and fairness in machine learning. ACM Comput. Surv., 54(6):115:1–115:35.
- Kenton Murray and David Chiang. 2018. Correcting length bias in neural machine translation. In WMT, pages 212–223.
- Correcting for selection bias in learning-to-rank systems. In WWW, pages 1863–1873.
- Post-processing for individual fairness. In NeurIPS, pages 25944–25955.
- Mitigating gender bias in natural language processing: Literature review. In ACL (1), pages 1630–1640.
- Multi-modal attention network learning for semantic source code retrieval. In ASE, pages 13–25.
- Improving automatic source code summarization via deep reinforcement learning. In ASE, pages 397–407.
- Yanlin Wang and Hui Li. 2021. Code completion by modeling flattened abstract syntax trees as graphs. In AAAI, pages 14015–14023.
- Neutralizing popularity bias in recommendation models. In SIGIR, pages 2623–2628.
- Ealink: An efficient and accurate pre-trained framework for issue-commit link recovery. arXiv Preprint. https://arxiv.org/abs/2308.10759.
- Zhi-Hua Zhou. 2009. Ensemble learning. In Encyclopedia of Biometrics, pages 270–273.
- Ocor: An overlapping-aware code retriever. In ASE, pages 883–894.
- Sheng Zhang (212 papers)
- Hui Li (1004 papers)
- Yanlin Wang (76 papers)
- Zhao Wei (13 papers)
- Yong Xiu (1 paper)
- Juhong Wang (5 papers)
- Rongong Ji (1 paper)