arXiv:2504.14268cs.LG2025-04

用强化学习动态调整计算精度,让迭代求解更快更稳。

Mixed-Precision Conjugate Gradient Solvers with RL-Driven Precision Tuning

  • 将精度选择建模为马尔可夫决策过程,用Q-learning自动分配操作精度。
  • 在保持数值稳定前提下,相比全精度计算提速最高达2.3倍。
  • 训练一次即可通用新数据,适合大规模科学计算场景使用。

本文提出一种新颖的强化学习(RL)框架,用于在预条件共轭梯度(CG)方法中动态优化数值精度。通过将精度选择建模为马尔可夫决策过程(MDP),采用Q-learning自适应地为关键操作分配精度级别,在保证计算效率与数值准确性之间取得最优平衡,同时通过双精度标量运算和残差计算确保稳定性。实际应用中,算法在一组数据上训练后,即可对未见数据进行精度选择推理,无需针对新数据集重新分析或训练,实现对新问题实例的无缝适配,且无重校准计算开销。实验结果证明了强化学习在提升求解器性能方面的有效性,这是首次将强化学习应用于混合精度数值方法。研究结果凸显该方法在实用性、鲁棒性和可扩展性上的优势,为智能算法与迭代求解器的融合提供了重要启示,推动科学计算向人工智能驱动方向发展。

原文摘要 · Abstract (English)

This paper presents a novel reinforcement learning (RL) framework for dynamically optimizing numerical precision in the preconditioned conjugate gradient (CG) method. By modeling precision selection as a Markov Decision Process (MDP), we employ Q-learning to adaptively assign precision levels to key operations, striking an optimal balance between computational efficiency and numerical accuracy, while ensuring stability through double-precision scalar computations and residual computing. In practice, the algorithm is trained on a set of data and subsequently performs inference for precision selection on out-of-sample data, without requiring re-analysis or retraining for new datasets. This enables the method to adapt seamlessly to new problem instances without the computational overhead of recalibration. Our results demonstrate the effectiveness of RL in enhancing solver's performance, marking the first application of RL to mixed-precision numerical methods. The findings highlight the approach's practical advantages, robustness, and scalability, providing valuable insights into its integration with iterative solvers and paving the way for AI-driven advancements in scientific computing.

强化学习混合精度数值求解科学计算

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。