通过软ZCA白化提升代码嵌入的各向同性,改善语义搜索效果。
Isotropy Matters: Soft-ZCA Whitening of Embeddings for Semantic Code Search
- 采用改进的软ZCA白化方法调控嵌入空间各向同性。
- 在多个代码模型上验证,显著提升语义搜索准确率。
- 适合关注代码检索性能优化的研究者与工程师。
嵌入空间的低各向同性会损害语义推理任务的表现。本研究探究了各向同性对语义代码搜索性能的影响,并探索后处理技术以缓解该问题。我们分析了多种代码语言模型,考察其嵌入空间的各向同性及其对搜索有效性的影响。提出一种改进的软ZCA白化方法,用于控制嵌入的各向同性水平。实验结果表明,软ZCA白化能有效提升预训练代码语言模型的性能,且可与对比学习微调互补。
原文摘要 · Abstract (English)
Low isotropy in an embedding space impairs performance on tasks involving semantic inference. Our study investigates the impact of isotropy on semantic code search performance and explores post-processing techniques to mitigate this issue. We analyze various code language models, examine isotropy in their embedding spaces, and its influence on search effectiveness. We propose a modified ZCA whitening technique to control isotropy levels in embeddings. Our results demonstrate that Soft-ZCA whitening improves the performance of pre-trained code language models and can complement contrastive fine-tuning.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。