AI

LSem2Vec: A Simple yet Effective Two-Stage Approach for Source Code Embedding

Researchers propose a new method called LSem2Vec for embedding source code into numerical vectors. This approach combines large language models with sentence embedding models to extract the semantics of source code and generate representation vectors. The method eliminates the need for task-specific training or fine-tuning, making it more efficient than existing methods. Experiments across three datasets show that LSem2Vec outperforms five state-of-the-art unsupervised method
Researchers propose a new method called LSem2Vec for embedding source code into numerical vectors. This approach combines large language models with sentence embedding models to extract the semantics of source code and generate representation vectors. The method eliminates the need for task-specific training or fine-tuning, making it more efficient than existing methods. Experiments across three datasets show that LSem2Vec outperforms five state-of-the-art unsupervised methods. --- Why it matters: This matters to software engineers because LSem2Vec provides a simple and effective way to embed source code, which is crucial for tasks like clone detection and clustering. Its efficiency and robustness can improve the accuracy of these tasks and reduce the computational resources required. Source: https://arxiv.org/abs/2409.14644

This article was originally published at: https://arxiv.org/abs/2409.14644