Response Length Perception and Sequence Scheduling: An LLM-Empowered LLM Inference Pipeline

Large language models (LLMs) have revolutionized the field of AI, demonstrating unprecedented capacity across various tasks. However, the inference process for LLMs comes with significant computational costs. In this paper, we propose an efficient LLM inference pipeline that harnesses the power of LLMs. Our approach begins by tapping into the potential of LLMs to accurately perceive and predict the response length with minimal overhead. By leveraging this information, we introduce an efficient sequence scheduling technique that groups queries with similar response lengths into micro-batches. We evaluate our approach on real-world instruction datasets using the LLaMA-based model, and our results demonstrate an impressive 86% improvement in inference throughput without compromising effectiveness. Notably, our method is orthogonal to other inference acceleration techniques, making it a valuable addition to many existing toolkits (e.g., FlashAttention, Quantization) for LLM inference.

Paper

Similar papers

Peer review

Reviewer Nixu6/10 · confidence 4/52023-06-27

Summary

The authors propose a simple method to perceive the length of an LLM response by asking the LLM. Then, the authors propose to groups queries with similar response lengths into micro-batches, which are then allocated to different GPU nodes and processed in parallel . The authors show empirical gain in terms of throughput. This approach is also orthogonal to other inference acceleration approaches.

Strengths

1. The proposed method is simple and exact and does not sacrifice response quality while achieving speedup. 2. The authors show impressive speedup in terms of throughput. 3. The speed up the author achieve can be applied on top of other inference acceleration techniques.

Weaknesses

1. One fundamental weakness of the paper lies in the assumption that requests can be reordered, which may not hold in production. The author did not show any fairness metric which may help readers understand how their method affect each individual request in practice. 2. The author did not show any fine-grained ablation studies examining how often and how often the requests have been reordered and how it affects inference latency. I would happily raise my rating if the authors can present more thorough ablation studies.

Questions

I have listed my concerns above.

Rating

6: Weak Accept: Technically solid, moderate-to-high impact paper, with no major concerns with respect to evaluation, resources, reproducibility, ethical considerations.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

3 good

Contribution

3 good

Limitations

The authors adequately addressed the limitations and potential negative societal impact of their work.

Reviewer u5zm6/10 · confidence 3/52023-07-05

Summary

>**Rebuttal:** The provided details satisfy my concerns. I think this paper should be accepted after applying the agreed changes. >**TL;DR:** The paper presents a new technique to reduce the inference time of LLMs under intensive usage. This is an important problem that can reduce wasteful computations. However, the paper is missing some key comparisons and the experimental methodology is lacking justifications. Addressing my concerns and questions would improve my score. This paper proposes a new to reduce the inference time of LLMs under intensive usage. The technique save wasteful computations by predicting the response length and aggregating similar predicted lengths together. The paper presents an inference pipeline, which is composed of response length prediction, failure collection and recomputation (FCR), and variable batch size (VBS). Experimental results on real-world instruction datasets using the Vicuna-7B model demonstrated an 86% improvement in throughput without sacrificing performance quality. The datasets include the Instruction-in-Wild and Alpaca. The proposed technique is compared to previous works and outperforms them on both datasets.

Strengths

* **S.1.** The proposed technique can reduce inference time of LLMs and gain a 86% performance improvement. * **S.2.** The paper tackles an important problem of reducing the LLM inference time and wasteful computations. * **S.3.** The proposed technique outperforms previous compared works on two datasets. * **S.4.** Reproduction code is provided as part of the submission.

Weaknesses

* **W.1.** Th paper lacks comparison to existing LLM inference works such as [1][2]. * **W.2.** Some the key technique attributes are not well justified. For example, the target length prediction is four times the actual length. No experiments or ablations are provided to justify the "four". Another example is the FCR mechanism, which immediately stops the generation process when the maximum predicted length has been surpassed. There might cases where the generation process might only need a few more tokens to complete the task. * **W.3.** The proposed technique relies on very short inputs in order to be effective. This is rarely the case for chat-bot, which require support for multi-turn conversations and are given as the examples for LLM usage. Furthermore, the proposed technique relies on high LLm usage to create batches of similar predicted lengths. This high usage is typically found in chat-bots. [1] Yu, Gyeong-In, Joo Seong Jeong, Geon-Woo Kim, Soojeong Kim, and Byung-Gon Chun. "Orca: A distributed serving system for {Transformer-Based} generative models." In 16th USENIX Symposium on Operating Systems Design and Implementation (OSDI 22), pp. 521-538. 2022. [2] Pope, Reiner, Sholto Douglas, Aakanksha Chowdhery, Jacob Devlin, James Bradbury, Jonathan Heek, Kefan Xiao, Shivani Agrawal, and Jeff Dean. "Efficiently scaling transformer inference." Proceedings of Machine Learning and Systems 5 (2023).

