Learning Harmonized Representations for Speculative Sampling

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Zhang, Lefan, Wang, Xiaodan, Huang, Yanhua, Xu, Ruiwen
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866916630050635776
author Zhang, Lefan
Wang, Xiaodan
Huang, Yanhua
Xu, Ruiwen
author_facet Zhang, Lefan
Wang, Xiaodan
Huang, Yanhua
Xu, Ruiwen
contents Speculative sampling is a promising approach to accelerate the decoding stage for Large Language Models (LLMs). Recent advancements that leverage target LLM's contextual information, such as hidden states and KV cache, have shown significant practical improvements. However, these approaches suffer from inconsistent context between training and decoding. We also observe another discrepancy between the training and decoding objectives in existing speculative sampling methods. In this work, we propose a solution named HArmonized Speculative Sampling (HASS) that learns harmonized representations to address these issues. HASS accelerates the decoding stage without adding inference overhead through harmonized objective distillation and harmonized context alignment. Experiments on four LLaMA models demonstrate that HASS achieves 2.81x-4.05x wall-clock time speedup ratio averaging across three datasets, surpassing EAGLE-2 by 8%-20%. The code is available at https://github.com/HArmonizedSS/HASS.
format Preprint
id arxiv_https___arxiv_org_abs_2408_15766
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Learning Harmonized Representations for Speculative Sampling
Zhang, Lefan
Wang, Xiaodan
Huang, Yanhua
Xu, Ruiwen
Machine Learning
Computation and Language
Speculative sampling is a promising approach to accelerate the decoding stage for Large Language Models (LLMs). Recent advancements that leverage target LLM's contextual information, such as hidden states and KV cache, have shown significant practical improvements. However, these approaches suffer from inconsistent context between training and decoding. We also observe another discrepancy between the training and decoding objectives in existing speculative sampling methods. In this work, we propose a solution named HArmonized Speculative Sampling (HASS) that learns harmonized representations to address these issues. HASS accelerates the decoding stage without adding inference overhead through harmonized objective distillation and harmonized context alignment. Experiments on four LLaMA models demonstrate that HASS achieves 2.81x-4.05x wall-clock time speedup ratio averaging across three datasets, surpassing EAGLE-2 by 8%-20%. The code is available at https://github.com/HArmonizedSS/HASS.
title Learning Harmonized Representations for Speculative Sampling
topic Machine Learning
Computation and Language
url https://arxiv.org/abs/2408.15766