Question Selection for Multimodal Code Search Synthesis Using Probabilistic Version Spaces
Searching the occurrences of specific code patterns (code search) is a common task in software engineering, and programming by example (PBE) techniques have been applied to ease customizing code patterns. However, previous PBE tools only synthesize programs meeting the input-output examples, which may not always align with the user intent. To bridge this gap, this paper proposes <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">Excalibur</small>, a multi-modal (example and natural language description) and interactive synthesizer for code search. <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">Excalibur</small> ensures that the generated programs are correct for the provided examples (soundness) and include the user-intended program (bounded completeness). Furthermore, <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">Excalibur</small> helps the user identify the user-intended program through question-answer interaction. To minimize the required interaction efforts, question selection is crucial. To improve question selection for code search, we propose probabilistic version spaces (ProbVS), in which the user-intended program’s probability is high and others are low. ProbVS combines traditional version spaces for compactly representing extensive programs and large language models (on the user-provided natural language description) for adjusting programs’ probabilities to align with users’ intents. Extensive experiments on a benchmark of 44 tasks demonstrated the effectiveness of <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">Excalibur</small> and ProbVS and demystified how ProbVS affects probability distributions and how the configurable parameters affect ProbVS.
Authors
- Shing-Chi Cheung (ORCID: https://orcid.org/0000-0002-3508-7172)
- Jiarong Wu (ORCID: https://orcid.org/0000-0001-6126-303X)
- Chang Xu (ORCID: https://orcid.org/0000-0002-6299-4704)
- Lili Wei (ORCID: https://orcid.org/0000-0002-2428-4111)
- Congying Xu (ORCID: https://orcid.org/0009-0000-2887-1690)
- Yanyan Jiang (ORCID: https://orcid.org/0000-0001-7651-9560)
Institutions
- Hong Kong University of Science and Technology (HK)
- McGill University (CA)
- Nanjing University (CN)
Publication Details
- Journal
- IEEE Transactions on Software Engineering
- Published
- 2025-04-29
- DOI
- https://doi.org/10.1109/tse.2025.3565387
- Citations
- 1
- Primary Topic
- Natural Language Processing Techniques
- Type
- article
- Field-Weighted Citation Impact
- 2.48