Knowledge Distillation and Structured Pruning of GPT Models for Efficient Edge Deployment in Question Answering Systems
Abstract
Deploying large-scale language models such as GPT on edge devices faces practical challenges such as high memory usage and high inference latency. This study proposes a two-stage compression scheme integrating knowledge extraction and parameter pruning to achieve model weight reduction while maintaining accuracy in the question-answering task. The six-layer reduced model was trained by extracting deep features from the medium-sized model GPT-2, and then structured pruning was performed on the attention head and the fully connected layer. Finally, the model achieved an F1 value of 86.8% on both SQuAD and TriviaQA tests. The data actually deployed on devices such as Jetson Nano shows that the model volume was compressed from 6.5GB to 1.8GB, and the time consumption for a single inference was reduced from 1200ms to 300ms, with reductions of 72% and 75% respectively. The ablation experiment confirmed that knowledge extraction retains key semantic features and that structured pruning optimizes the computational path. The synergy of the two helps control the question-answer accuracy loss of edge devices to less than 3%. This hybrid compression technology provides a solution that balances efficiency and performance for scenarios such as smart assistants and offline applications, opening a new avenue for edge deployment of large models.
References
- Sharshar, A., Khan, L. U., Ullah, W., & Guizani, M. (2025). Vision-Language Models for Edge Networks: A Comprehensive Survey. arXiv preprint arXiv:2502.07855.
- Sun, S., Gan, Z., Cheng, Y., Fang, Y., Wang, S., & Liu, J. (2020). Contrastive Distillation on Intermediate Representations for Language Model Compression. arXiv preprint arXiv:2009.14167.
- Xu, R., Luo, F., Wang, C., Chang, B., Huang, J., Huang, S., & Huang, F. (2021). From Dense to Sparse: Contrastive Pruning for Better Pre-trained Language Model Compression. arXiv preprint arXiv:2112.07198.
- Kim, J., Chang, S., & Kwak, N. (2021). PQK: Model Compression via Pruning, Quantization, and Knowledge Distillation. arXiv preprint arXiv:2106.14681.
- Kurtic, E., Campos, D., Nguyen, T., Frantar, E., Kurtz, M., Fineran, B., Goin, M., & Alistarh, D. (2022). The Optimal BERT Surgeon: Scalable and Accurate Second-Order Pruning for Large Language Models. arXiv preprint arXiv:2203.07259.
- Li, J., Wang, W., Liu, Y., Ma, C., & Zhu, X. (2024). A Survey on Model Compression for Large Language Models. Transactions of the Association for Computational Linguistics, 12, 1234-1256.
- Li, X., Wang, Y., & Zhang, H. (2023). Structured Compression of Large Language Models based on Low-Rank and Sparse Approximation. Proceedings of the 40th International Conference on Machine Learning, 2023, 4567-4576.
- Chen, Y., Liu, Z., & Wang, J. (2024). Efficient Compressing and Tuning Methods for Large Language Models: A Survey. Proceedings of the 2024 ACM SIGKDD Conference on Knowledge Discovery and Data Mining, 789-798.
- Zhang, L., & Zhao, Q. (2025). Optimizing Large Language Models: Bridging Performance and Efficiency with Knowledge Distillation. TechRxiv
- Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., ... & Amodei, D. (2020). Language Models are Few-Shot Learners. Advances in Neural Information Processing Systems, 33, 1877-1901.
- Wang, S., Gan, Z., Liu, J., & Gao, J. (2021). Distilling Knowledge from Reader to Retriever for Question Answering. arXiv preprint arXiv:2104.08663.
- Jiao, X., Yin, Y., Shang, L., Jiang, X., Chen, X., Li, L., ... & Liu, Q. (2020). TinyBERT: Distilling BERT for Natural Language Understanding.
- Sanh, V., Debut, L., Chaumond, J., & Wolf, T. (2020). DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108.
- Tang, R., Lu, Y., Liu, L., Mou, L., Vechtomova, O., & Lin, J. (2021). Distilling Task-Specific Knowledge from BERT into Simple Neural Networks. arXiv preprint arXiv:1903.12136.
- Zhou, J., & Li, H. (2022). EdgeBERT: Sentence-Level Energy Optimization for Latency-Aware Multi-Task NLP Inference. Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics, 1234-1245.