Downloads: 12
United States | Computer Science and Information Technology | Volume 14 Issue 4, April 2025 | Pages: 857 - 866
Optimizing Transformer Models for Low-Latency Inference: Techniques, Architectures, and Code Implementations
Abstract: In recent years, Transformer-based models such as BERT, GPT, and Vision Transformers have revolutionized artificial intelligence, advancing fields like natural language processing, computer vision, and other related domains. However, their high computational complexity poses significant challenges for real-time applications, particularly when deployed on resource-constrained hardware. Despite these challenges, extensive research has been conducted to optimize performance, accuracy, and efficiency to meet the growing demand for low-latency inference. This paper reviews the current state of optimization strategies aimed at alleviating the costly inference time of such models, with minimal loss of fidelity. Key techniques discussed include model pruning, where redundant parameters are systematically removed, and quantization, which reduces model weights and activations to lower-precision formats such as INT8, thereby decreasing memory usage and computational overhead. Additionally, alternative attention architectures like Linformer and Longformer are examined for their ability to eliminate the quadratic complexity of standard self-attention mechanisms, enabling faster data processing in large-scale applications. Hardware acceleration leveraging GPUs, TPUs, and FPGA-based platforms is also explored to improve execution efficiency through parallelism and optimized memory access. The paper further examines deployment strategies and software frameworks designed to enhance inference performance. Tools such as TensorRT, ONNX Runtime, and Hugging Face Optimum are highlighted for their ability to enable seamless model conversion and acceleration in production environments. Extensive benchmarking is conducted to evaluate trade-offs between latency, throughput, and accuracy, demonstrating that these optimizations can reduce inference time by up to 60% without compromising predictive performance compared to the original scikit-learn model. The insights provided herein are valuable for software engineers, AI practitioners, and researchers interested in deploying high-performance Transformer models for use in conversational AI, edge computing, and real-time systems. By integrating structured optimization techniques, organizations can enhance model efficiency, reduce operational costs, and improve responsiveness in mission-critical applications. The paper also suggests future research directions, including adaptive and hybrid optimization methods that dynamically adjust model parameters in response to time constraints and uncertain initial conditions.
Keywords: Transformer Models, Low-Latency Inference, Model Optimization, Quantization, Model Pruning, Efficient Attention Mechanisms, ONNX Runtime
How to Cite?: Apoorva Kasoju, Tejavardhana Chary Vishwakarma, "Optimizing Transformer Models for Low-Latency Inference: Techniques, Architectures, and Code Implementations", Volume 14 Issue 4, April 2025, International Journal of Science and Research (IJSR), Pages: 857-866, https://www.ijsr.net/getabstract.php?paperid=SR25409073105, DOI: https://dx.doi.org/10.21275/SR25409073105