要約
【タイトル】- BERTとQuery-Aware LSHを用いた非公式ドキュメントのコード例推薦の改善:比較研究
【要約】
– 開発者は、オープンソースプロジェクトや非公式ドキュメントを利用して、インターネットで関連するコード例を探すことが多く、これを支援するために、過去に何度もコード例推奨の研究が行われてきた。
– コード例推奨の研究に焦点を当て、Javaプログラミング言語のための最高のコード例を収集し、推奨することで、推奨されるコード例の品質を向上させた。
– BERTを使用して、テキストデータから意味情報を抽出できるLLMを使用して、コード例を数値ベクトルに変換した。
– その後、LSHを適用して近似最近傍探索(ANN)を識別しました。これには、ランダム超平面ベースのLSHとクエリ意識LSHの2つのバリアントを実装しました。
– 研究には、HitRate、平均相互ランク(MRR)、平均実行時間、および関連性の4つのパラメータを使用した2つのアルゴリズムの比較を含めました。
– 分析の結果、Query-Aware(QA)アプローチがHitRateでランダム超平面ベース(RH)アプローチを上回り、QAアプローチは、RHアプローチに比べてクエリペアのHitRateを20%から35%向上させました。 QAアプローチを使用してハッシュテーブルを作成し、データサンプルをバケットに割り当てることは、RHアプローチよりも少なくとも4倍高速です。 QAアプローチによってコード例がミリ秒単位で返されるのに対し、RHアプローチはコード例の推奨に数秒かかります。
要約(オリジナル)
The study of code example recommendation has been conducted extensively in the past and recently in order to assist developers in their software development tasks. This is because developers often spend significant time searching for relevant code examples on the internet, utilizing open-source projects and informal documentation. For finding useful code examples, informal documentation, such as Stack Overflow discussions and forums, can be invaluable. We have focused our research on Stack Overflow, which is a popular resource for discussing different topics among software developers. For increasing the quality of the recommended code examples, we have collected and recommended the best code examples in the Java programming language. We have utilized BERT in our approach, which is a Large Language Model (LLM) for text representation that can effectively extract semantic information from textual data. Our first step involved using BERT to convert code examples into numerical vectors. Subsequently, we applied LSH to identify Approximate Nearest Neighbors (ANN). Our research involved the implementation of two variants of this approach, namely the Random Hyperplane-based LSH and the Query-Aware LSH. Our study compared two algorithms using four parameters: HitRate, Mean Reciprocal Rank (MRR), Average Execution Time, and Relevance. The results of our analysis revealed that the Query- Aware (QA) approach outperformed the Random Hyperplane-based (RH) approach in terms of HitRate. Specifically, the QA approach achieved a HitRate improvement of 20% to 35% for query pairs compared to the RH approach. Creating hashing tables and assigning data samples to buckets using the QA approach is at least four times faster than the RH approach. The QA approach returns code examples within milliseconds, while it takes several seconds (sec) for the RH approach to recommend code examples.
arxiv情報
| 著者 | Sajjad Rahmani,AmirHossein Naghshzan,Latifa Guerrouj |
| 発行日 | 2023-05-04 17:43:19+00:00 |
| arxivサイト | arxiv_id(pdf) |
提供元, 利用サービス
arxiv.jp, OpenAI