Code large model robustness enhancement method based on context processing and post-training
By constructing adversarial perturbation samples and conducting targeted training based on context processing and post-training robustness enhancement methods, the problem of insufficient robustness of large language models in code generation tasks is solved, and the stability and consistency of the model in the face of input perturbations are improved. It is applicable to a variety of programming languages and model types.
Patent Information
- Application Number
- CN202610370026.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-25
- Publication Date
- 2026-06-09
AI Technical Summary
Large language models are not robust enough in code generation tasks, especially in terms of stability and anti-interference ability when faced with input perturbations, and cannot guarantee the correctness and consistency of the output.
We employ a robustness enhancement method based on context processing and post-training. We construct adversarial perturbation samples through equivalent semantic transformation to fine-tune the target large language model. We also combine greedy search and simulated annealing algorithms to generate high-quality adversarial perturbation samples and use supervised fine-tuning and direct preference optimization reinforcement learning for training to enhance the model's stability and generalization ability.
It significantly improves the robustness and reliability of large language models in code generation tasks. Through systematic evaluation and training methods, it enhances the stability and consistency of the model when faced with input perturbations, and is applicable to various programming languages and model types.