COMEX: A Tool for Generating Customized Source Code Representations

要約

ソース コードの効果的な表現を学習することは、Machine Learning for Software Engineering (ML4SE) システムにとって非常に重要です。
自然言語処理からインスピレーションを得た Codex や CodeGen などの大規模言語モデル (LLM) は、コードを一般的なテキストのシーケンスとして扱い、膨大なコード データのコーパスでトレーニングされ、いくつかのソフトウェア エンジニアリング (SE) タスクで最先端のパフォーマンスを実現します。
ただし、有効なソース コードは、自然言語とは異なり、プログラミング言語の基礎となる文法によって管理される厳密な構造とパターンに従います。
現在の LLM は、コードを一連のトークンのように扱い、制御フロー グラフ (CFG) やデータ フロー グラフ (
残念なことに、あらゆるプログラミング言語のコードビューを生成して統合するプロセスは面倒で時間がかかります。
この障壁を克服するために、私たちはツール COMEX を提案します。これは、研究者や開発者がさまざまな SE タスクの機械学習 (ML) モデルで使用できる複数のコードビューを作成して組み合わせることができるフレームワークです。
このツールの顕著な機能は次のとおりです: (i) ソース コード (コンパイル可能である必要はない) で直接動作します、(ii) 現在 Java と C# をサポートしています、(iii) メソッド レベルのスニペットとプログラム レベルの両方を分析できます。
(iv) 40 を超える言語をサポートする広く使用されているインクリメンタル パーサーであるツリー シッターに基づいて構築されているため、他の言語にも簡単に拡張できます。
この使いやすいコードビュー生成およびカスタマイズ ツールが、ソース コード表現の学習方法と ML4SE の研究に弾みを与えると信じています。
ツール: https://pypi.org/project/comex – GitHub: https://github.com/IBM/tree-sitter-codeviews – デモ: https://youtu.be/GER6U87FVbU

要約(オリジナル)

Learning effective representations of source code is critical for any Machine Learning for Software Engineering (ML4SE) system. Inspired by natural language processing, large language models (LLMs) like Codex and CodeGen treat code as generic sequences of text and are trained on huge corpora of code data, achieving state of the art performance on several software engineering (SE) tasks. However, valid source code, unlike natural language, follows a strict structure and pattern governed by the underlying grammar of the programming language. Current LLMs do not exploit this property of the source code as they treat code like a sequence of tokens and overlook key structural and semantic properties of code that can be extracted from code-views like the Control Flow Graph (CFG), Data Flow Graph (DFG), Abstract Syntax Tree (AST), etc. Unfortunately, the process of generating and integrating code-views for every programming language is cumbersome and time consuming. To overcome this barrier, we propose our tool COMEX – a framework that allows researchers and developers to create and combine multiple code-views which can be used by machine learning (ML) models for various SE tasks. Some salient features of our tool are: (i) it works directly on source code (which need not be compilable), (ii) it currently supports Java and C#, (iii) it can analyze both method-level snippets and program-level snippets by using both intra-procedural and inter-procedural analysis, and (iv) it is easily extendable to other languages as it is built on tree-sitter – a widely used incremental parser that supports over 40 languages. We believe this easy-to-use code-view generation and customization tool will give impetus to research in source code representation learning methods and ML4SE. Tool: https://pypi.org/project/comex – GitHub: https://github.com/IBM/tree-sitter-codeviews – Demo: https://youtu.be/GER6U87FVbU

arxiv情報

著者 Debeshee Das,Noble Saji Mathews,Alex Mathai,Srikanth Tamilselvam,Kranthi Sedamaki,Sridhar Chimalakonda,Atul Kumar
発行日 2023-07-10 16:46:34+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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