Large language model reasoning optimization method, system, device and storage medium
By clustering and quantizing the data cached in KV during the inference process of large language models, the problem of excessive demand for KV cache storage is solved, which significantly reduces the memory usage and improves the inference efficiency and resource utilization.
Patent Information
- Application Number
- CN202411881594.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-12-19
AI Technical Summary
During the inference process of large language model, the storage demand for KV caches has increased linearly, resulting in a significant increase in video memory usage, becoming the main bottleneck of the system, limiting the model's ability to reason on devices with limited resources.
By determining whether the KV cache exceeds the preset threshold, if it exceeds, the data in the KV cache is clustered, several cluster categories are obtained, and the data is rearranged according to the cluster category, the attention score of the cluster center is calculated, and the cluster center is replaced is quantified and cluster center is replaced, reducing the storage demand of the KV cache.
It significantly reduces the video memory usage during the inference process, improves the inference efficiency and system resource utilization.