Streamlining the Collaborative Chain of Models into A Single Forward Pass in Generation-Based Tasks

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Lyu, Yuanjie, Zhang, Chao, Chen, Yuhao, Chen, Yong, Xu, Tong
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866917924708548608
author Lyu, Yuanjie
Zhang, Chao
Chen, Yuhao
Chen, Yong
Xu, Tong
author_facet Lyu, Yuanjie
Zhang, Chao
Chen, Yuhao
Chen, Yong
Xu, Tong
contents In Retrieval-Augmented Generation (RAG) and agent-based frameworks, the "Chain of Models" approach is widely used, where multiple specialized models work sequentially on distinct sub-tasks. This approach is effective but increases resource demands as each model must be deployed separately. Recent advancements attempt to address this by applying prompt tuning, which allows a shared base model to adapt to multiple tasks with minimal parameter changes. However, a key challenge remains: intermediate outputs, passed between models as plain text, require recomputation of hidden states (i.e., Key and Value (KV) states in Transformers) during inference. In this paper, we introduce FTHSS, a novel prompt-tuning method that enables models to share KV hidden states, eliminating redundant forward passes and reducing KV cache storage. By modifying input and attention masks during training, FTHSS allows models to effectively utilize KV hidden states from prior models in both single- and multi-round scenarios. Empirical results on four tasks show that FTHSS matches the performance of traditional model chains while improving inference efficiency.
format Preprint
id arxiv_https___arxiv_org_abs_2502_11083
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Streamlining the Collaborative Chain of Models into A Single Forward Pass in Generation-Based Tasks
Lyu, Yuanjie
Zhang, Chao
Chen, Yuhao
Chen, Yong
Xu, Tong
Computation and Language
In Retrieval-Augmented Generation (RAG) and agent-based frameworks, the "Chain of Models" approach is widely used, where multiple specialized models work sequentially on distinct sub-tasks. This approach is effective but increases resource demands as each model must be deployed separately. Recent advancements attempt to address this by applying prompt tuning, which allows a shared base model to adapt to multiple tasks with minimal parameter changes. However, a key challenge remains: intermediate outputs, passed between models as plain text, require recomputation of hidden states (i.e., Key and Value (KV) states in Transformers) during inference. In this paper, we introduce FTHSS, a novel prompt-tuning method that enables models to share KV hidden states, eliminating redundant forward passes and reducing KV cache storage. By modifying input and attention masks during training, FTHSS allows models to effectively utilize KV hidden states from prior models in both single- and multi-round scenarios. Empirical results on four tasks show that FTHSS matches the performance of traditional model chains while improving inference efficiency.
title Streamlining the Collaborative Chain of Models into A Single Forward Pass in Generation-Based Tasks
topic Computation and Language
url https://arxiv.org/abs/2502.11083