SLaDe: A Portable Small Language Model Decompiler for Optimized Assembly

要約

逆コンパイルはよく研究されており、高品質のツールが多数利用可能です。
これらは、セキュリティ タスクやレガシー コードの移植に頻繁に使用されます。
ただし、これらは定期的に読みにくいプログラムを生成し、新しいプログラミング言語と ISA をサポートするには多大なエンジニアリング作業が必要になります。
最近のニューラル アプローチへの関心により、可読コードを生成するポータブル ツールが開発されています。
しかし、これまでのところ、そのような技術は通常、最適化を行わない合成プログラムに限定されており、その移植性を評価したモデルはありません。
さらに、生成されたコードは読みやすくなる可能性がありますが、通常は正しくありません。
この論文では、実世界のコード上でトレーニングされたシーケンスツーシーケンス変換器に基づく小規模言語モデル逆コンパイラーである SLaDe について説明します。
私たちは新しいトークナイザーを開発し、ドロップアウトなしのトレーニングを利用して高品質のコードを生成します。
私たちは型推論を利用して、標準的な分析アプローチや最近のニューラル アプローチよりも読みやすく正確なプログラムを生成します。
標準的なアプローチとは異なり、SLaDe はアウトオブコンテキスト型を推論でき、ニューラル アプローチとは異なり、正しいコードを生成します。
AnghaBench の 4,000 以上の関数について、2 つの ISA および 2 つの最適化レベルで SLaDe を評価します。
SLaDe は、最先端の業界向けの強力な逆コンパイラーである Ghidra よりも最大 6 倍、大規模言語モデル ChatGPT よりも最大 4 倍の精度があり、両方よりもはるかに読みやすいコードを生成します。

要約(オリジナル)

Decompilation is a well-studied area with numerous high-quality tools available. These are frequently used for security tasks and to port legacy code. However, they regularly generate difficult-to-read programs and require a large amount of engineering effort to support new programming languages and ISAs. Recent interest in neural approaches has produced portable tools that generate readable code. However, to-date such techniques are usually restricted to synthetic programs without optimization, and no models have evaluated their portability. Furthermore, while the code generated may be more readable, it is usually incorrect. This paper presents SLaDe, a Small Language model Decompiler based on a sequence-to-sequence transformer trained over real-world code. We develop a novel tokenizer and exploit no-dropout training to produce high-quality code. We utilize type-inference to generate programs that are more readable and accurate than standard analytic and recent neural approaches. Unlike standard approaches, SLaDe can infer out-of-context types and unlike neural approaches, it generates correct code. We evaluate SLaDe on over 4,000 functions from AnghaBench on two ISAs and at two optimizations levels. SLaDe is up to 6 times more accurate than Ghidra, a state-of-the-art, industrial-strength decompiler and up to 4 times more accurate than the large language model ChatGPT and generates significantly more readable code than both.

arxiv情報

著者 Jordi Armengol-Estapé,Jackson Woodruff,Chris Cummins,Michael F. P. O’Boyle
発行日 2024-01-10 17:12:19+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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