Response to Reviewer TwWZ
**W1. Lack of Negative Results**
Although our paper centered on ADELT's strengths, we have indeed discussed its limitations in detail.
In Table 2, we provided a detailed case study illustrating instances where ADELT demonstrated less optimal performance. Notably, a case where the parameter `output_dim` was inaccurately mapped to `embeddings_initializer` due to an error in generating vocabulary mapping.
Also, ADELT is unable to transpile `layers.Dense(out_dim, activation='relu')` into corresponding PyTorch API calls, `nn.Linear` and `nn.ReLU`. This is because the training corpus does not include enough examples that reflect such use cases in Keras. In Appendix A.9, we describe the potential for ADELT's improved modeling of such mappings in a scenario where we add synthetic data into the corpus.
We value your perspective and will expand our discussion of both the pros and cons in our paper.
**W2. Generalization of the Approach**
We appreciate your insightful suggestion on generalizing the application of ADELT. While our current study focuses on transpilation between specific deep learning frameworks, ADELT's approach can be extended to various API ecosystems within the same programming language. We believe that ADELT’s approach to transpilation can also be applied to transpile between APIs from different domains, such as visualization (Matplotlib vs. Seaborn) or database access APIs (PyMongo vs SQLite). Your feedback has certainly contributed to outlining the future directions of our work.
**Q1. How does ADELT handle situations where different versions of deep learning frameworks require different expressions?**
Thank you for your insightful question. ADELT addresses variability across framework versions by treating each version-specific expression as a unique entry. Both `torch.autograd.Variable` and `torch.tensor` in PyTorch are mapped to `tf.Tensor` in Keras. The reverse process, subsequently, interprets `tf.Tensor` from Keras as the more recent `torch.tensor` expression in PyTorch. This approach maintains consistency across different framework versions and ensures accurate transpilation.
**Q2. In the METHOD section, the authors mention that they "convert each API call into its canonical form". How exactly is this achieved?**
We convert each API call into its canonical form using Python's built-in `inspect` module, specifically `inspect.bind` (https://docs.python.org/3/library/inspect.html). This function interprets Python function calls internally and creates a mapping from positional and keyword arguments to parameters. We have further detailed this procedure in Section 2.1 of our paper.
**Q3. What e_i and e_j mean in the last paragraph of Section 2.3.**
Thank you for your question. In Section 2.3, $e_i$ and $e_j$ correspond to the unique embeddings of each API keyword. To elaborate, every API keyword, like `nn.Conv2d` in PyTorch, is assigned its unique embedding, like `nn.Linear` or `nn.Linear.in_features`. In Equation (2), we incorporate these embedding matrices as weight matrices for the output classification layer, a strategy that is commonly adopted in Transformer LMs where a shared parameter tensor is used between the word embedding and the output layer [1].
**Q4. Have the authors tested the accuracy of each component, such as "Canonicalizion" "Extract API calls" "Code to Skeleton" and "Dictionary Lookup" and so on?**
Yes, ADELT indeed follows a pipeline structure that includes “Canonicalization”, “API call extraction”, “Code to Skeleton”, “Skeletal Code Transpilation” and “Dictionary Lookup” among other steps.
For “Canonicalization”, “API call extraction”, “Code to Skeleton”, our approach uses Python's internal library and does not involve machine learning, thereby not affecting transpilation accuracy.
For “Skeletal Code Transpilation”, Section 3.4 describes its accuracy of 100% on the benchmarks. In fact, one of the key novelties of ADELT is the decoupling of the transpilation process into transpiling the skeletal code followed by dictionary lookup. Skeletal code transpilation is designed to be simple using any off-the-shelf LLM, while the dictionary used in the second step requires more sophisticated techniques to learn via adversarial learning.
For “Dictionary Lookup”, the performance is reported in Table 3 (ablation studies), where we show metrics such as Precision@1, Precision@5, and MRR. The dictionary of ADELT has Precision@1 of 87.1% and 90.0% for both transpilation directions respectively.
We hope that this clarifies the efficacy of ADELT's individual components.
[1] Rethinking embedding coupling in pre-trained language models, https://arxiv.org/abs/2010.12821