論文の概要: Split, Encode and Aggregate for Long Code Search
- arxiv url: http://arxiv.org/abs/2208.11271v2
- Date: Sat, 12 Aug 2023 07:04:59 GMT
- ステータス: 処理完了
- システム内更新日: 2023-10-24 15:06:03.387109
- Title: Split, Encode and Aggregate for Long Code Search
- Title(参考訳): 長いコード検索のための分割、エンコード、集約
- Authors: Fan Hu, Yanlin Wang, Lun Du, Hongyu Zhang, Shi Han, Dongmei Zhang,
Xirong Li
- Abstract要約: 提案するSEA (Split, Encode and Aggregate for Long Code Search) は,長いコードをコードブロックに分割し,それらのブロックを埋め込みにエンコードし,それらを集約して包括的なロングコード表現を得る。
SEAでは、Transformerベースの事前トレーニングモデルを直接使用して、内部構造や再トレーニングを変更することなく、長いコードをモデル化することができます。
- 参考スコア(独自算出の注目度): 70.38415400383693
- License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/
- Abstract: Code search with natural language plays a crucial role in reusing existing
code snippets and accelerating software development. Thanks to the
Transformer-based pretraining models, the performance of code search has been
improved significantly compared to traditional information retrieval (IR) based
models. However, due to the quadratic complexity of multi-head self-attention,
there is a limit on the input token length. For efficient training on standard
GPUs like V100, existing pretrained code models, including GraphCodeBERT,
CodeBERT, RoBERTa (code), take the first 256 tokens by default, which makes
them unable to represent the complete information of long code that is greater
than 256 tokens. Unlike long text paragraph that can be regarded as a whole
with complete semantics, the semantics of long code is discontinuous as a piece
of long code may contain different code modules. Therefore, it is unreasonable
to directly apply the long text processing methods to long code. To tackle the
long code problem, we propose SEA (Split, Encode and Aggregate for Long Code
Search), which splits long code into code blocks, encodes these blocks into
embeddings, and aggregates them to obtain a comprehensive long code
representation. With SEA, we could directly use Transformer-based pretraining
models to model long code without changing their internal structure and
repretraining. Leveraging abstract syntax tree (AST) based splitting and
attention-based aggregation methods, SEA achieves significant improvements in
long code search performance. We also compare SEA with two sparse Trasnformer
methods. With GraphCodeBERT as the encoder, SEA achieves an overall mean
reciprocal ranking score of 0.785, which is 10.1% higher than GraphCodeBERT on
the CodeSearchNet benchmark.
- Abstract(参考訳): 自然言語によるコード検索は、既存のコードスニペットの再利用とソフトウェア開発の加速において重要な役割を果たす。
Transformerベースの事前学習モデルにより、従来の情報検索(IR)モデルと比較してコード検索の性能が大幅に向上した。
しかしながら、多頭自己アテンションの二次的複雑性のため、入力トークンの長さには制限がある。
V100のような標準GPUの効率的なトレーニングのために、GraphCodeBERT、CodeBERT、RoBERTa(コード)を含む既存の事前訓練されたコードモデルは、デフォルトで256トークンを取得できるため、256トークンを超える長いコードの完全な情報を表現できない。
完全な意味論で全体と見なせるロングテキストの段落とは異なり、ロングコードのセマンティクスは不連続であり、ロングコードの一部には異なるコードモジュールが含まれる可能性がある。
したがって、長いテキスト処理メソッドを長いコードに直接適用するのは理不尽である。
長いコード問題に対処するために、長いコードをコードブロックに分割し、これらのブロックを埋め込みにエンコードし、それらを集約して包括的な長いコード表現を得るSEA(Split, Encode and Aggregate for Long Code Search)を提案する。
SEAでは、Transformerベースの事前トレーニングモデルを直接使用して、内部構造や再トレーニングを変更することなく、長いコードをモデル化することができます。
抽象構文木(AST)に基づく分割と注意に基づく集約手法を利用して、SEAは長いコード検索性能を大幅に改善する。
seaを2つのsparse trasnformerメソッドと比較した。
エンコーダとしてGraphCodeBERTを使用すると、SEAはコードSearchNetベンチマークでGraphCodeBERTよりも10.1%高い0.785という総合的な平均逆ランキングスコアを達成する。
関連論文リスト
- SparseCoder: Identifier-Aware Sparse Transformer for File-Level Code
Summarization [51.67317895094664]
本稿では,大規模なソースコードプロジェクトの理解と維持を支援するファイルレベルのコード要約について検討する。
長いコードシーケンスを効果的に処理するための識別子対応スパース変換器であるSparseCoderを提案する。
論文 参考訳(メタデータ) (2024-01-26T09:23:27Z) - LongCoder: A Long-Range Pre-trained Language Model for Code Completion [56.813974784131624]
LongCoderは自己アテンションにスライディングウィンドウ機構を採用し、グローバルアクセス可能なトークンを2種類導入している。
ブリッジトークンは入力シーケンス全体を通して挿入され、ローカル情報を集約し、グローバルな相互作用を促進する。
メモリトークンは、後で呼び出され、記憶する必要がある重要なステートメントをハイライトするために含まれます。
論文 参考訳(メタデータ) (2023-06-26T17:59:24Z) - Enhancing Semantic Code Search with Multimodal Contrastive Learning and
Soft Data Augmentation [50.14232079160476]
コード検索のためのマルチモーダルコントラスト学習とソフトデータ拡張を用いた新しい手法を提案する。
我々は,6つのプログラミング言語を用いた大規模データセットにおけるアプローチの有効性を評価するために,広範囲な実験を行った。
論文 参考訳(メタデータ) (2022-04-07T08:49:27Z) - Learning Deep Semantic Model for Code Search using CodeSearchNet Corpus [17.6095840480926]
マルチモーダル・ソースのユーティリティを利用する新しいディープ・セマンティック・モデルを提案する。
提案したモデルを適用して,意味的コード検索に関するCodeSearchNetの課題に対処する。
我々のモデルはCodeSearchNetコーパスでトレーニングされ、ホールドアウトデータに基づいて評価され、最終モデルは0.384 NDCGに達し、このベンチマークで優勝した。
論文 参考訳(メタデータ) (2022-01-27T04:15:59Z) - CodeRetriever: Unimodal and Bimodal Contrastive Learning [128.06072658302165]
関数レベルのコードセマンティック表現を訓練するために,一様および二様のコントラスト学習を組み合わせたCodeRetrieverモデルを提案する。
ノンモーダルなコントラスト学習のために、文書と関数名に基づいてポジティブなコードペアを構築するためのセマンティックガイド付き手法を設計する。
バイモーダルなコントラスト学習では、コードのドキュメンテーションとインラインコメントを活用して、テキストコードペアを構築します。
論文 参考訳(メタデータ) (2022-01-26T10:54:30Z) - DeSkew-LSH based Code-to-Code Recommendation Engine [3.7011129410662558]
ソースコード上の機械学習のための新しいコード・ツー・コードレコメンデーションエンジンであるemphSenatusを紹介する。
SenatusのコアとなるemphDe-Skew LSHは、ローカリティに敏感なハッシュアルゴリズムで、高速(サブ線形時間)検索のためにデータをインデックスする。
コード・ツー・コード・レコメンデーションのタスクにおいて、Senatusはパフォーマンスを6.7%向上し、クエリ時間16xはFacebook Aromaよりも高速であることを示す。
論文 参考訳(メタデータ) (2021-11-05T16:56:28Z) - GraphCodeBERT: Pre-training Code Representations with Data Flow [97.00641522327699]
本稿では,コード固有の構造を考慮したプログラミング言語の事前学習モデルであるGraphCodeBERTを提案する。
これは変数間の"where-the-value-comes-from"の関係をエンコードするコードのセマンティックレベルの構造です。
コード検索,クローン検出,コード翻訳,コード改良の4つのタスクにおいて,本モデルを評価する。
論文 参考訳(メタデータ) (2020-09-17T15:25:56Z)
関連論文リストは本サイト内にある論文のタイトル・アブストラクトから自動的に作成しています。
指定された論文の情報です。
本サイトの運営者は本サイト(すべての情報・翻訳含む)の品質を保証せず、本サイト(すべての情報・翻訳含む)を使用して発生したあらゆる結果について一切の責任を負いません。