Questions

* **Q.1.** The paper describes several LLM use cases such as ChatGPT, Bard, and Claude. These chat-bots require support for multi-turn conversations, which expands the conversation history. How would the proposed technique work in such cases?

Rating

6: Weak Accept: Technically solid, moderate-to-high impact paper, with no major concerns with respect to evaluation, resources, reproducibility, ethical considerations.

Confidence

3: You are fairly confident in your assessment. It is possible that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.

Soundness

3 good

Presentation

2 fair

Contribution

3 good

Limitations

The limitations of the proposed technique are described throughout the paper. The limitations include overhead of length prediction and poor compatibility with long inputs. However, the latency effects of waiting for the aggregation of batches is not discussed or evaluated.

Reviewer WTWP6/10 · confidence 5/52023-07-06

Summary

This paper comes up with the technique of using LLM to help LLMs’ inference to be more efficient. It predicts the queries’ response length, and group the those with similar response length into the same micro-batch, so that the inference efficiency can be effectively improved.

Strengths

In the experiments, the proposed method gains significant improvement in terms of inference speed. It is reasonable that the token redundancy leads to inefficient inference in batch. It is effective and easy to implement for existing LLMs.

Weaknesses

The metric of horizontal axis in Fig. 2 (a) is missing.

Questions

Imaging a scenario that a user’s query has extreme long response length predicted, would this user wait long time for the response? How about to use a small model to learn to predict the response length?

Rating

6: Weak Accept: Technically solid, moderate-to-high impact paper, with no major concerns with respect to evaluation, resources, reproducibility, ethical considerations.

Confidence

5: You are absolutely certain about your assessment. You are very familiar with the related work and checked the math/other details carefully.

Soundness

3 good

Presentation

3 good

Contribution

3 good

Limitations

None.

Reviewer KzBJ6/10 · confidence 4/52023-07-21

Summary

The authors propose to improve the throughput of the LLM inference systems by correctly predicting the length of the response. Method summary: 1. Predict the length of the response (Binning length for prediction modules to learn better) 2. Use the prediction to batch the queries with similar prediction to improve throughput (use variable batch size to leverage GPUs while managing memory requirements) 3. Failure collection module to cut-off mispredicted batch evaluation. To ensure that this module is not triggered too often, it is advisable to over-estimate length of the prediction

Strengths

1. The paper tackles an important problem, provides a simple recipe for the solution and works reasonably well. 2. The evaluation is to the point. Answers all the natural questions that might arise.

Weaknesses

The writing can be better. Some details in the questions section.

Questions

Comments: 1. For table two to make sense, it would be useful to have some data statistics like distribution of response lengths on those 175 instructions. 2. Table 3 caption can be improved a lot. It was not clear what i am looking at first. The table talks about vicuna model inference and various prediction methods for that. Elaborate on the caption. Questions: 1. In table 4. why is the vanilla avg length significantly different from other lengths including ground-truth predictor?

Rating

6: Weak Accept: Technically solid, moderate-to-high impact paper, with no major concerns with respect to evaluation, resources, reproducibility, ethical considerations.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

3 good

Contribution

2 fair

Limitations

Yes

Reviewer KzBJ2023-08-12

Response to the authors

Thank you for the clarifications. Please make the discussed changes to the manuscript. Hope it gets in!

Authorsrebuttal2023-08-14

Thank you for your response. We will incorporate the changes.

Reviewer Nixu2023-08-12

Thank you for the additional experiments. The author addressed my concerns and I am raising my rating. Please include the additional results in the final manuscript.

Authorsrebuttal2023-08-14

Thank you for your response. We will incorporate the additional results.

Reviewer u5zm2023-08-13

Response to Rebuttal

Thank you for the detailed answers and results. This solves some of my concerns. However, I'm not convinced regarding W.3 and partially W.1. * **W.1.** I'm not fully convinced that there is not a single existing algorithm that can be compared to. Adding a detailed explanation including orthogonal compatible approaches should be sufficient. * **W.3.** This is my main open concern. The provided Fig. 4 is computed on instruction data. The input of instruction data is usually short, and the generated outputs are usually longer that the input. This is typical for instruction based datasets, but not for real world applications. In cases where the inputs are long, the Response Length Prediction time would take a large portion of the computation time. For example, let's say the task is to give a score to a very long passages. In this example, the inputs are very long and the outputs are short (a single integer). The Response Length Prediction model would take just as long as the actual inference and thus would almost increase the total inference time by two times. This is of course an edge case, but it is an actual limitation of the paper which is not explored. Addressing my concerns would improve my score.

