StreamingLLM Breakthrough: Handling Over 4 Million Tokens with 22.2x Inference Speedup

Massar Tanya Ming Yau Chong  Jan 09, 2024 16:12  UTC 08:12

2 Min Read

In the dynamic field of AI and large language models (LLMs), recent advancements have brought significant improvements in handling multi-round conversations. The challenge with LLMs like ChatGPT is maintaining generation quality during extended interactions, constrained by the input length and GPU memory limits. LLMs struggle with inputs longer than their training sequence and can collapse if the input exceeds the attention window, limited by GPU memory

The introduction of StreamingLLM by Xiao et al. published with title "EFFICIENT STREAMING LANGUAGE MODELS WITH ATTENTION SINKS" from MIT has been a breakthrough. This method allows streaming text inputs of over 4 million tokens in multi-round conversations without compromising on inference speed and generation quality, achieving a remarkable 22.2 times speedup compared to traditional methods. However, StreamingLLM, implemented in native PyTorch, needed further optimization for practical applications requiring low cost, low latency, and high throughput.

Addressing this need, the Colossal-AI team developed SwiftInfer, a TensorRT-based implementation of StreamingLLM. This implementation enhances the inference performance of large language models by an additional 46%, making it an efficient solution for multi-round conversations.

SwiftInfer's combination with TensorRT inference optimization in the SwiftInfer project maintains all advantages of the original StreamingLLM while boosting inference efficiency. Using TensorRT-LLM's API, models can be constructed similarly to PyTorch models. It's crucial to note that StreamingLLM doesn't increase the context length the model can access but ensures model generation with longer dialog text inputs.

Colossal-AI, a PyTorch-based AI system, has also been integral in this progress. It uses multi-dimensional parallelism, heterogeneous memory management, among other techniques, to reduce AI model training, fine-tuning, and inference costs. It has gained over 35,000 GitHub stars in just over a year. The team recently released the Colossal-LLaMA-2-13B model, a fine-tuned version of the Llama-2 model, showcasing superior performance despite lower costs.

The Colossal-AI cloud platform, aiming to integrate system optimization and low-cost computing resources, has launched AI cloud servers. This platform provides tools like Jupyter Notebook, SSH, port forwarding, and Grafana monitoring, along with Docker images containing the Colossal-AI code repository, simplifying the development of large AI models.

Image source: Shutterstock

Read More