pith. sign in

arxiv: 2511.02610 · v2 · pith:HAUZXGJLnew · submitted 2025-11-04 · 💻 cs.LG

Towards Migrating Neural Network Implementations

Pith reviewed 2026-05-21 19:32 UTC · model grok-4.3

classification 💻 cs.LG
keywords neural network migrationdeep learning frameworkspivot modelPyTorchTensorFlowcode migrationautomatic migrationfunctional equivalence
0
0 comments X

The pith

A pivot neural network model abstracts implementations to enable automatic migration of NN code between frameworks like PyTorch and TensorFlow.

A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.

The paper proposes an approach that uses a pivot NN model to create an abstraction layer before migrating neural network code from one deep learning framework to another. This tackles the problem of organizations needing to switch frameworks for better performance or new features, which currently demands manual code rewrites. The method was tested by migrating five networks between PyTorch and TensorFlow. Results show the migrated networks remain functionally equivalent to the originals. If the approach holds, it would cut the time and effort required to keep AI systems up to date with evolving libraries.

Core claim

The authors establish that their migration technique, centered on a pivot NN model to abstract the network prior to translation, converts neural network code between PyTorch and TensorFlow while producing models that are functionally equivalent to the source versions, as demonstrated in experiments across five distinct networks.

What carries the argument

The pivot NN model, an intermediate abstraction that represents the neural network structure independently of any particular framework's syntax or API.

If this is right

  • Organizations can switch neural network frameworks with less manual coding when requirements or performance needs change.
  • Modernization of existing smart systems becomes faster by avoiding full rewrites of neural network components.
  • New framework features can be adopted more readily once the initial pivot abstraction is in place.
  • Development teams gain flexibility to choose the best library without being locked into the original implementation.

Where Pith is reading between the lines

These are editorial extensions of the paper, not claims the author makes directly.

  • Extending the pivot model to cover additional frameworks such as JAX or MXNet could broaden the method's applicability.
  • Integration with continuous integration pipelines might allow automatic migration checks during framework upgrades.
  • The abstraction could support hybrid models that run parts in different frameworks for optimized execution.

Load-bearing premise

The pivot NN model captures every implementation detail needed for complete and correct migration without manual fixes in most cases.

What would settle it

Comparing outputs of the original and migrated versions of the five networks on the same input datasets and finding any systematic differences in predictions or accuracy would disprove functional equivalence.

Figures

Figures reproduced from arXiv: 2511.02610 by Ivan Alfonso, Jordi Cabot, Nadia Daoudi.

Figure 1
Figure 1. Figure 1: The NN metamodel. It illustrates the key NN components and their relationships, including layers, tensorOps, datasets [PITH_FULL_IMAGE:figures/full_fig_p003_1.png] view at source ↗
Figure 2
Figure 2. Figure 2: Overview of our migration approach. TensorFlow is used as the source library and PyTorch as the target library. [PITH_FULL_IMAGE:figures/full_fig_p005_2.png] view at source ↗
Figure 3
Figure 3. Figure 3: An illustration of the migration process from TensorFlow to PyTorch, showing the three main steps: 1) AST Extraction, [PITH_FULL_IMAGE:figures/full_fig_p006_3.png] view at source ↗
Figure 4
Figure 4. Figure 4: shows the integration of BESSER-NN with the concepts from the UML modelling language. Integration is done at the meta￾model level by combining BESSER-NN metamodel and the UML metamodel as we describe in what follows. UML enables the specification of various model types, such as state machine models (StateMachineModel class in [PITH_FULL_IMAGE:figures/full_fig_p007_4.png] view at source ↗
Figure 5
Figure 5. Figure 5: Max absolute differences (MAD) for neural networks migrated from TensorFlow to PyTorch. XToY denotes migration [PITH_FULL_IMAGE:figures/full_fig_p009_5.png] view at source ↗
read the original abstract

The development of smart systems (i.e., systems enhanced with AI components) has thrived thanks to the rapid advancements in neural networks (NNs). A wide range of libraries and frameworks have consequently emerged to support NN design and implementation. The choice depends on factors such as available functionalities, ease of use, documentation and community support. After adopting a given NN framework, organizations might later choose to switch to another if performance declines, requirements evolve, or new features are introduced. Unfortunately, migrating NN implementations across libraries is challenging due to the lack of migration approaches specifically tailored for NNs. This leads to increased time and effort to modernize NNs, as manual updates are necessary to avoid relying on outdated implementations and ensure compatibility with new features. In this paper, we propose an approach to automatically migrate neural network code across deep learning frameworks. Our method makes use of a pivot NN model to create an abstraction of the NN prior to migration. We validate our approach using two popular NN frameworks, namely PyTorch and TensorFlow. We also discuss the challenges of migrating code between the two frameworks and how they were approached in our method. Experimental evaluation on five NNs shows that our approach successfully migrates their code and produces NNs that are functionally equivalent to the originals. Artefacts from our work are available online.

Editorial analysis

A structured set of objections, weighed in public.

Desk editor's note, referee report, simulated authors' rebuttal, and a circularity audit. Tearing a paper down is the easy half of reading it; the pith above is the substance, this is the friction.

Referee Report

2 major / 1 minor

Summary. The paper proposes an approach to automatically migrate neural network code across deep learning frameworks (PyTorch and TensorFlow) by first abstracting the network into a pivot NN model, discusses specific migration challenges between the frameworks, and reports that the method successfully produces functionally equivalent networks on five evaluated NNs.

Significance. If the pivot abstraction proves sufficiently complete and the equivalence claims hold under rigorous verification, the work could meaningfully reduce manual effort in modernizing AI systems when organizations switch frameworks. The empirical validation across multiple networks and the release of artefacts are clear strengths that support reproducibility and practical utility.

major comments (2)
  1. [§3] §3 (Proposed Approach): The pivot NN model is presented as the key abstraction enabling automatic migration, yet the manuscript provides no explicit enumeration of supported operations, no handling rules for framework differences such as dynamic versus static graph construction, and no discussion of custom modules or tensor semantics; this directly undermines the claim that migration occurs without manual intervention in general cases.
  2. [§5] §5 (Experimental Evaluation): Functional equivalence is asserted for the five networks, but the text does not describe the concrete measurement procedure (e.g., output tensor comparison thresholds, test-set accuracy deltas, or numerical tolerance), nor does it report whether any case-by-case fixes were applied; without this, the success claim cannot be assessed and is load-bearing for the central contribution.
minor comments (1)
  1. [Abstract] Abstract: The statement that 'Artefacts from our work are available online' is not accompanied by a concrete URL or repository identifier, reducing immediate accessibility.

Simulated Author's Rebuttal

2 responses · 0 unresolved

We thank the referee for their constructive comments on our manuscript. We address the major comments point by point below, indicating where revisions will be made to improve the paper.

read point-by-point responses
  1. Referee: [§3] §3 (Proposed Approach): The pivot NN model is presented as the key abstraction enabling automatic migration, yet the manuscript provides no explicit enumeration of supported operations, no handling rules for framework differences such as dynamic versus static graph construction, and no discussion of custom modules or tensor semantics; this directly undermines the claim that migration occurs without manual intervention in general cases.

    Authors: We agree that additional details on the pivot NN model would strengthen the manuscript. In the revised version, we will include an explicit list of supported operations in the pivot model within §3. We will also add explanations of how framework differences, including dynamic versus static graph construction, are handled, along with discussions of tensor semantics and support for custom modules. This will better delineate the cases where fully automatic migration is possible without manual intervention. revision: yes

  2. Referee: [§5] §5 (Experimental Evaluation): Functional equivalence is asserted for the five networks, but the text does not describe the concrete measurement procedure (e.g., output tensor comparison thresholds, test-set accuracy deltas, or numerical tolerance), nor does it report whether any case-by-case fixes were applied; without this, the success claim cannot be assessed and is load-bearing for the central contribution.

    Authors: We acknowledge the need for more precise details on the evaluation methodology. In the revised manuscript, we will expand §5 to describe the concrete procedures used to verify functional equivalence, including the specific thresholds for output tensor comparisons, any accuracy deltas measured on test sets, numerical tolerances applied, and whether any case-by-case adjustments or fixes were necessary during the migration process. revision: yes

Circularity Check

0 steps flagged

No circularity: empirical engineering method with independent validation

full rationale

The paper describes a practical migration approach for neural network code between frameworks (PyTorch and TensorFlow) that relies on an intermediate pivot model abstraction, followed by direct experimental checks on five networks for functional equivalence. No equations, predictions, or first-principles derivations appear in the abstract or described content; success is reported via empirical outcomes rather than any reduction of a claimed result to fitted inputs or self-citations. The central claim therefore stands on observable migration results and does not collapse to its own definitions or prior author work by construction.

Axiom & Free-Parameter Ledger

0 free parameters · 1 axioms · 0 invented entities

The method depends on the assumption that neural network code can be abstracted and re-generated across frameworks without loss of semantics.

axioms (1)
  • domain assumption A pivot model can represent neural network structures independently of specific frameworks.
    This is the core of the abstraction step in the migration process.

pith-pipeline@v0.9.0 · 5758 in / 1097 out tokens · 100702 ms · 2026-05-21T19:32:48.912224+00:00 · methodology

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Lean theorems connected to this paper

Citations machine-checked in the Pith Canon. Every link opens the source theorem in the public Lean library.

What do these tags mean?
matches
The paper's claim is directly supported by a theorem in the formal canon.
supports
The theorem supports part of the paper's argument, but the paper may add assumptions or extra steps.
extends
The paper goes beyond the formal theorem; the theorem is a base layer rather than the whole result.
uses
The paper appears to rely on the theorem as machinery.
contradicts
The paper's claim conflicts with a theorem or certificate in the canon.
unclear
Pith found a possible connection, but the passage is too broad, indirect, or ambiguous to say the theorem truly supports the claim.

Reference graph

Works this paper leans on

53 extracted references · 53 canonical work pages · 4 internal anchors

  1. [1]

    Iván Alfonso, Aaron Conrardy, Armen Sulejmani, Atefeh Nirumand, Fitash Ul Haq, Marcos Gomez-Vazquez, Jean-Sébastien Sottet, and Jordi Cabot. 2024. Building BESSER: An Open-Source Low-Code Platform. InEnterprise, Business- Process and Information Systems Modeling, Han van der Aa, Dominik Bork, Rainer Schmidt, and Arnon Sturm (Eds.). Springer Nature Switzer...

  2. [2]

    Apple. 2017. Core ML: github repository. https://github.com/apple/coremltools Accessed July 05, 2025

  3. [3]

    Apple. 2017. Core ML: Integrate machine learning models into your app. https: //developer.apple.com/documentation/coreml Accessed July 05, 2025

  4. [4]

    Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2014. Neural machine translation by jointly learning to align and translate. arXiv 2014.arXiv preprint arXiv:1409.0473(2014)

  5. [5]

    BCG. 2025. One Third of Companies Plan to Spend More than $25 Million On AI in 2025 Amid Widespread Optimism for Autonomous Agents. https://www.bcg. com/press/15january2025-ai-optimism-autonomous-agents Accessed July 18, 2025

  6. [6]

    Léon Bottou. 2010. Large-Scale Machine Learning with Stochastic Gradient Descent. InProceedings of COMPSTAT’2010, Yves Lechevallier and Gilbert Saporta (Eds.). Physica-Verlag HD, Heidelberg, 177–186

  7. [7]

    Hugo Bruneliere, Jordi Cabot, Grégoire Dupé, and Frédéric Madiot. 2014. Modisco: A model driven reverse engineering framework.Information and Software Tech- nology56, 8 (2014), 1012–1032

  8. [8]

    Business Insider. 2025. Investors are pressuring companies to get serious about AI. https://www.businessinsider.com/investors-pressuring-companies-to-get- serious-about-ai-2025-4 Accessed July 18, 2025

  9. [9]

    Harold Castro and Ajobiewe Oreofe. 2022. TensorFlow vs. PyTorch: A Compara- tive Study of Deep Learning Frameworks. (09 2022)

  10. [10]

    Vishnu Vardhan Reddy Chilukoori. [n. d.]. TEMPLATIZATION: AN APPROACH TO IMPROVE SCALABILITY AND MAINTAINABILITY OF CODEBASES. ([n. d.])

  11. [11]

    Nadia Daoudi, Ivan Alfonso, and Jordi Cabot. 2025. Modelling Neural Network Models. InResearch Challenges in Information Science, J ¯anis Grabis, Tanja E. J. Vos, Maria José Escalona, and Oscar Pastor (Eds.). Springer Nature Switzerland, Cham, 130–139. https://link.springer.com/chapter/10.1007/978-3-031-92471-2_10

  12. [12]

    Saumitro Dasgupta. 2015. Caffe to TensorFlow. https://github.com/ethereon/ caffe-tensorflow/tree/master Accessed July 07, 2025

  13. [13]

    Lysandre Debut. 2025. Deprecating TensorFlow and Flax support in transformers. https://x.com/LysandreJik/status/1933201171130593530 Accessed July 05, 2025

  14. [14]

    Adam Eck. 2018. Neural networks for survey researchers.Survey Practice11, 1 (2018)

  15. [15]

    Financial Times. 2025. UK civil servants who used AI saved two weeks a year, government study finds. https://www.ft.com/content/7c2aa19d-4c92-490d-bb35- f329a246fe5b Accessed July 18, 2025

  16. [16]

    2014.A practical guide to SysML: the systems modeling language

    Sanford Friedenthal, Alan Moore, and Rick Steiner. 2014.A practical guide to SysML: the systems modeling language. Morgan Kaufmann

  17. [17]

    Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik. 2014. Rich Feature Hierarchies for Accurate Object Detection and Semantic Segmentation. In2014 IEEE Conference on Computer Vision and Pattern Recognition. 580–587. doi:10.1109/CVPR.2014.81

  18. [18]

    Alex Graves. 2013. Generating sequences with recurrent neural networks.arXiv preprint arXiv:1308.0850(2013)

  19. [19]

    Khronos group. 2017. Neural Network Exchange Format (NNEF). https://www. khronos.org/api/nnef Accessed July 05, 2025

  20. [20]

    Object Management Group. 2017. OMG unified modeling language tm (omg UML). (2017), 1–754

  21. [21]

    Qianyu Guo, Sen Chen, Xiaofei Xie, Lei Ma, Qiang Hu, Hongtao Liu, Yang Liu, Jianjun Zhao, and Xiaohong Li. 2019. An Empirical Study Towards Characterizing Deep Learning Development and Deployment Across Different Frameworks and Platforms. In2019 34th IEEE/ACM International Conference on Automated Software Engineering (ASE). 810–822. doi:10.1109/ASE.2019.00080

  22. [22]

    Hansika Hewamalage, Christoph Bergmeir, and Kasun Bandara. 2021. Recurrent neural networks for time series forecasting: Current status and future directions. International Journal of Forecasting37, 1 (2021), 388–427

  23. [23]

    Hruschka and M

    H. Hruschka and M. Natter. 1999.A Multilayer Perceptron for Clustering. Physica- Verlag HD, Heidelberg, 76–84. doi:10.1007/978-3-662-12433-8_8

  24. [24]

    Thiruvathukal, and James C

    Purvish Jajal, Wenxin Jiang, Arav Tewari, Erik Kocinare, Joseph Woo, Anusha Sarraf, Yung-Hsiang Lu, George K. Thiruvathukal, and James C. Davis. 2024. Inter- operability in Deep Learning: A User Survey and Failure Analysis of ONNX Model Converters. InProceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis(Vienna, Austr...

  25. [25]

    Yuwang Ji, Qiang Wang, Xuan Li, and Jie Liu. 2019. A Survey on Tensor Tech- niques and Applications in Machine Learning.IEEE Access7 (2019), 162950– 162990. doi:10.1109/ACCESS.2019.2949814

  26. [26]

    2021.Convolutional Neural Networks

    Nikhil Ketkar and Jojo Moolayil. 2021.Convolutional Neural Networks. Apress, Berkeley, CA, 197–242. doi:10.1007/978-1-4842-5364-9_6

  27. [27]

    Diederik P Kingma. 2014. Adam: A method for stochastic optimization.arXiv preprint arXiv:1412.6980(2014)

  28. [28]

    Alex Krizhevsky, Geoffrey Hinton, et al. 2009. Learning multiple layers of features from tiny images. (2009)

  29. [29]

    Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. 2012. ImageNet Clas- sification with Deep Convolutional Neural Networks. InAdvances in Neural Information Processing Systems, F. Pereira, C.J. Burges, L. Bottou, and K.Q. Wein- berger (Eds.), Vol. 25. Curran Associates, Inc. https://proceedings.neurips.cc/ paper_files/paper/2012/file/c399862d3b9d6b76...

  30. [30]

    Daniel Lenton, Fabio Pardo, Fabian Falck, Stephen James, and Ronald Clark. 2021. Ivy: Templated deep learning for inter-framework portability.arXiv preprint arXiv:2102.02886(2021). https://arxiv.org/abs/2102.02886

  31. [31]

    Yu Liu, Cheng Chen, Ru Zhang, Tingting Qin, Xiang Ji, Haoxiang Lin, and Mao Yang. 2020. Enhancing the interoperability between deep learning frameworks by model conversion. InProceedings of the 28th ACM joint meeting on European software engineering conference and symposium on the foundations of software engineering. 1320–1330

  32. [32]

    Jonathan Long, Evan Shelhamer, and Trevor Darrell. 2015. Fully convolutional networks for semantic segmentation. In2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). 3431–3440. doi:10.1109/CVPR.2015.7298965

  33. [33]

    Alexander Lutsenko. 2023. NoBuCo. https://github.com/AlexanderLutsenko/ nobuco Accessed July 06, 2025

  34. [34]

    Andrew Maas, Raymond E Daly, Peter T Pham, Dan Huang, Andrew Y Ng, and Christopher Potts. 2011. Learning word vectors for sentiment analysis. InProceedings of the 49th annual meeting of the association for computational linguistics: Human language technologies. 142–150

  35. [35]

    Webb, Germain Forestier, and Mahsa Salehi

    Navid Mohammadi Foumani, Lynn Miller, Chang Wei Tan, Geoffrey I. Webb, Germain Forestier, and Mahsa Salehi. 2024. Deep Learning for Time Series Classification and Extrinsic Regression: A Current Survey.ACM Comput. Surv. 56, 9, Article 217 (April 2024), 45 pages. doi:10.1145/3649448

  36. [36]

    Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Baolin Wu, An- drew Y Ng, et al. 2011. Reading digits in natural images with unsupervised feature learning. InNIPS workshop on deep learning and unsupervised feature learning, Vol. 2011. Granada, 7

  37. [37]

    Nielsen. 2025. How AI is redefining marketing, today and tomorrow. https://www. nielsen.com/insights/2025/ai-redefining-marketing-today-tomorrow Accessed July 18, 2025

  38. [38]

    Ovidiu-Constantin Novac, Mihai Cristian Chirodea, Cornelia Mihaela Novac, Nicu Bizon, Mihai Oproescu, Ovidiu Petru Stan, and Cornelia Emilia Gordan

  39. [39]

    doi:10.3390/s22228872

    Analysis of the Application Efficiency of TensorFlow and PyTorch in Convolutional Neural Network.Sensors22, 22 (2022). doi:10.3390/s22228872

  40. [40]

    ONNX. 2018. tf2onnx - Convert TensorFlow, Keras, Tensorflow.js and Tflite models to ONNX. https://github.com/onnx/tensorflow-onnx Accessed July 05, 2025

  41. [41]

    ONNX. 2021. Open neural network exchange. https://onnx.ai Accessed July 05, 2025

  42. [42]

    Moses Openja, Amin Nikanjam, Ahmed Haj Yahmed, Foutse Khomh, and Zhen Ming Jack Jiang. 2022. An Empirical Study of Challenges in Converting Deep Learning Models. In2022 IEEE International Conference on Software Maintenance and Evolution (ICSME). 13–23. doi:10.1109/ICSME55016.2022.00010

  43. [43]

    pytorch2keras. 2017. pytorch2keras. https://github.com/gmalivenko/ pytorch2keras Accessed July 05, 2025

  44. [44]

    Jonas Rauber, Matthias Bethge, and Wieland Brendel. 2020. EagerPy: Writing code that works natively with PyTorch, TensorFlow, JAX, and NumPy.arXiv preprint arXiv:2008.04175(2020). https://arxiv.org/abs/2008.04175

  45. [45]

    Robin M Schmidt. 2019. Recurrent neural networks (rnns): A gentle introduction and overview.arXiv preprint arXiv:1912.05911(2019)

  46. [46]

    Segment. 2025. Announcing The State of Personalization 2024. https://segment. com/blog/state-of-personalization-2024 Accessed July 18, 2025

  47. [47]

    Karen Simonyan and Andrew Zisserman. 2014. Very deep convolutional networks for large-scale image recognition.arXiv preprint arXiv:1409.1556(2014). https: //arxiv.org/abs/1409.1556

  48. [48]

    Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Y Ng, and Christopher Potts. 2013. Recursive deep models for semantic compositionality over a sentiment treebank. InProceedings of the 2013 conference on empirical methods in natural language processing. 1631–1642

  49. [49]

    TensorFlow. 2019. Convolutional Neural Network (CNN). https://www. tensorflow.org/tutorials/images/cnn Accessed July 05, 2025

  50. [50]

    Vintti. 2023. AI Cuts Accounting Costs with Automation Study. https://www.vintti.com/blog/ai-efficiency-a-quantitative-study-on-cost- reduction-in-accounting-through-automation Accessed July 18, 2025

  51. [51]

    Xingyou Wang, Weijie Jiang, and Zhiyong Luo. 2016. Combination of Convolu- tional and Recurrent Neural Network for Sentiment Analysis of Short Texts. In Proceedings of the 26th International Conference on Computational Linguistics, Yuji Matsumoto and Rashmi Prasad (Eds.). The COLING 2016 Organizing Committee, Osaka, Japan, 2428–2437. https://aclanthology....

  52. [52]

    Shudong Yang, Xueying Yu, and Ying Zhou. 2020. LSTM and GRU Neural Network Performance Comparison Study: Taking Yelp Review Dataset as an Example. In Conference acronym ’XX, June 03–05, 2018, Woodstock, NY Nadia Daoudi, Ivan Alfonso, and Jordi Cabot International Workshop on Electronic Communication and Artificial Intelligence. 98–101. doi:10.1109/IWECAI5...

  53. [53]

    Zeeshan, Yi Shouheng, Zahirazami Shauheen, Zhu Yiwen, Li Du, Li Xuan, and Li Wenbing

    Ahmed Zeeshan, Chin Wei-Sheng, Crook Aidan, Dupre Xavier, Eseanu Costin, Finley Tom, Gong Lixin, Inglis Scott, Jiang Pei, Matantsev Ivan, Roy Prabhat, Siddiqui M. Zeeshan, Yi Shouheng, Zahirazami Shauheen, Zhu Yiwen, Li Du, Li Xuan, and Li Wenbing. 2017. sklearn-onnx: Convert your scikit-learn model into ONNX. https://onnx.ai/sklearn-onnx Accessed July 05, 2025