Authorsrebuttal2023-08-14

Thank you for your response. Let's first discuss about your main concern **W.3**. - We discussed the reviewer's concern in the "Limitation and Discussion" section (line 288). While long input contexts have overheads, they don't predominantly appear in real-world applications. As you mentioned, the lengthy input is an edge case. For such cases, we recommend using traditional pipelines for lengthy inputs and our method for others. Specifically, since the input length is known, we can simply fallback to naive inference pipeline by setting a threshold. For instance, when the input length is longer than 512 tokens, we can always adapt naive inference instead. This would achieve a better trade-off and combine the merits of the both approachs. A future direction might merge input-length scheduling with our output length strategies for optimized inference. - Table 2 highlights that real-world chatbots like GPT-4 and Claude can perceive response length. We can thus employ the Perception in Advance (PiA) method (introduced line 95) as detailed in Appendix Section C. In this case, the length prediction and response generation model is the same one and thus the kv-cache can be reused. Using PiA's kv-cache for output creation avoids additional computational steps for very long inputs. However, without public access to these models' weights, we can't provide experiments on them. - We've covered both strategies in our paper and plan to streamline this discussion in our revisions. We argue that these limitations don't detract from our contribution, as applications with lengthy input contexts can benefit from the mentioned solutions. For your concern **W.1**, we claim that our method is orthogonal to other methods. Following your advice, we will add a detailed explanation in "Efficient LLM Inference" subsection. We discuss other inference acceleration methods by their categories according to [18]: 1. Optimization strategies such as pruning and quantization [8, 11, 35]: These reduce FLOPs needed for a forward pass. Our method does not affect this and thus is compatible. 2. Mapping and scheduling of operations [5,7]: Our approach retains the transformer's operation type and sequence, allowing existing strategies to apply. 3. Optimizing batch quantization: [10] prioritizes input length, while we focus on output length. [3] focuses in few-shot settings, a minimal usage context. As a result, most of them optimizes the inference speed in a different dimension and we think comparing our method's speedup with them bring no more insights into our paper. Combining these methods into a comprehensive system is deferred for future work, as it surpasses this paper's scope. (number reference is the same as the main text)

Reviewer u5zm2023-08-14

Response to Rebuttal #2

Thank you for the detailed explanations. This partially solves my concerns regarding W.1. and W.3. * **W.1.** Although it is not ideal to not have a comparison, under the circumstances, I believe that adding the additional details and explanations should be sufficient. * **W.3.** The Perception in Advance (PiA) is a great solution for cases with long inputs. However, PiA has a negative impact on the quality of the response. This creates an unexplored tradeoff between speed and quality. Adding more details or results on this tradeoff should eb sufficient.

Authorsrebuttal2023-08-15

Thank you for your response. We acknowledge using PiA with API calls affects the quality of response. However, if applied correctly, the PiA can be integrated without affecting the quality of the response, requiring only minimal adjustments. To understand the PiA process, consider the following format: > **[Input] *[PiA Prompt]* *[PiA Response]* [Response]** Here, the PiA prompt might be something like "Please estimate the length of your prediction," and the subsequent PiA Response could be "The estimated response length is X". The primary overhead of this method involves the generation of the aforementioned tokens, typically no more than 30 in number. It's vital to note that both the Input and the Response can be detached from the PiA Prompt and its Response. The reason is that the Input precedes PiA parts, and the Response is solely reliant on the Input. To ensure the quality of the response remains unchanged, we can use the following two methods: 1. After the generation of the PiA response, we can exclude both the PiA Prompt and PiA Response embeddings. The generation of the primary Response would then only use the kv-cache of the input. 2. Alternatively, the Response can be generated with both the PiA Prompt and PiA Response masked. Both these strategies ensure the preservation of generation quality. In our experiments with models like ChatGPT and other leading-edge Large Language Models (LLMs), merely invoking the API didn't allow for the bypassing of the PiA prompt's influence. However, this implementation is quite simple for the companies. This observation also led us to introduce the Perception Only (PO) approach, wherein we compared the mean predicted length against the original prediction length as an estimation of performance of PiA method in practice. We appreciate the reviewer's insight which has added clarity to this aspect. The discussions will be added in Section 3.1 in our revision.

Reviewer u5zm2023-08-15

Response to Rebuttal #3

Thank you for the detailed answers. The provided details satisfy my concerns. I will update my review accordingly.

Program Chairsdecision2023-09-21

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC