LLM pipeline translates 19,000-line Fortran to JAX, achieving 24x speedup
A five-phase LLM agent automatically migrates legacy scientific code to differentiable frameworks.
Differentiable programming promises transformative capabilities for scientific modeling, but migrating legacy codebases (often written in Fortran) into frameworks like JAX remains a major hurdle. To address this, researchers from Columbia University have introduced a systematic five-phase LLM-based agentic pipeline that automatically translates legacy Fortran code into fully differentiable JAX. The pipeline begins with static dependency analysis to determine the optimal module translation order from the full call graph. It then enters iterative compile-repair loops that autonomously correct errors, followed by validation using a Fortran reference oracle that enforces numerical parity at the module level before integration and gradient verification.
The team instantiated and evaluated the pipeline on CLM-ml-v2, a 19,000-line Fortran land surface model, analyzing agent behavior across 73 module translation tasks. The resulting differentiable model computes the complete Jacobian in a single backward pass—a task that was previously impractical. It recovers physical parameters in eight times fewer steps than gradient-free optimization and achieves a 24x wall-clock speedup over sequential Fortran at an ensemble size of 2,048. Both the translated model and the pipeline infrastructure have been released as a reusable framework, opening the door for differentiating other Earth system model components and accelerating climate science research.
- Five-phase LLM agent pipeline automates translation: static dependency analysis, iterative compile-repair loops, and a Fortran reference oracle for numerical parity.
- Translated JAX model computes full Jacobian in a single backward pass and recovers parameters 8x faster than gradient-free optimization.
- Achieves 24x wall-clock speedup over sequential Fortran at ensemble size 2,048, with both model and pipeline released as reusable framework.
Why It Matters
Unlocks gradient-based optimization for legacy scientific models, accelerating climate modeling, parameter estimation, and data assimilation.