只在预填充阶段使用适配器,显著提升个性化大模型推理吞吐量。
PreFT: Prefill-only finetuning for efficient inference
- 仅在预填充阶段应用适配器,生成阶段直接丢弃,降低计算开销。
- 在Llama 3.1 70B上服务512个适配器时,吞吐量提升1.9倍。
- 适合需要高并发个性化的部署场景,兼顾性能与效率。
大型语言模型可通过参数高效微调(PEFT)实现大规模个性化,但服务用户专属的PEFT会降低吞吐量,即使使用专用内核和内存管理技术亦然。这是因为在理论上和实践中,预填充(批量处理大量标记)与解码(自回归逐个生成标记)存在性能不匹配:后者在多适配器场景下吞吐量显著下降。因此,我们提出仅对预填充阶段应用适配器、后续立即丢弃的PreFT(Prefill-only Finetuning),以优化服务吞吐量而非参数量。我们基于vLLM推理引擎实现了两种预填充仅微调方法(LoRA与ReFT)。实验表明,在服务512个适配器时,多用户PreFT的吞吐量比传统PEFT高出1.9倍。在多种监督微调与强化学习任务中对比显示,虽预填充仅微调的评估损失略高于标准PEFT,但通过增加秩可几乎无损吞吐量地补偿性能;在强化学习任务中,其表现持续接近标准PEFT。该工作验证了预填充仅微调在个性化服务中具备更优的精度-吞吐权衡。
原文摘要 · Abstract (English)
Large language models can now be personalised efficiently at scale using parameter efficient finetuning methods (PEFTs), but serving user-specific PEFTs harms throughput, even with specialised kernels and memory management techniques. This is because, theoretically and empirically, a mismatch exists between prefill (processing a large number of tokens at once) and decode (generating a single token autoregressively): the latter has far lower throughput when serving multiple adapters. Rather than optimising performance relative to parameter count, for efficient multi-adapter serving, we instead ought to optimise performance relative to serving throughput. We therefore propose PreFT (Prefill-only Finetuning), wherein we only apply the adapter to prefill tokens and discard it afterwards. PreFT significantly increases throughput with minimal effect on performance. We develop and release an efficient implementation of two prefill-only PEFTs, LoRA and ReFT, on the vLLM inference engine. We first show that serving multi-user PreFTs is more efficient than traditional PEFTs ($1.9\times$ the throughput when serving $512$ adapters on Llama 3.1 70B). Then, we compare the performance of prefill-only vs. all-token adapters on a variety of supervised finetuning and reinforcement learning tasks with LMs at varying scales. On SFT, we observe that the evaluation loss of PreFTs is higher than PEFTs, but can be compensated by increasing rank with nearly no reduction in throughput. On RL, we consistently find that PreFTs approach parity with standard PEFTs. Together, this work validates prefill-only adaptation of LLMs as a more favourable accuracy-throughput tradeoff than existing PEFTs for personalised serving.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。