Enhancing Tree-Based Language Model via Function Dependencies for Code Search

Recent advancements in pre-trained programming language models have significantly enhanced code search tasks. However, many models struggle to fully leverage the syntactic and structural information in source code, especially when parsing syntax trees and understanding function-level semantics. In this paper, we present CodeBERT-TD,a novel multi-modal code search model that combines documentation, code, syntax trees, and function dependency information for improved retrieval performance. Our approach employs a tree-based attention mechanism and hybrid masking strategy to capture hierarchical relationships within the code. By flattening syntax trees through a node-wrapped traversal and using tree-structured attention masks, we improve the model's focus on syntactic dependencies. Additionally, incorporating function dependency relationships enhances performance on downstream tasks. To tackle sequence length limitations from multiple modalities, we utilize rotary positional encoding to boost extrapolation capabilities. These components come together to create a cooperative design, with extensive evaluations demonstrating that our model significantly enhances code search performance, laying a solid foundation for future advancements in code representation learning.

Authors

Institutions

Publication Details

Published
2025-05-05
DOI
https://doi.org/10.1109/cscwd64889.2025.11033488
Primary Topic
Natural Language Processing Techniques
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Enhancing Tree-Based Language Model via Function Dependencies for Code Search

Huiying Li, Chen You-kang
Natural Language Processing Techniques
article

Enhancing Tree-Based Language Model via Function Dependencies for Code Search

Huiying Li, Chen You-kang
article en

Abstract

Recent advancements in pre-trained programming language models have significantly enhanced code search tasks. However, many models struggle to fully leverage the syntactic and structural information in source code, especially when parsing syntax trees and understanding function-level semantics. In this paper, we present CodeBERT-TD,a novel multi-modal code search model that combines documentation, code, syntax trees, and function dependency information for improved retrieval performance. Our approach employs a tree-based attention mechanism and hybrid masking strategy to capture hierarchical relationships within the code. By flattening syntax trees through a node-wrapped traversal and using tree-structured attention masks, we improve the model's focus on syntactic dependencies. Additionally, incorporating function dependency relationships enhances performance on downstream tasks. To tackle sequence length limitations from multiple modalities, we utilize rotary positional encoding to boost extrapolation capabilities. These components come together to create a cooperative design, with extensive evaluations demonstrating that our model significantly enhances code search performance, laying a solid foundation for future advancements in code representation learning.

Southeast University (CN)
Openalex Percentile: Top 93%
Natural Language Processing Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.