LoRACode: LoRA Adapters for Code Embeddings

要約

セマンティックコード検索には、コード埋め込みが不可欠です。
ただし、現在のアプローチは、コードに固有の正確な構文およびコンテキストニュアンスをキャプチャするのに苦労しています。
CodebertやUnixCoderなどのオープンソースモデルは、スケーラビリティと効率の制限を示しますが、高性能の独自のシステムはかなりの計算コストを課します。
コード検索用のタスク固有のアダプターを構築するために、低ランク適応(LORA)に基づいたパラメーター効率の高い微調整方法を導入します。
私たちのアプローチは、トレーニング可能なパラメーターの数を基本モデルの2%未満に減らし、広範なコードコーパス(2つのH100 GPUで25分で200万サンプル)で迅速に微調整できるようにします。
実験では、Code2Code検索の平均相互ランク(MRR)が最大9.1%増加し、複数のプログラミング言語にわたってText2Code検索タスクで最大86.69%増加します。
タスクごとのおよび言語ごとの適応の区別は、構文的および言語的バリエーションのコード検索の感度を探るのに役立ちます。
この分野で研究を促進するために、コードと事前に訓練されたモデルを公開しています。

要約(オリジナル)

Code embeddings are essential for semantic code search; however, current approaches often struggle to capture the precise syntactic and contextual nuances inherent in code. Open-source models such as CodeBERT and UniXcoder exhibit limitations in scalability and efficiency, while high-performing proprietary systems impose substantial computational costs. We introduce a parameter-efficient fine-tuning method based on Low-Rank Adaptation (LoRA) to construct task-specific adapters for code retrieval. Our approach reduces the number of trainable parameters to less than two percent of the base model, enabling rapid fine-tuning on extensive code corpora (2 million samples in 25 minutes on two H100 GPUs). Experiments demonstrate an increase of up to 9.1% in Mean Reciprocal Rank (MRR) for Code2Code search, and up to 86.69% for Text2Code search tasks across multiple programming languages. Distinction in task-wise and language-wise adaptation helps explore the sensitivity of code retrieval for syntactical and linguistic variations. To foster research in this area, we make our code and pre-trained models publicly available.

arxiv情報

著者 Saumya Chaturvedi,Aman Chadha,Laurent Bindschaedler
発行日 2025-06-02 12:19:34+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.IR, cs.LG, cs.SE パーマリンク