Enhancing Differential Testing With LLMs For Testing Deep Learning Libraries

要約

鑑別テストは、代替実装間でテスト結果を比較することにより、テストのOracleの問題を軽減するための有望な戦略を提供します。
ただし、ディープラーニング(DL)ライブラリの既存の微分テスト手法は、特定のAPIの代替実装(カウンターパートと呼ばれる)を見つけるという重要な課題によって制限され、その後多様なテスト入力を生成します。
2つの課題に対処するために、このホワイトペーパーでは、DLMがDLライブラリのLLM強化微分テスト手法であるDllensを紹介します。
最初の課題に対処するために、DLLENSにはLLMベースのカウンターパート合成ワークフローが組み込まれており、特定のDLライブラリAPIの計算のカウンターパートは、別のDLライブラリからのAPIの特定の組成と適応を通じて正常に合成できるという洞察が組み込まれています。
2番目の課題に対処するために、DLLENSには、特定のAPIとその対応物からパスの制約を抽出して、多様なテスト入力生成を導く静的分析手法を組み込みます。
抽出は、関係するDLライブラリとそのアップストリームライブラリに関するLLMの知識によって促進されます。
TensorflowとPytorchの2つの人気のあるDLライブラリでDLLENを評価します。
私たちの評価は、DLLENがこれらのライブラリの最先端の技術によって見つかったAPIの1.84倍のAPIで対応物を合成することを示しています。
さらに、同時に予算の下で、Dllensは7.23%のブランチをカバーし、200のランダムにサンプリングされたAPIで最先端のテクニックの1.88倍のバグを検出します。
Dllensは、最近のTensorflowおよびPytorchライブラリで71のバグを正常に検出しました。
その中で、59は、以前は未知のバグとして確認された46を含む開発者によって確認されており、これらの以前は未知のバグのうち10はTensorflowとPytorchの最新バージョンで修正されています。

要約(オリジナル)

Differential testing offers a promising strategy to alleviate the test oracle problem by comparing the test results between alternative implementations. However, existing differential testing techniques for deep learning (DL) libraries are limited by the key challenges of finding alternative implementations (called counterparts) for a given API and subsequently generating diverse test inputs. To address the two challenges, this paper introduces DLLens, an LLM-enhanced differential testing technique for DL libraries. To address the first challenge, DLLens incorporates an LLM-based counterpart synthesis workflow, with the insight that the counterpart of a given DL library API’s computation could be successfully synthesized through certain composition and adaptation of the APIs from another DL library. To address the second challenge, DLLens incorporates a static analysis technique that extracts the path constraints from the implementations of a given API and its counterpart to guide diverse test input generation. The extraction is facilitated by LLM’s knowledge of the concerned DL library and its upstream libraries. We evaluate DLLens on two popular DL libraries, TensorFlow and PyTorch. Our evaluation shows that DLLens synthesizes counterparts for 1.84 times as many APIs as those found by state-of-the-art techniques on these libraries. Moreover, under the same time budget, DLLens covers 7.23% more branches and detects 1.88 times as many bugs as state-of-the-art techniques on 200 randomly sampled APIs. DLLens has successfully detected 71 bugs in recent TensorFlow and PyTorch libraries. Among them, 59 are confirmed by developers, including 46 confirmed as previously unknown bugs, and 10 of these previously unknown bugs have been fixed in the latest version of TensorFlow and PyTorch.

arxiv情報

著者 Meiziniu Li,Dongze Li,Jianmeng Liu,Jialun Cao,Yongqiang Tian,Shing-Chi Cheung
発行日 2025-05-08 15:48:00+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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