计算机科学 ›› 2026, Vol. 53 ›› Issue (6A): 250800005-9.doi: 10.11896/jsjkx.250800005
刘子璇1,2, 唐小勇1
LIU Zixuan1,2, TANG Xiaoyong1
摘要: 针对深度学习中噪声数据导致的模型过拟合与训练不稳定问题,首次将控制理论中的动态误差补偿机制引入代码生成任务,提出一种基于动态调节交叉熵损失函数(PID-CE Loss)的代码生成模型(PID-Dynamic LSTM)。传统交叉熵损失函数在噪声场景下易受异常样本干扰,导致梯度更新方向偏移与收敛速度下降。通过融合比例(P)、积分(I)、微分(D)控制项,构建动态误差补偿机制:1)比例项保留交叉熵的即时误差响应特性;2)积分项引入指数移动平均(EMA)差分捕捉损失变化的长期趋势,修正累积偏差;3)微分项通过约束相邻训练步概率分布的均方误差(MSE),抑制噪声引发的预测突变。实验表明,在500轮含噪声训练中,所提方法在测试数据集上达到96.28%验证准确率(较基线提升3.42%),首次达到80%准确率所需训练轮次减少31.7%(224→153轮),过拟合间隙降低6.4%,损失波动下降18.5%。消融实验进一步验证了PID-CE对噪声抑制的关键作用以及参数特性。该方法为噪声鲁棒性优化提供了理论可解释、工程易部署的新范式,在噪声敏感场景中具有相应的应用潜力。
中图分类号:
| [1] LIU K,YIN C,ZHAO H,et al.Prediction of sand body thickness based on a mixed density network constrained by a spatially approximated probability[J].Geophysical Prospecting for Petroleum,2020,59(4):596-606,615. [2] AO B Q,JIANG X J,LIU X Y,et al.Design of Unmanned Surface Vehicle Control System Based onNeural Network-PID Control[J].Control Engineering of China,2024,31(7):1178-1184. [3] QIN D H,LI Z T,BAI F B,et al.A Review of Parameter-Efficient Fine-Tuning Technology for Large Language Models[J].Computer Engineering and Applications,2025,61(16):38-63. [4] TIPIRNENI S,ZHU M,REDDY C K.Structcoder:Structure-aware transformer for code generation[J].ACM Transactions on Knowledge Discovery from Data,2024,18(3):1-20. [5] FARHADI A,MIRZAREZAEE M,SHARIFI A,et al.Domain adaptation in reinforcement learning:a comprehensive and systematic study[J].Frontiers of Information Technology & Electronic Engineering,2024,25(11):1446-1465. [6] LE H,WANG Y,GOTMARE A D,et al.CodeRL:Mastering code generation through pretrained models and deep reinforcement learning[J].arXiv:2207.01780,2022. [7] ZHANG T Y,YU T,HASHIMOTO T B,et al.Coder reviewer reranking for code generation[J].arXiv:2211.16490,2022. [8] HUANG Y,GU H,YU Z,et al.Enhancing low-resource cross-lingual summarization from noisy data with fine-grained reinforcement learning[J].Frontiers of Information Technology & Electronic Engineering,2024,25(1):121-134. [9] XU F F,JIANG Z B,YIN P C,et al.Incorporating externalknowledge through pre-training for natural language to code generation[C]//Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics.Association for Computational Linguistics,2020:6045-6052. [10] YIN P C,NEUBIG G.TRANX:A transition-based neural abstract syntax parser for semantic parsing and code generation[C]//Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing:System Demonstrations.Association for Computational Linguistics,2018:7-12. [11] SOW D,WOISETSCHLÄGER H,BULUSU S,et al.Dynamic Loss-Based Sample Reweighting for Improved Large Language Model Pretraining[J].arXiv:2502.06733,2025. [12] TERVEN J,CORDOVA-ESPARZA D M,RAMIREZ-PEDRAZA A,et al.Loss functions and metrics in deep learning[J].ar-Xiv:2307.02694,2023. [13] CIAMPICONI L,ELWOOD A,LEONARDI M,et al.A survey and taxonomy of loss functions in machine learning[J].arXiv:2301.05579,2023. [14] DUAN F,WANG H M,ZHANG C.Cauchy Non-negative Matrix Factorization for Data Representation[J].Computer Science,2021,48(6):96-102. [15] GONG Z Y.Robust Principal Component Analysis Based onWelsch Loss and Half-Quadratic Optimization[C]//2024 International Conference on Wavelet Analysis and Pattern Recognition(ICWAPR).IEEE,2024. [16] PERETS K,OLEKSII K.Assessment of the impact of sparsity and geman-mcclure regularization on signal reconstruction accuracy[J].Management,Training and Communication System,2025,2:239-243. [17] TERVEN J,CORDOVA-ESPARZA D M,RAMIREZ-PEDRAZA A,et al.Loss functions and metrics in deep learning[J].ar-Xiv:2307.02694,2023. [18] WEN W,HU Z X,HAO Z F.Deep Exponential Moving Ave-rage Learning Method for Sequential Recommendation [J].Journal of Frontiers of Computer Science and Techno,2025,19(3):774-786. [19] CHU Y L,ZHENG H,HOU X P.Chinese semantic similarity calculation based on dynamic semantic coding Bi-Directional LSTM[J].Computer Applications and Software,2020,37(6):224-229. [20] XIAO S L,QIANG Z X,LI D Y,et al.Pedestrian detection combining fine-grained feature and attention mechanism[J].Computer Applications and Software,2025,42(4):166-173,207. [21] QI Q R L G,SI Q T,WANG S G L.A Survey of Automatic Text Summarization Based on Deep Learning [J].Computer Engineering and Applications,2025,61(18):24-40. |
|
||