Differentiable programming offers transformative capabilities for scientific modeling, enabling gradient-based parameter estimation, sensitivity analysis, and data assimilation. Yet, migrating legacy codebases into differentiable frameworks remains a challenge. We present a five-phase LLM-based agentic pipeline that translates legacy Fortran into JAX: static dependency analysis determines module translation order from the full call graph; iterative compile-repair loops correct errors autonomously; and a Fortran reference oracle enforces numerical parity at the module level before integration and gradient verification. We instantiate and evaluate the pipeline on CLM-ml-v2, a 19,000-line Fortran land surface model, and analyze agent behavior across 73 module translation tasks. The resulting differentiable model computes the complete Jacobian in a single backward pass, recovers physical parameters in eight times fewer steps than gradient-free optimization, and achieves a 24 times wall-clock speedup over sequential Fortran at ensemble size N=2,048. Both the translated model and pipeline infrastructure are released as a reusable framework for differentiating other Earth system model components.


翻译:可微编程为科学建模提供了变革性能力,支持基于梯度的参数估计、敏感性分析和数据同化。然而,将遗留代码库迁移至可微框架仍面临挑战。我们提出一种基于大语言模型的五阶段智能体流水线,可将遗留Fortran代码翻译为JAX:静态依存分析根据完整调用图确定模块翻译顺序;迭代编译-修复循环自主修正错误;Fortran参考验证器在集成与梯度验证前,确保模块级数值一致性。我们在CLM-ml-v2(含19,000行Fortran代码的地表模型)上实例化并评估该流水线,分析73个模块翻译任务中的智能体行为。所生成的可微模型可在单次反向传播中计算完整雅可比矩阵,以比无梯度优化少八倍的步数恢复物理参数,并在集成规模N=2,048时实现比顺序Fortran快24倍的墙钟加速。本翻译模型及流水线基础设施已作为可复用框架发布,用于区分其他地球系统模型组件。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
LLMS4ALL:大语言模型在各学科科研与应用中的综述
专知会员服务
36+阅读 · 2025年10月4日
大型语言模型系统中提示缺陷的分类学
专知会员服务
8+阅读 · 2025年9月19日
《大型语言模型代码生成》综述
专知会员服务
70+阅读 · 2024年6月4日
大语言模型算法演进综述
专知会员服务
81+阅读 · 2024年5月30日
代码注释最详细的Transformer
专知会员服务
113+阅读 · 2022年6月30日
绝对干货!NLP预训练模型:从transformer到albert
新智元
13+阅读 · 2019年11月10日
AI可解释性文献列表
专知
43+阅读 · 2019年10月7日
用模型不确定性理解模型
论智
11+阅读 · 2018年9月5日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 6月12日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
4+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
6+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
3+阅读 · 6月17日
相关VIP内容
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员