Saved in:
Bibliographic Details
Main Authors: Gong, Linyuan, Wang, Jiayi, Cheung, Alvin
Format: Preprint
Published: 2023
Subjects:
Online Access:https://arxiv.org/abs/2303.03593
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866929337303826432
author Gong, Linyuan
Wang, Jiayi
Cheung, Alvin
author_facet Gong, Linyuan
Wang, Jiayi
Cheung, Alvin
contents We propose the Adversarial DEep Learning Transpiler (ADELT), a novel approach to source-to-source transpilation between deep learning frameworks. ADELT uniquely decouples code skeleton transpilation and API keyword mapping. For code skeleton transpilation, it uses few-shot prompting on large language models (LLMs), while for API keyword mapping, it uses contextual embeddings from a code-specific BERT. These embeddings are trained in a domain-adversarial setup to generate a keyword translation dictionary. ADELT is trained on an unlabeled web-crawled deep learning corpus, without relying on any hand-crafted rules or parallel data. It outperforms state-of-the-art transpilers, improving pass@1 rate by 17.4 pts and 15.0 pts for PyTorch-Keras and PyTorch-MXNet transpilation pairs respectively. We provide open access to our code at https://github.com/gonglinyuan/adelt.
format Preprint
id arxiv_https___arxiv_org_abs_2303_03593
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle ADELT: Transpilation Between Deep Learning Frameworks
Gong, Linyuan
Wang, Jiayi
Cheung, Alvin
Computation and Language
Machine Learning
We propose the Adversarial DEep Learning Transpiler (ADELT), a novel approach to source-to-source transpilation between deep learning frameworks. ADELT uniquely decouples code skeleton transpilation and API keyword mapping. For code skeleton transpilation, it uses few-shot prompting on large language models (LLMs), while for API keyword mapping, it uses contextual embeddings from a code-specific BERT. These embeddings are trained in a domain-adversarial setup to generate a keyword translation dictionary. ADELT is trained on an unlabeled web-crawled deep learning corpus, without relying on any hand-crafted rules or parallel data. It outperforms state-of-the-art transpilers, improving pass@1 rate by 17.4 pts and 15.0 pts for PyTorch-Keras and PyTorch-MXNet transpilation pairs respectively. We provide open access to our code at https://github.com/gonglinyuan/adelt.
title ADELT: Transpilation Between Deep Learning Frameworks
topic Computation and Language
Machine Learning
url https://arxiv.org/abs/2303.03593