SASU: Structure-Anchored Semantic Unification for Code Search

Qian Zhang, Hao Li, Hao Jiang


Abstract
Code search aims to retrieve code snippets according to natural-language intent. Despite the progress of pretrained code models, there remains a gap between natural language and programming language: descriptions are usually sequential and lexical, while code is governed by syntax, data dependencies, and execution logic. Existing retrieval models often rely on token-level matching or use structure as auxiliary information, which limits their ability to capture executable behavior under lexical variation or incomplete code evidence. In this paper, we propose SASU, a structure-anchored semantic unification framework for code search. SASU extracts a normalized multi-relational graph for each function and composes syntax, data-flow, control-flow, call, return, and exception relations into a unified structural view. The structural representation is then used to guide node-level lexical evidence selection before code and text are aligned in the same retrieval space. Experiments on CodeSearchNet show that SASU achieves 0.835 MRR for code-to-text retrieval and 0.840 MRR for text-to-code retrieval across Python, Java, and JavaScript. Under 40–60% node deletion, SASU retains 86.6% of its full-graph MRR, indicating that structure provides useful retrieval signals beyond lexical pretraining.
Anthology ID:
2026.findings-aacl.187
Volume:
Findings of the Association for Computational Linguistics: IJCNLP-AACL 2026
Month:
November
Year:
2026
Address:
Hengqin, China
Editors:
Yue Zhang, Ruifeng Xu, Ayu Purwarianti, Tong Rong, Jun Suzuki
Venue:
Findings
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
3724–3735
Language:
URL:
https://aclanthology.org/2026.findings-aacl.187/
DOI:
Bibkey:
Cite (ACL):
Qian Zhang, Hao Li, and Hao Jiang. 2026. SASU: Structure-Anchored Semantic Unification for Code Search. In Findings of the Association for Computational Linguistics: IJCNLP-AACL 2026, pages 3724–3735, Hengqin, China. Association for Computational Linguistics.
Cite (Informal):
SASU: Structure-Anchored Semantic Unification for Code Search (Zhang et al., Findings 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.findings-aacl.187.pdf