- Rating
- 5
- Clarity
- 4
- Confidence
- 4
- Originality
- 4
- Quality
- 4
- Significance
- 4
Read review
Summary
This work addresses the central challenge of repeated re-encoding of tool specifications in the retrieve-then-prompt function calling paradigm, effectively solves the problem of high latency and memory overhead, and is more suitable for resource-constrained on-device environments. To address this core problem, this paper proposes EngramState, a state-centric function calling framework that redefines tool knowledge from transient text to reusable execution memory. By compiling tool specifications offline into recurrent state priors and loading them directly at runtime to enable query-only inference, it significantly reduces the repeated precomputation overhead of tool specifications. Specifically, based on the state retention property of RWKV, the authors partition tool knowledge into Base State (containing tool names, descriptions, and argument schemas) and Corrective State (containing format rules, failure cases, etc.). Leveraging the channel-wise distribution property of WKV states, they adopt 4-bit per-channel linear quantization to compress storage space, and implement tool retrieval by training two lightweight MLP projection heads. The framework dynamically switches between Base/Corrective states or alternative tools based on validator feedback, ensuring execution robustness under limited state capacity. On the DroidCall, Samsung Galaxy S25 Ultra, and BFCL benchmarks, EngramState significantly reduces prompt tokens and time-to-first-token (TTFT) while maintaining accuracy.
Strengths and weaknesses
Strengths This paper focuses on solving the function calling latency problem of on-device LLM agents, and innovatively effectively avoids the limitations of path dependence and poor composability of Transformer KV caches in the traditional retrieve-then-prompt paradigm through a state reuse scheme. The authors conducted a system-level evaluation on a real mobile device (Galaxy S25 Ultra), measuring key deployment metrics such as TTFT, peak memory, and storage, and the results have high credibility. In addition, comparative experiments with prompt baselines and Transformer prefix cache baselines, as well as ablation experiments and experimental results on the Mamba model, further validate the effectiveness of the proposed scheme. The paper describes in detail the engineering implementation details such as state compilation, quantization, retriever training, and feedback routing, and provides complete hyperparameters, algorithm procedures, and failure analysis in the appendix, offering sufficient guidance for reproduction and deployment.
Weaknesses Although the method proposed in this paper achieves remarkable results, there is still room for improvement in the following aspects:
- Currently, only relatively simple scenarios of single-tool calling or calling multiple functions in a single prompt round have been evaluated. It can be considered to apply the method to multi-hop tool tasks with multi-turn chain dependencies to test its performance. On the other hand, since only the state of a single tool can be loaded at present, multi-tool calling needs to be implemented through multiple retries. Although the total latency is still lower than that of the prompt baseline, it also increases the uncertainty in inference steps and the worst-case latency.
- Scenarios where tool parameters contain long strings (e.g., code, documents) have not been tested, and it is unclear whether the state can effectively encode such information.
- The boundary between the Base State and the Corrective State is an empirical division determined through experiments, and there is no theoretical basis to explain why the current division is optimal. It may need to be readjusted for different model scales and different tool sets.
- Tool states need to be precompiled offline. When the tool set changes (adding, deleting, or modifying tools), do all relevant states need to be recompiled? How does your scheme support dynamic updates?
- None of the experimental results report error bars or confidence intervals, making it impossible to judge the statistical significance of performance differences between different methods.
Questions
Based on the content mentioned in the weaknesses, I hope to discuss the following questions with the authors during the response session:
- Could you try to answer how to achieve efficient combination of multiple tool states in multi-tool calling scenarios? Is it possible to design a state fusion mechanism that merges the base states of multiple related tools into a composite state, thereby supporting multi-tool calling in a single inference?
- Regarding the boundary of state segmentation, can it be learned through automated methods? For example, by analyzing the impact of different tool information on the generation results, automatically determine which information should be placed in the base state and which in the corrective state.
- For larger-scale state models (such as RWKV-7 7B, Mamba-2 8B), the state capacity has increased significantly. Is the division of base/corrective states still necessary? Or can more information be integrated into a single state to reduce the number of retries? On the other hand, can precompiled tool states be migrated between models of the same architecture with different scales? For example, can the state compiled on RWKV-7 1.5B be directly used on RWKV-7 3B, or only require a small amount of fine-tuning?
- Could you explain how you envision supporting incremental updates for dynamic tool sets? What I care about is, based on the existing scheme, can an incremental state compilation method be designed to only recompile the changed tools without recompiling the entire tool library?
- I am curious about what the effect would be if your scheme is combined with structured decoding techniques (such as XGrammar2). The paper mentions that XGrammar2 has limited improvement on EngramState, but if the corresponding syntax constraints are loaded simultaneously when loading the state, can the parameter error rate be further reduced?
- Could you analyze where the limit of state compression lies? In addition, can more advanced compression algorithms (such as GPTQ, AWQ) be used to further reduce storage overhead while maintaining accuracy?
- Is it possible to add an analysis of worst-case latency in the experimental section to illustrate the impact of the retry mechanism on the latency distribution? And add a comparison with parameter-efficient fine-tuning (such as LoRA, Prefix Tuning) in the related work section to explain the differences and advantages between state loading and these methods?
Looking forward to your replies.
Limitations
The paper mentions that the method is only applicable to sequence models with fixed-size recurrent states (such as RWKV and Mamba), which means that for traditional Transformer architectures, the method may not be suitable due to their variable-length KV caches and path dependence. The authors also mention that the current framework cannot adapt to multi-tool usage scenarios. In addition, I believe that the need for offline precompilation of tool states is also a limitation, as it cannot support dynamic addition, modification, or deletion of tools and lacks an incremental update mechanism. Furthermore, the division between base states and corrective states is an empirical result based on experiments, which also makes the generalizability of this scheme remain to be verified. Due to the feedback-driven retry mechanism, an average of 1.4-1.7 inference attempts are required per query. Although the total latency is still lower than the prompt baseline, the worst-case latency may increase, which is also a point to consider in actual deployment. Finally, in terms of security, since precompiled states are in binary format and more difficult to audit and verify than textual tool specifications, they are more likely to be at risk of malicious tampering.
Paper formatting concerns
Overall, there are no formatting errors that need to be modified. However, I was wondering if a short algorithm pseudocode could be added to the feedback routing strategy in Appendix L.1 to make it more intuitive?
Final justification
This article is highly innovative and has addressed several common issues faced by current LLMs, such as the excessive number of tools used, high tool overlap, and failure to call tools resulting in backtracking. The response to the reviewers is also detailed enough. Therefore, I have decided to maintain the previous score.
Q1.
As noted in Appendix B, we consider state merging an important direction for future work. Merging independently compiled states (S_1) and (S_2) is difficult and may require a dedicated composition model. As an alternative, we jointly provided tool APIs (T_1) and (T_2) in the LLM prompt and compiled them into a single combined state.
We constructed 48 combined states: 15 containing three similar tools and 33 containing two or three frequently called tools. Evaluation on the DroidCall multi-tool calling test set produced the following results.
However, the number of possible tool combinations grows combinatorially with the size of the tool repository, making exhaustive state generation and storage impractical. We therefore compile an independent state per tool and retrieve only the required states.
Our multi-call execution traverses the same Top-K list as single-call execution. If the first candidate fails and the second succeeds, its result is stored as the first call, and execution continues from the third candidate for subsequent calls.
For more complex scenarios, we also evaluated query decomposition. Instead of generating multiple calls simultaneously, the request is divided into sequential sub-tasks, and the required tool state is loaded for each function call. The decomposition-based execution slightly outperformed the fixed Top-K prompt baseline, which achieved 0.896 Soft Accuracy and 0.785 Accuracy.
We are continuing to study efficient state composition and fusion methods as future work.
Q2.
Our current method does not use a learned segmentation but model-specific experimental calibration. For each fine-tuned RWKV-7 model, we progressively add sections of the tool specification and measure function-calling accuracy on 200 single-call examples. We select the first point at which calibration accuracy reaches its maximum as the boundary. Since adding further information does not improve accuracy and may reduce it, this point is used to divide the Base and Corrective States.
TN, TD, and AS are required for all models. Subsequent information is assigned to the Base or Corrective State according to model scale. We currently apply one model-level boundary to all tools, although the same calibration can be performed separately for each tool.
Q3.
Because we target on-device environments and relatively small models with limited state capacity, we divide tool information into Base and Corrective States. Larger 7B/8B models may preserve more information in a single state, reducing the need for this division. This possibility is also suggested by Q2, where the 2.9B model retains information up to the AF boundary.
States cannot be directly reused across model scales because the number of layers and state dimensions differ. Compatibility also cannot be obtained through only minor fine-tuning. Tool states must be recompiled using the new backbone, although no additional model fine-tuning is required.
Q4.
Tool updates can be divided into three cases.
Updated tool. Only the corresponding Base and Corrective States are recompiled. For RWKV-7 1.5B, recompiling both states for one tool takes approximately 0.28 seconds.
New tool. Only the new tool state is compiled; existing tool states remain unchanged. The retriever is then updated using data for the new tool. Retriever training takes approximately 10–13 seconds with 240 examples and 50 epochs.
Deleted tool. The corresponding tool state and retriever entry are removed.
EngramState therefore naturally supports tool-level incremental compilation. Unless the backbone model changes, the entire repository does not need to be regenerated.
Q5.
When the requested output format changes, combining EngramState with XGrammar2 provides substantial benefits. The improvement was limited in our original setting because the model had already learned DroidCall syntax constraints through fine-tuning.
To evaluate the effect of XGrammar2, we changed the required output to JSON without additional syntax-constraint training. Without XGrammar2, EngramState produced valid JSON at a rate of 0.645. Combining EngramState with XGrammar2 increased the valid JSON rate to 0.98 and also improved accuracy.
These results show that EngramState can be combined with structured decoding methods such as XGrammar2. Although its improvement is small when the output syntax has already been learned, it becomes more effective when the required syntax changes.
Q6.
GPTQ targets static model weights. In contrast, an RWKV state is a dynamically generated activation. Therefore, directly applying GPTQ to recurrent states is difficult because fixed input statistics for Hessian estimation are unavailable.
AWQ protects important channels through scaling. A similar idea is already used in our channel-wise quantization. RWKV states exhibit large differences in dynamic range across channels, so each channel is quantized independently using its own min/max range.
To find the compression limit, we evaluated 3-bit and 2-bit compression. At 3-bit, RTN and outlier scaling achieve accuracies of only 4.7–28.3, whereas channel-wise quantization remains within 1.3 percentage points of the baseline. At 2-bit, there are further accuracy drops.
We selected 4-bit for practical reasons rather than because it is the accuracy limit. Three-bit storage requires additional packing and unpacking because it is not byte-aligned, whereas 4-bit stores two values per byte and is well supported by existing mobile inference stacks. When storage is prioritized, 3-bit can be used with at most a 1.3 percentage points reduction.
Q7.
In EngramState, tool states are attempted sequentially. For single-call queries, the longest Top-K path is
Base1→Base2→⋯→BaseK→CorrectiveK, because execution terminates after a Corrective State. Thus, Top-K allows at most K+1 attempts, or K retries. Under Top-4, EngramState performs at most five total attempts, including four retries.
For multi-call queries, each candidate's Base and Corrective States are attempted at most once across calls, resulting in at most 2K attempts, or eight attempts under Top-4. We compared the retry latency of EngramState and a fixed Top-4 prompt on a Samsung Galaxy S25 Ultra using RWKV-7 1.5B.
When the Prompt (Top-4) method performs its worst-case four retry attempts, its end-to-end latency is 56.540 seconds. This is slower than performing 23 retries with EngramState. In addition, under Top-4, the cumulative end-to-end latency of the worst-case four EngramState retry attempts is 8.204 seconds, which is lower than the 9.047 seconds required for a single Prompt (Top-4) attempt.
In our Related Work on function calling and tool retrieval, we discuss ToolLLM and ToolBench, where fine-tuning teaches the model how to invoke tools, while retrieval identifies which tools should be considered. Accordingly, representative systems such as ToolLLM combine fine-tuning and retrieval to improve function-calling performance.
Similarly, our framework first fine-tunes the RWKV model using LoRA and then uses a state-loading approach. As the reviewer suggested, we believe that adding an explanation of these existing approaches to the Related Work section would improve the paper.
Thank you for the suggestion. We will add concise pseudocode for the feedback-routing procedure to Appendix L.1 to clarify the state-transition and termination conditions.