Cross-Framework Discrepancies in Deep Learning

This direction is no longer present in the current build. Its last version stays readable and citable here.

Version 1 of 120 papers28 conceptsfrozen 2026-10-04

In the idealized world of machine learning research, a neural network is a mathematical abstraction—a sequence of tensors and operations that should behave identically regardless of the software used to execute them. However, a growing body of research suggests that deep learning frameworks like PyTorch, TensorFlow, and MXNet are not neutral "wrappers" for math. Instead, they are complex software ecosystems that exert a significant, often hidden influence on model convergence, performance, and reproducibility.

The Illusion of Architectural Equivalence

The central problem in this field is the "semantic gap." As Max Zvyagin, Sumit Kumar Jha, and colleagues demonstrate in CrossedWires: A Dataset of Syntactically Equivalent but Semantically Disparate Deep Learning Models, training the exact same architecture with identical hyperparameters across different frameworks can lead to accuracy differences as high as 68%.

This discrepancy shatters the assumption that code is a direct translation of math. When a researcher reports a state-of-the-art result in PyTorch, a practitioner attempting to replicate it in TensorFlow may fail not because of an algorithmic error, but because of the "semantic" differences in how the frameworks handle the underlying computation.

Why the Gap Exists: Hidden Defaults and Kernels

If the math is the same, why are the results different? Research identifies three primary drivers of these discrepancies:

  1. Undocumented Defaults: Frameworks often employ different default settings for critical components. Luisa Sophie Werner and her team in Reproduce, Replicate, Reevaluate point out that weight initialization methods and data handling philosophies vary wildly. A "default" initialization in one library might lead to a stable gradient, while the default in another might cause vanishing gradients for the same architecture.
  2. Low-Level Dependencies: Performance is often confounded by the versions of underlying hardware-acceleration libraries like cuDNN or MKL. Tianqi Chen, Mu Li, and the MXNet team noted early on that speedups attributed to architectural innovations are often actually the result of more optimized external kernels in a specific software stack.
  3. Execution Logic: Frameworks differ in how they manage memory and schedule operations. Pierre Ablin and the Benchopt team argue that divergent default behaviors—such as how a framework handles non-deterministic GPU calculations—prevent fair head-to-head comparisons of algorithms.

Standardizing the "Kitchen"

To solve this, researchers are moving toward framework-agnostic benchmarking and rigorous replication pipelines. The intuition is that if we can isolate the algorithm from the software stack, we can finally see which innovations actually work.

  • Modular Benchmarking: Tools like Benchopt decouple datasets, objectives, and solvers, allowing for hardware-agnostic comparisons.
  • Cross-Framework Validation: Siqiao Xue and the creators of EasyTPP demonstrated that when implementations are meticulously standardized across PyTorch and TensorFlow, performance differences become negligible. This suggests that the "gap" is not an inherent property of the frameworks, but a result of inconsistent implementation practices.
  • Wall-Clock Rigor: The AlgoPerf competition, analyzed by Priya Kasimbeg and Frank Schneider, shifts the focus to wall-clock time to reach a target performance. This forces researchers to account for the overhead of the software stack itself.

The Path Forward: Reproduce, Replicate, Reevaluate

The research direction suggests a new standard for scientific transparency. As proposed by Luisa Sophie Werner, researchers should follow a three-step pipeline: Reproduce the original results using the original code, Replicate the findings in a different framework to identify hidden dependencies, and Reevaluate the method's robustness.

By acknowledging that deep learning frameworks are active variables in our experiments, the field moves away from "framework-dependent" results toward a more robust, scientifically verifiable understanding of neural network behavior.

Papers in this version

History & citationVersion 1 · 2026-10-04

No longer present in the current build · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_cross_framework_discrepancies_in_deep_le_f5b70bab,
  title = {Cross-Framework Discrepancies in Deep Learning},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/cross-framework-discrepancies-in-deep-learning/rdr_f5b70babbf1644d495be4b410245be8a},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-30},
}

This exact version (version 1, frozen text):

@misc{lacuna_cross_framework_discrepancies_in_deep_le_f5b70bab_v1,
  title = {Cross-Framework Discrepancies in Deep Learning},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/cross-framework-discrepancies-in-deep-learning/rdr_f5b70babbf1644d495be4b410245be8a/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-30},
}