Leveraging Speculative Sampling and KV-Cache Optimizations Together for Generative AI using OpenVINO

Haim Barad, Ekaterina Aidova, Yury Gorbachev

Preprint: not peer reviewed. Results may change in later versions.

Abstract

Inference optimizations are critical for improving user experience and reducing infrastructure costs and power consumption. In this article, we illustrate a form of dynamic execution known as speculative sampling to reduce the overall latency of text generation and compare it with standard autoregressive sampling. This can be used together with model-based optimizations (e.g. quantization) to provide an optimized solution. Both sampling methods make use of KV caching. A Jupyter notebook and some sample executions are provided.

Abstract: arXiv descriptive metadata (CC0). Thank you to arXiv for use of its open access interoperability. This service was not reviewed or approved by, nor does it necessarily express or reflect the policies or opinions of, arXiv.

Record

Archive ID
arxiv:2311.04951
Published
Nov 8, 2023
Updated
Apr 9, 2024
arXiv
2311.04951
Categories
cs.LG, cs.AI, cs.PF
Provenance
arxiv