SentenceVAE: Faster, Longer and More Accurate Inference with Next-sentence Prediction for Large Language Models

要約

現在の大規模言語モデル(LLM)は、推論において主に次トークン予測手法に依存しており、処理速度を著しく低下させている。本論文では、LLMの推論効率を向上させることを目的として、次文予測と呼ばれる新しい推論手法を紹介する。文変分オートエンコーダ(Sentence Variational Autoencoder: SentenceVAE)は、文エンコーダと文デコーダからなる小さなモデルである。エンコーダは文中の情報を効率的に単一のトークンに凝縮し、デコーダはこの圧縮されたデータを元の文の形に再構成する。SentenceVAEをLLMの入力層と出力層に統合することで、文単位の推論アプローチを採用した文レベルLLM(SLLM)を開発し、推論速度を著しく高速化する。また、SentenceVAEはテキストを文に分割することで元の意味内容の完全性を維持し、推論速度を向上させながら精度を向上させる。公開されているLLMと比較して、SLLMは同等の文脈の長さに対してより少ないトークンを処理するため、自己注意計算のためのメモリ需要が大幅に減少し、より長い文脈の取り扱いが容易になる。我々の実験結果から、この手法はトークンバイトークンの手法と比較して、推論速度を204~365%高速化し、プレプレキシティ(PPL)を元の指標の46~75%に低減し、同じ文脈長でメモリオーバヘッドを86~91%低減できることが明らかになった。さらに、このアプローチの利点は、モデルパラメータが増加するにつれてさらに顕著になる。

要約(オリジナル)

Contemporary large language models (LLMs) primarily rely on 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, aimed at enhancing the inference efficiency of LLMs. We present Sentence Variational Autoencoder (SentenceVAE), a tiny model consisting of a Sentence Encoder and a Sentence Decoder. The encoder effectively condenses the information within a sentence into a singular token, while the decoder reconstructs this compressed data back into its original sentential form. By integrating SentenceVAE into the input and output layers of LLMs, we develop Sentence-level LLMs (SLLMs) that employ a sentence-by-sentence inference approach, markedly accelerating inference speeds. SentenceVAE also maintains the integrity of the original semantic content by segmenting the text into sentences, thereby improving accuracy while boosting inference speeds. Compared to published LLMs, SLLMs process fewer tokens over equivalent context lengths, significantly reducing memory demands for self-attention computations and facilitating the handling of longer contexts. Our experimental findings reveal that this method can accelerate inference speeds by 204~365%, reduce perplexity (PPL) to 46~75% of its original metric, and decrease memory overhead by 86~91% for the same context length, compared to the token-by-token method. Moreover, the benefits of this approach become even more pronounced as model parameters increase.

arxiv情報

著者 Hongjun An,Yifan Chen,Xiaozhen Qiao,Zhe Sun,Xuelong Li
発行日 2024-08-02 08:27:08+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, DeepL

カテゴリー: cs.AI, cs.CL パーマリンク