arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2408.00655cs.AIcs.CL
收藏

SentenceVAE:以更快速度、更高精度和更长上下文赋能大语言模型的下一句预测

SentenceVAE: Enable Next-sentence Prediction for Large Language Models with Faster Speed, Higher Accuracy and Longer Context

Northwestern Polytechnical University(西北工业大学);China Telecom(中国电信)

Hongjun An, Yifan Chen, Zhe Sun, Xuelong Li

AI总结:

针对大语言模型下一词元推理速度慢的问题,提出集成句子变分自编码器的句子级大语言模型,通过逐句推理实现速度提升、精度提高与内存降低,支持更长上下文处理。

摘要:

当前大语言模型(LLMs)主要采用下一词元预测方法进行推理,这严重制约了其处理速度。本文提出一种名为下一句预测的新型推理方法,旨在提升大语言模型的推理效率。我们提出了句子变分自编码器(SentenceVAE),它包含一个句子编码器,可将一个句子中的多个词元压缩为单个词元,以及一个句子解码器用于重建该句子。通过将SentenceVAE集成到大语言模型的输入和输出层,我们开发了采用逐句推理方法的句子级大语言模型(SLLMs)。此外,SLLMs的SentenceVAE模块可通过将上下文切分为句子来保留原始语义内容的完整性,从而在提升推理速度的同时提高精度。而且,与以往的LLMs相比,SLLMs在相同上下文长度下处理的词元更少,显著降低了自注意力计算的内存需求,便于处理更长的上下文。在Wanjuan数据集上开展的大量实验表明,与以往的逐词元方法相比,所提方法可将推理速度提升204~365%,将困惑度(PPL)降至原指标的46~75%,并在相同上下文长度下减少86~91%的内存开销。

英文摘要:

Current large language models (LLMs) primarily utilize next-token prediction method for inference, which significantly impedes their processing speed. In this paper, we introduce a novel inference methodology termed next-sentence prediction, aiming at enhancing the inference efficiency of LLMs. We present Sentence Variational Autoencoder (SentenceVAE), which includes a Sentence Encoder to compress multiple tokens in a sentence into a single token, and a Sentence Decoder to reconstruct it. By integrating SentenceVAE into the input and output layers of LLMs, we develop Sentence-level LLMs (SLLMs) that employ a sentence-by-sentence inference method. In addition, the SentenceVAE module of SLLMs can maintain the integrity of the original semantic content by segmenting the context into sentences, thereby improving accuracy while boosting inference speed. Moreover, compared to previous LLMs, SLLMs process fewer tokens over equivalent context length, significantly reducing memory demands for self-attention computation and facilitating the handling of longer context. Extensive experiments on Wanjuan dataset have revealed that the proposed method can accelerate inference speed by 204~365%, reduce perplexity (PPL) to 46~75% of its original metric, and decrease memory overhead by 86~91% for the equivalent context length, compared to previous token-by-token methods.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