LRAgent: Efficient KV Cache Sharing for Multi-LoRA LLM Agents Hyesung Jeon, Hyeongju Ha, Jae-Joon Kim Abstract Role specialization in multi-LLM agent systems is often realized via multi-LoRA, where agents share a pretrained backbone and differ only through lightweight adapters. Despite sharing base model weights, each agent independently builds and stores its own KV cache for the same long, tool-augmented trajectories, incurring substantial memory and compute overhead. Existing KV cache sharing methods largely overlook this multi-LoRA setting. We observe that, across agents, cache differences are dominated by adapter outputs, while activations from the shared pretrained backbone remain highly similar. Based on this observation, we propose LRAgent, a KV cache sharing framework for multi-LoRA agents that decomposes the cache into a shared base component from the pretrained weights and an adapter-dependent component from LoRA weights. LRAgent reduces memory overhead by sharing the base component and storing the adapter component in its inherent low-rank form, and further reduces compute overhead, enabled by shared- A A multi-LoRA architectures, by also sharing the low-rank cache and avoiding redundant computations for contexts already processed by other agents. To efficiently reconstruct adapter contributions at runtime, we introduce Flash-LoRA-Attention, a kernel that reorders attention computation to avoid materializing the low-rank cache to full dimension. LRAgent achieves throughput and time-to-first-token latency close to fully shared caching, while preserving accuracy near the non-shared caching baseline across agentic question-answering benchmarks. Code available at https://github.com/hjeon2k/LRAgent . 1 Introduction Recently, LLMs have been widely adopted in agent systems due to their long-context understanding ability ( 7 ; 12 ; 35 ) , reasoning ability ( 31 ; 40 ; 25 ) , and external tool interaction capabilities ( 41 ; 23 ; 21 ) . In particular, multi-LLM agent systems have gained increasing attention for their ability to assign specialized roles to multiple agents that collaboratively decompose and solve complex tasks ( 26 ; 33 ; 22 ; 45 ) . These agents retrieve information from external tools, augment it with generated outputs, and pass the accumulated context, referred to as trajectories, to other agents for subsequent steps. To improve accuracy, a common approach is to fine-tune a pretrained model separately for each agent role. These fine-tuned models are typically trained on pre-generated trajectories that reflect role-specific behavior and tool usage patterns ( 24 ; 2 ; 14 ; 1 ; 8 ) . Parameter-efficient fine-tuning (PEFT) methods, such as low-rank adaptation (LoRA) ( 11 ) , further enhance scalability by reducing the number of trainable parameters from the full model to a pair of low-rank matrices. As a result, multi-LoRA architectures enable agents to share the large pretrained backbone during inference while retraining lightweight, role-specific adapters ( 30 ; 34 ) . This design has proven effective in practice, consistently outperforming single-model agents and non-fine-tuned baselines in agentic tasks ( 20 ; 43 ; 15 ; 13 ) . Due to the long trajectories in LLM agent systems, KV cache overhead and compute overhead become more severe in multi-agent systems than in single-agent settings, because each agent maintains its own KV cache and redundant prefills occur even though a large portion of the context is shared. This redundancy increases both memory usage and inference latency. To mitigate the memory issue, recent work has explored KV cache sharing across agents. However, existing approaches either require architectural modifications and additional training for cache fusion ( 32 ; 9 ) , focus mainly on handling positional misalignment caused by agent-specific prefixes ( 36 ; 19 ; 42 ) , or rely on selective recomputation of certain tokens or layers ( 39 ; 16 ) . Furthermore, these works focus primarily on memory reduction but still incur redundant computation to build a hidden state for a context that has already been processed by other agents. Importantly, KV cache sharing schemes that explicitly exploit the multi-LoRA architecture remain largely unexplored. In this work, we make a key observation that, for the same context, cache discrepancies across agents are dominated by task-specific LoRA-induced outputs, while activations produced by the shared pretrained backbone remain highly similar. Motivated by this observation, we propose LRAgent , a KV cache sharing framework tailored to multi-LoRA agent systems. We decompose the cache into two parts: a shared component computed from the pretrained weights, which we call the base cache, and an agent-dependent component induced by the LoRA weights, which we call the adapter outputs. The next key property we exploit is that the adapter output naturally admits a low-rank representation. Specifically, we store the intermediate activations produced right after the LoRA down-projection, which have a small rank dimension. We refer to these activations as the LR cache. At runtime, we reconstruct the full-dimension adapter contribution from LR cache by multiplying it with the LoRA up-projection matrix only when needed. As a result, we compress multiple KV caches into a single shared base cache with lightweight LR caches. Based on this concept, we introduce two cache sharing schemes. BaseShared shares the base cache across all agents while maintaining a separate LR cache per agent, substantially reducing KV cache memory. Furthermore, motivated by recent multi-LoRA variants that share the down-projection matrix across tasks ( 27 ; 37 ) , we extend our idea to BaseLRShared , which also shares the LR cache as well as the base cache by aligning agents to use a common down-projection. This extension further reduces both memory usage and the amount of computation for previously seen contexts. To minimize the runtime overhead of reconstructing adapter contribution using LR cache, we design Flash-LoRA-Attention, which reorders attention computation to avoid materializing low-rank caches to full dimension and implements this strategy efficiently on top of FlashAttention ( 4 ; 5 ) . Overall, our approach enables KV cache sharing tailored to the multi-LoRA architecture, achieving memory and inference efficiency close to fully shared KV caching while preserving accuracy near the non-shared KV baseline. 2 Background 2.1 Multi-LoRA Architecture LoRA LoRA ( 11 ) is a PEFT method that adapts model weights by adding a pair of low-rank matrices to the frozen pretrained base weights. Formally, LoRA parameterizes the weight update as: W=W_{0}+\Delta W,\;\;\Delta W=AB, (1) where W_{0}\in\mathbb{R}^{d_{\mathrm{in}}\times d_{\mathrm{out}}} is the pretrained base weight, A\in\mathbb{R}^{d_{\mathrm{in}}\times r} is the down-projection matrix, and B\in\mathbb{R}^{r\times d_{\mathrm{out}}} is the up-projection matrix, with rank r\ll\min(d_{\mathrm{in}},d_{\mathrm{out}}) . Since only A and B are optimized instead of W_{0} , it significantly reduces the number of trainable parameters, leading to lower memory usage and computation compared to full fine-tuning. In particular, applying LoRA to the query and value projections yields the best accuracy for a given number of parameters and is therefore widely used in practice. Unless otherwise stated, we apply LoRA to the query and value projections in all experiments. Multi-LoRA A typical multi-LoRA system augments a pretrained base weight with multiple task-specific low-rank weights ( 34 ) . For each task index i\in\{0,1,\dots,N-1\} , where N is the number of tasks, and given LoRA weights A_{i}\in\mathbb{R}^{d_{\mathrm{in}}\times r} and B_{i}\in\mathbb{R}^{r\times d_{\mathrm{out}}} , the task-specific weight used for inference is: W_{i}=W_{0}+\Delta W_{i},\;\;\Delta W_{i}=A_{i}B_{i}. (2) Given an input activation tensor for task i , X_{i}\in\mathbb{R}^{l\times d_{\mathrm{in}}} , with sequence length l , the output Y_{i}\in\mathbb{R}^{l\times d_{\mathrm{out}}} and the adapter output \Delta Y_{i} are computed as: \begin{gathered}Y_{i}=X_{i}W_{i}=X_{i}W_{0}+(X_{i}A_{i})B_{i},\\ \Delta Y_{i}=X_{i}\Delta W_{i}=(X_{i}A_{i})B_{i},\end{gathered} (3) where X_{i}A_{i}\in\mathbb{R}^{l\times r} is the intermediate activation produced by the down-projection. Multi-LoRA with Shared- A Recent works report that task-specific differences in multi-LoRA systems are driven primarily by the up-projection matrices B_{i} , while the down-projection matrices A_{i} encode highly similar intrinsic information across tasks and datasets ( 27 ; 37 ) . Building on this observation, sharing a down-projection matrix A can improve accuracy compared to conventional multi-LoRA systems, since A is trained to be more generalizable across tasks. For example, HydraLoRA ( 27 ) introduces a trainable router that produces token-wise mixture weights over multiple up-projections for subtasks within a dataset. In our setting, agent roles are predefined and do not require sequence-dependent routing. We therefore adopt the shared- A design and simplify the router to a static, sequence-wise assignment. This yields the same overall architecture as conventional multi-LoRA, except that the down-projections share weights, and we also find that it improves accuracy. Based on this, we design cache-sharing strategies that support both standard multi-LoRA and the shared- A variant, with the latter further leveraging the efficiency benefits of our approach. Overall, our method reduces memory usage and latency while preserving each agent’s role-specific behavior. 2.2 Multi-LLM Agent KV Cache Sharing Multi-LLM Agent Multi-LLM agent systems can be implemented either with a single model that plays different roles via role-specific system prompts, which can be viewed as a form of in-context learning, or with multiple models, often by fine-tuning the same backbone model for different roles ( 26 ; 33 ; 24 ; 14 ; 8 ) . These systems commonly use three agent roles: a planning agent for reasoning, an action agent for tool use, and a reflection agent for revising the answer. Methods that incorporate fine-tuning for role specialization often synthesize agent-trajectory datasets using instruction-following models ( 29 ; 18 ; 6 ) , and then fine-tune with PEFT methods such as LoRA. These approaches have been shown to outperform both single-model agents and non-fine-tuned baselines ( 20 ; 43 ; 15 ) , leading to broad adoption in practice. In this work, we follow AutoAct ( 20 ) and fine-tune LoRA adapters for the plan, action, and reflection agents using the provided agent trajectory dataset. KV Cache Sharing Meanwhile, due to long trajectories from multi-step reasoning and multiple retrieval of large contexts from external tools, memory and compute overhead becomes much more pronounced in multi-agent settings than in single-agent scenarios. This is because each agent maintains its own KV cache even though much of the context is shared. Moreover, the same context is processed independently by multiple agents, leading to substantial computation. Together, these effects introduce memory and compute redundancy, increasing memory usage and latency. To mitigate the memory issue, recent works have explored KV cache sharing for context that is shared across agents. Most approaches either introduce a new model architecture that necessitates additional training to enable cache sharing, or handle positional misalignment so that precomputed KV caches for overlapping context chunks can be reused within a single model. ICaRus ( 32 ) proposes a decoder architecture that fine-tunes only the query projections for downstream tasks, enabling agents to share an encoder-generated cache and reconstruct task-specific additive caches at runtime. Cache2Cache ( 9 ) adds a trainable linear layer that project and fuse a source model’s KV cache into a target model. KVLink ( 36 ) , KVFlow ( 19 ) , and KVComm ( 42 ) address positional misalignment from agent-specific prefixes by aligning cache offsets and adjusting positional embedding at runtime, allowing reuse of overlapping context despite divergent prefixes within a single model. Other works rely on selective recomputation. For instance, CacheBlend ( 39 ) reuses KV caches by recomputing a small subset of tokens that are critical for accuracy. DroidSpeak ( 16 ) enables KV cache reuse across fine-tuned LLMs that share the same backbone by selectively recomputing KV cache of a predefined set of critical layers while reusing the KV cache for the remaining layers, reporting higher accuracy than token-wise recomputation methods such as CacheBlend. In addition, DroidSpeak introduces a hidden state cache to skip recomputation for the initial few non-recomputed layers and directly feed to the first recomputed layer. However, although DroidSpeak is the closest to our work, it still processes hidden states for already seen context, similar to other approaches, so it reduces only the key and value projections for cache updates while leaving most computation unchanged. This highlights that fully reusing KV caches to eliminate computation for redundant context across models remains challenging. Moreover, KV cache sharing tailored to multi-LoRA systems remains largely overlooked despite their wide deployment in practice. To the best of our knowledge, this is the first work that explicitly tailors KV cache sharing to multi-LoRA agent settings and our work is complementary to prior cache-sharing methods. 3 Methodology Figure 1 : (Left) Relationship between the full cache, base cache, and adapter output. (Right) Layer-wise pairwise cosine similarity of the base and full caches, measured on the same context across three agent pairs using 128 samples of 2k tokens from the HotpotQA dataset. Table 1 : Average cosine similarity across agent pairs for the base cache, full cache, and adapter output, on the same context. Model Full cache Base cache Adapter output LLaMA-3.1-8B-Instruct 0.9576 0.9726 0.0538 Ministral-8B-Instruct 0.9200 0.9530 0.0225 3.1 Cache Similarity Across the Agents We first demonstrate that, for the same context, differences in cache values mainly arise from the adapter output, which is small in magnitude (see Appendix A.1 ) but contains critical agent-specific information. Applying Equation 3 to the value projections, where the input X_{i} corresponds to the hidden states obtained by running agent i on a given context, Figure 1 and Table 1 show that the base cache Y_{\mathrm{base},i}=X_{i}W_{0} remains highly similar across agents on the same context. In contrast, the adapter output \Delta Y_{i}=X_{i}\Delta W_{i} acts as a largely decorrelated perturbation, with cosine similarity close to zero. With these small, decorrelated adapter output, the expected cosine similarity of the full cache Y_{i}=Y_{\mathrm{base},i}+\Delta Y_{i} is lower than that of the base cache, empirically by about 3% on average, where concrete derivation is provided in Appendix A.2 . This motivates sharing only the base cache, rather than the full cache, to better preserve the small but critical agent-specific contributions from the adapters. Otherwise, the discrepancy accumulates over iterative agent executions and can lead to a noticeable accuracy drop. We also note that the cosine similarity of the key cache remains above 0.98 on average (see Appendix A.3 ), suggesting that value cache management is the key factor for preserving accuracy in multi-agent inference. 3.2 BaseShared and BaseLRShared In this section, we present KV cache sharing schemes tailored to the multi-LoRA architecture. Our key idea is to decouple the value cache into a shared component (base cache) produced by the pretrained weights, and an adapter-dependent component. We reuse the base cache across agents without recomputation, and store the adapter-dependent component in a compact low-rank form (LR cache) that is expanded to full-dimension form on demand at runtime. We first introduce BaseShared , which primarily reduces memory usage, and then extend it to BaseLRShared , which leverages shared- A multi-LoRA architecture and further reduces both computation and memory usage. Figure 2 illustrates the agent execution flow and the corresponding cache management in our methods, which we discuss in detail in the following paragraphs. Figure 2 : Agent iteration and cache accumulation for Non-Shared, BaseShared , and BaseLRShared . \mathrm{T0} denotes the system prompt shared across agents, and \mathrm{T}i denotes trajectory context blocks, formed by concatenating model-generated tokens and retrieved context from external sources. BaseShared shares only the base cache and maintains a separate LR cache per agent, whereas BaseLRShared shares both the base and LR caches. Figure 3 : Diagram of base and LR cache computation with an initial context of length L_{p} prefilled by agent i , followed by an additional context of length L_{c} processed by agent j , under (a) BaseShared and (b) BaseLRShared . BaseShared maintains per-agent LR caches and computes the LR cache using hidden states for all context tokens not yet processed by the current agent, whereas BaseLRShared shares a single LR cache and uses hidden states only for newly appended tokens. Both methods first compute the base cache from the pretrained weights (\scriptsize1⃝, \scriptsize4⃝). They then compute the LR cache via the LoRA down-projection (\scriptsize2⃝, \scriptsize5⃝), and later expand it to the full dimension via the LoRA up-projection over the full sequence (\scriptsize3⃝, \scriptsize6⃝). Efficient LR cache expansion is described in Section 3.3 . BaseShared We first decouple the value cache into a base component Y_{\mathrm{base}} and an adapter-dependent component \Delta Y_{i} . Here, we share a single base cache across agents even though the layer inputs X_{i} are not exactly identical, motivated by the observations in Section 3.1 , which show that the base cache X_{i}W_{0} remains highly similar across agents on the same context and that the remaining differences are dominated by the adapter contribution. Concretely, for each newly appended context, the agent that processes the context first materializes the base cache and stores it in memory. When another agent later processes the same context, it reuses the stored base cache without recomputation of value projections as illustrated in Figure 2 (b). We refer to this scheme as BaseShared . For the adapter output, naively storing it in full-dimension form would largely negate the benefit of sharing, since keeping full-dimension cache per agent in addition to the base cache increases the total cache size to 1+1/N times that of the default non-shared scheme. Instead, we store the adapter output in its inherent low-rank form as the intermediate output Y_{\mathrm{lr},i}=X_{i}A_{i} , which we call the LR cache, and reconstruct the required contribution at runtime via the up-projection as Y_{\mathrm{lr},i}B_{i} . In addition, since key cache similarity is sufficiently high across agents, we fully share the key cache. While the same idea can also be applied to the key projection when LoRA is used, LoRA is typically applied to the query and value projections for the best accuracy, so we focus on the value projection in our main implementation. Further accuracy and efficiency analysis for LoRA applied to the key projection is presented in Appendix D.1 . Figure 3 illustrates a forward pass that agent j processes a context segment of length L_{c} given a prefilled context of length L_{p} by agent i . Here, the LR cache is accumulated over the sequence, and later expanded into the full-dimension adapter contribution via the up-projection B_{i} , then added to the base cache. In terms of memory, BaseShared maintains a single shared base cache along with lightweight per-agent LR caches. Because each LR cache is smaller than the full cache by a factor of r/d_{\mathrm{out}}\ll 1 , the total KV cache size is reduced to 1/N+r/d_{\mathrm{out}}\simeq 1/N of the non-shared scheme. However, in terms of computation, since only the base cache is shared, switching agents requires constructing the LR cache for the entire accumulated context that the new agent has not yet processed; we refer to this as the ‘LR prefill’ process, as illustrated in Figure 2 (b). For example, in Figure 3 (a), the hidden states span a sequence of length at least L_{p}+L_{c} , and the LR cache for agent j must be newly computed via the down-projection A_{j} . At this step, computation of the key and value projection that produces the shared base cache for context segment L_{p} can be skipped, but the majority of computation (e.g., proceeding MLP layers after the Attention layers) is still required. As a result, the amount of computation remains similar to the non-shared setting, scaling as O(NL^{2}d_{\mathrm{model}}) , where L is the total trajectory length and d_{\mathrm{model}} is the model hidden dimension. We note that this is consistent with prior KV cache sharing methods including DroidSpeak, since selective recomputation requires hidden states for the contexts that were previously processed only by other agents. In summary, BaseShared serves as a robust and memory-efficient solution applicable to standard multi-LoRA systems. It significantly reduces KV cache memory usage compared to the non-shared baseline while preserving higher accuracy than existing prior KV cache sharing methods. As such, BaseShared is particularly well-suited for conventional multi-LoRA agents when memory efficiency is a primary concern. Table 2 : Average cosine similarity of the LR cache across agent pairs for the same context in shared- A multi-LoRA architectures. Model (Plan, Action) (Action, Reflect) (Reflect, Plan) LLaMA-3.1-8B-Instruct 0.9486 0.9634 0.9607 Ministral-8B-Instruct 0.9473 0.9526 0.9498 BaseLRShared Building on this foundation, we next introduce BaseLRShared to achieve computational acceleration as well as memory savings. By leveraging the shared- A multi-LoRA architecture, BaseLRShared further eliminates the redundant prefill computation, enabling substantially higher throughput and lower latency than prior approaches. As discussed in Section 2.1 , task-specific differences in multi-LoRA systems mainly arise from the up-projection matrices B_{i} , making it effective to share A for improving both parameter efficiency and accuracy ( 27 ; 37 ) . In this setting, we further observe that the LR cache AX_{i} produced by the shared down-projection can also be shared across agents. As shown in Table 2 , the LR cache in shared- A multi-LoRA exhibits high cosine similarity across agents, analogous to the base cache, which motivates sharing the LR cache as well. We therefore maintain a single base cache and a single LR cache for the entire system, and construct agent-specific outputs via their task-specific up-projections B_{i} . Here, the memory usage is reduced by a factor of 1/N+r/(Nd_{\mathrm{out}})\simeq 1/N relative to the non-shared implementation. Moreover, because both the base cache and the LR cache are available for all previously seen tokens in BaseLRShared , an agent does not require recomputation over context processed by previous agents to construct either cache or the hidden states. For example, in Figure 3 (b), the base and LR caches for the L_{p} tokens that are already available, so the forward pass only needs to compute activations for newly appended L_{c} contexts. Therefore, across N agents over the length- L trajectory, BaseLRShared avoids the N separate prefills required by the non-shared implementation. As a result, the overall computational complexity becomes even comparable to full cache sharing, scaling as O(L^{2}d_{\mathrm{model}}) , considering that the LR cache expansion cost is small (discussed in the Section 3.3 ). 3.3 Flash-LoRA-Attention Algorithm 1 Flash-LoRA-Attention Forward (head-wise) 0: L=L_{\mathrm{p}}+L_{\mathrm{c}} , Q\in\mathbb{R}^{L_{\mathrm{c}}\times d_{\mathrm{head}}} 0: K\in\mathbb{R}^{L\times d_{\mathrm{head}}} , base cache V_{\mathrm{base}}\in\mathbb{R}^{L\times d_{\mathrm{head}}} 0: LR cache V_{\mathrm{lr}}\in\mathbb{R}^{L\times r} , LoRA B\in\mathbb{R}^{r\times d_{\mathrm{head}}} 0: Key, Value block size B_{c} , T_{c}=\lceil L/B_{c}\rceil 0: Query block size B_{r} , T_{r}=\lceil L_{\mathrm{c}}/B_{r}\rceil 0: Attn output block O\in\mathbb{R}^{L_{\mathrm{c}}\times d_{\mathrm{head}}} 1: Q,O \rightarrow T_{r} blocks Q_{i} , O_{i} ( i=0,\ldots T_{r}-1 ). 2: K,V_{\mathrm{base}} \rightarrow T_{c} blocks K_{j},V_{\mathrm{base},j} ( j=0,\ldots T_{c}-1 ). 3: V_{\mathrm{lr}} \rightarrow T_{c} blocks V_{\mathrm{lr},j} ( j=0,\ldots T_{c}-1 ). 4: for 0\leq i