Intelligent Question-Answering and Knowledge Transfer in Computer Programming Courses Based on ChatGPT and Knowledge Distillation
Abstract
Current intelligent question-answering and knowledge transfer in programming courses suffer from low efficiency, insufficient model lightweighting, and semantic consistency deviations, limiting the practical deployment of large language models in specialized engineering education. As semantic reasoning and hierarchical information representation become increasingly important for intelligent information processing and knowledge interaction in advanced engineering systems, this paper proposes a ChatGPT semantic transfer optimization method based on hierarchical knowledge distillation. By constructing a multi-level semantic knowledge graph covering programming concepts, syntax, and task logic, the proposed framework performs hierarchical semantic modeling and introduces a multi-layer semantic alignment loss to achieve precise knowledge transfer. Parameter pruning constraints and a dynamic temperature adjustment strategy are further incorporated to improve model lightweighting and training stability, while a semantic consistency judgment mechanism supports intelligent question-answering in programming teaching scenarios. Experimental results demonstrate significant reductions in concept-, syntax-, and task-level distillation losses, together with substantial parameter compression and inference acceleration while maintaining high semantic consistency and answer accuracy. The convergence of semantic alignment corresponds to measurable improvements in practical question-answering performance. The proposed approach provides an effective technical pathway for intelligent programming education and offers methodological references for hierarchical knowledge transfer and semantic information processing in advanced engineering and electromagnetic information systems.