LoRACode: LoRA Adapters for Code Embeddings
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.
67ce6db07110b8bedb3344a7
Saumya Chaturvedi
admin_assigned
2025-03-10T10:23:01.422Z
6432b9a62bfb2b0ec756b374
/avatars/5db525f2cd40fd077e751b250bbb30a5.svg
Saumya Chaturvedi
user
shollercoaster
67ce6db07110b8bedb3344a8
Aman Chadha
claimed_verified
2025-03-10T08:00:45.150Z
63a4754927f1f64ed7238dac
https://cdn-avatars.huggingface.co/v1/production/uploads/63a4754927f1f64ed7238dac/aH-eJF-31g4vof9jv2gmI.jpeg
Aman Chadha
user
amanchadha
67ce6db07110b8bedb3344a9
Laurent Bindschaedler
admin_assigned
2025-03-10T10:23:07.597Z
6783105a17f0d939ebcdd86c
https://cdn-avatars.huggingface.co/v1/production/uploads/no-auth/UKBXp_AGPVQjH9e_C-C5c.png
Laurent Bindschaedler
user
bindsch
LoRACode: LoRA Adapters for Code Embeddings
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.
A parameter-efficient fine-tuning method using Low-Rank Adaptation improves code retrieval performance in semantic code search across multiple languages.
code embeddings semantic code search CodeBERT UniXcoder Low-Rank Adaptation parameter-efficient fine-tuning task-specific adapters code retrieval Mean Reciprocal Rank Code2Code search Text2Code search