alphaFeedback

WorksComputer Science

Learning What to Remember: Resource-Efficient Self-Improvement for Lifelong Agents

AI contributions
Not recorded for this paper
View details
Ancillary data
1 code link
View

Abstract

Self-improving agents aim to continuously improve their behavior by learning from experience after deployment. However, accumulating and reusing more experience does not necessarily lead to better decisions, particularly when generation, interaction, and memory resources are jointly constrained. Under such stringent constraints, we find that several existing lifelong-memory methods provide limited benefits over simple retrieval or even no-memory agents. This reveals a fundamental challenge for resource-efficient self-improvement: agents must learn not only which past experiences are relevant, but which are actually worth reusing to improve future decisions. When memory capacity and opportunities for reasoning and recovery are limited, retrieving an ineffective experience can consume scarce resources and hinder downstream execution. To address this challenge, we propose TokenWorth, a lightweight feedback-driven memory adaptation framework that learns query-dependent memory worth from sparse execution feedback. Without updating the backbone model, TokenWorth uses the learned worth to guide both experience retrieval and bounded memory management, enabling the agent to continually adapt how it reuses accumulated experience. Across three LifelongAgentBench environments and both local and API-based deployments, TokenWorth achieves the highest task success rate while using the fewest output tokens among the evaluated methods under the specified resource budgets. These results suggest that effective self-improvement under resource constraints depends not on accumulating more experience, but on learning what is worth remembering. Our code is publicly available at https://github.com/AIGNLAI/TokenWorth.

Introduction

Self-improving agents continually accumulate and reuse experience from evolving task streams to improve their behavior after deployment [35]. Such experience-driven adaptation is particularly valuable for long-running agents facing evolving user needs, environments, and tasks [4, 6, 16]. However, accumulating more experience does not necessarily translate into better decisions. In practice, generation is constrained by latency, computation, or inference cost; interaction opportunities are finite; and only a bounded amount of historical experience can be stored or reused [8, 11, 29]. This raises a fundamental question: how can agents effectively improve from experience when generation, interaction, and memory resources are jointly constrained?

Our evaluation reveals that existing memory mechanisms often struggle under such constraints. As shown in Figure 1(a), several sophisticated lifelong-memory approaches provide limited improvement over simple retrieval or even no-memory agents, and can substantially underperform in some environments. These results suggest that accumulating and reusing experience alone is insufficient for reliable adaptation under stringent resource constraints. Importantly, this limitation cannot be

Bar chart and schematic illustrating resource-abundant and resource-constrained lifelong agents

Figure 1. Left: Representative local results with Qwen2.5-14B-Instruct under the evaluated stringent joint resource constraints; TokenWorth remains effective where several memory baselines do not. Right: Resource-constrained lifelong agents adapt from experience under bounded generation, interaction, and memory budgets.

40th Conference on Neural Information Processing Systems (NeurIPS 2026) Workshop: Towards Test-Time Continual Learning Agents (TTCL). attributed simply to insufficient memory capacity: under the same resource budget, different memory policies can lead to markedly different downstream task performance.

To study this challenge systematically, we formalize resource-constrained lifelong agents: agents that must continually adapt from experience while operating under bounded generation, interaction, and memory budgets. As illustrated in Figure 1(b), we jointly constrain the resources available for task execution and experience reuse. Specifically, the agent operates with a bounded output budget and limited interaction rounds, while its external memory is constrained in capacity, retrieval count, and injection length. The backbone remains frozen throughout the task stream, allowing us to study experience-driven adaptation under a controlled, stringent resource budget.

Why does experience-based adaptation become fragile under such constraints? When only a small amount of experience can be retained or reused, and opportunities for reasoning and recovery are limited, each memory decision becomes more consequential. Semantic relevance alone may be insufficient: an experience can appear relevant to the current query yet provide little downstream utility. Conversely, useful experience that is not retained or selected cannot be recovered by simply injecting more context or extending the interaction. Resource scarcity therefore exposes a fundamental distinction between accumulating experience and effectively learning from it. The central challenge is not merely to retrieve relevant experience, but to determine which experiences are actually worth retaining and reusing to improve future decisions.

To address this challenge, we propose TokenWorth, a lightweight feedback-driven memory adaptation framework that learns query-dependent memory worth from sparse execution feedback. TokenWorth combines an interpretable online base scorer with a residual Recursive Feature Machine (RFM), allowing stable global patterns of memory usefulness to be complemented by nonlinear, query-specific corrections. The learned worth guides both memory retrieval and bounded memory-bank management, enabling the agent to continually adapt its experience-reuse policy without backbone updates or additional language-model calls.

We evaluate TokenWorth on three LifelongAgentBench environments covering database interaction, operating-system tasks, and knowledge-graph reasoning, under both local and API-based deployments. Across all six environment–deployment combinations, TokenWorth achieves the highest task success rate among the evaluated methods while using the fewest output tokens. These results suggest that resource-efficient adaptation depends not on accumulating more experience, but on learning what is worth remembering.

Our contributions are threefold:

  • We formulate resource-constrained lifelong agents and investigate experience-driven adaptation under stringent joint constraints on generation, interaction, and memory.

  • We propose TokenWorth, a lightweight online framework that learns query-dependent memory worth from execution feedback and uses it consistently for memory retrieval and bounded memory management.

  • We evaluate TokenWorth across three LifelongAgentBench environments under both local and API-based deployments, demonstrating improved task success and generation efficiency under stringent resource constraints.

Related Work

Experience-Driven Self-Improvement in Language Agents. Self-improving language agents aim to continually improve from accumulated interaction experience, enabling adaptation after deployment without necessarily updating backbone parameters [6, 35]. Early agent systems demonstrated that past trajectories, reflections, or reusable skills can improve future decisions, including Reflexion [19], ExpeL [33], Voyager [24], and SocioDojo [4]. More recent work has developed explicit memory and skill mechanisms for continual adaptation, such as MemoryBank [37], Mem0 [5], MemRL [32], MemSkill [30], and AutoSkill [27]. Meanwhile, LifelongAgentBench [34], AgentCL [21], SkillLearnBench [36], and XSkill [10] provide systematic evaluations of experience-driven adaptation. While these studies explore how agents accumulate and exploit experience, we investigate how agents can learn which experiences are worth reusing to support effective adaptation under stringent resource constraints.

Resource-Constrained Agent Adaptation. Resource efficiency has been extensively studied for LLM inference and serving, including memory-efficient execution [11] and collaborative inference under computation and communication constraints [29]. Recent work has extended resource considerations to agent adaptation. Hajimiri et al. [9] study whether online memory and skill modules remain beneficial under fixed inference-token budgets, while Wu et al. [25] investigate continual learning with hard-bounded on-device memory. BudgetMem [31] considers query-aware routing across runtime memory budgets, and Chen and Cheng [3] model agentic memory value using multiple factors for retention and retrieval. These studies highlight the importance of resource-aware experience reuse, but primarily focus on individual constraints, runtime budgeting, or memory valuation in isolation. In contrast, we study experience-driven self-improvement under stringent joint constraints on generation, interaction, and memory. We propose TokenWorth, which learns query-dependent memory worth from online execution feedback to guide both retrieval and bounded memory management, enabling continual adaptation without backbone updates.

Resource-Constrained Lifelong Agents

We consider a lifelong agent that sequentially processes an online task stream Q={q1,q2,…,qT}\mathcal{Q} = \{q_1, q_2, \ldots, q_T\}. At step tt, the agent receives task qtq_t and may retrieve a set of past experiences Rt\mathcal{R}_t from its current memory bank Bt={m1,…,mNt}\mathcal{B}_t = \{m_1, \ldots, m_{N_t}\}. Conditioned on qtq_t and Rt\mathcal{R}_t, the backbone model interacts with the environment for JtJ_t rounds, producing a trajectory

τt={(ot,j,at,j)}j=1Jt\tau_t = \{(o_{t,j}, a_{t,j})\}_{j=1}^{J_t}

where ot,jo_{t,j} and at,ja_{t,j} denote the observation and model output at interaction round jj, respectively. The environment then returns a task-level reward rt∈{0,1}r_t \in\{0,1\}. After observing this outcome, the memory policy may update the bank from Bt\mathcal{B}_t to Bt+1\mathcal{B}_{t+1}. We focus on a frozen-backbone setting, where experience-driven adaptation occurs through online updates to external memory and its management policy, rather than model parameters.

We impose resource constraints on both task execution and experience reuse. For execution, the total amount of model generation associated with each task, including both environment interaction and any method-specific auxiliary language-model calls, is bounded by

∑j=1Jt∣at,j∣tok+Ataux≤Qmax⁡,Jt≤Jmax⁡,\sum_{j=1}^{J_t} \lvert a_{t,j} \rvert_{\mathrm{tok}} + A_t^{\mathrm{aux}} \le Q_{\max}, \qquad J_t \le J_{\max},

where AtauxA_t^{\mathrm{aux}} denotes the output tokens generated by auxiliary language-model calls such as memory construction, reflection, or skill extraction. For memory, the persistent bank is bounded by

∣Bt∣≤Bmax⁡,\lvert\mathcal{B}_t \rvert\le B_{\max},

while the memories supplied to the agent satisfy

∣Rt∣≤Kmax⁡,Len⁡(Rt)≤Lmax⁡.|\mathcal{R}_t| \le K_{\max}, \qquad\operatorname{Len}(\mathcal{R}_t) \le L_{\max}.

We summarize the overall resource budget as

C=(Omax⁡,Jmax⁡,Bmax⁡,Kmax⁡,Lmax⁡),\mathcal{C} = (O_{\max}, J_{\max}, B_{\max}, K_{\max}, L_{\max}),

which jointly constrains generation, interaction, memory storage, and memory usage.

Let πmem\pi_{\mathrm{mem}} denote an online memory policy that determines both which experiences to retrieve for the current task and how the memory bank is updated after observing the task outcome. Through execution feedback, this policy can adapt how accumulated experience influences future decisions without modifying the backbone. For a fixed resource budget C\mathcal{C}, we define its lifelong task performance as

S(πmem;C)=1T∑t=1TE[rt].S(\pi_{\mathrm{mem}};\mathcal{C}) = \frac{1}{T}\sum_{t=1}^{T}\mathbb{E}[r_t].

The objective is therefore

πmem∗=arg⁡max⁡πmem∈Π(C) S(πmem;C),(1)\pi_{\mathrm{mem}}^{*} = \underset{\pi_{\mathrm{mem}}\in\Pi(\mathcal{C})}{\arg\max}\ S(\pi_{\mathrm{mem}};\mathcal{C}), \tag*{(1)}

where Π(C)\Pi(\mathcal{C}) denotes the class of online memory policies satisfying the resource constraints above.

Our focus is on experience-driven adaptation under a stringent joint resource budget, where generation, interaction, and memory resources are simultaneously limited. Under such constraints, ineffective memory decisions cannot easily be compensated for by retrieving additional experience, generating longer reasoning traces, or interacting for more rounds. Each retrieval and retention decision therefore becomes more consequential. The central challenge for resource-efficient self-improvement is not merely to accumulate or retrieve relevant experience, but to learn which experiences are actually worth retaining and reusing to improve future decisions.

TokenWorth: Feedback-Driven Memory Adaptation

Overview

Figure 2 illustrates the feedback-driven adaptation process of TokenWorth. Given a query qtq_t, the agent first recalls a small candidate set from its bounded memory bank. TokenWorth estimates the query-dependent worth of each candidate using a learnable linear base scorer and an RFM-based residual correction, selecting the highest-valued experience for task execution. After receiving the environment reward, the worth model is updated online, and the learned worth further guides memory-bank management. Through this feedback loop, the agent continually adapts how past experience influences future decisions without updating its backbone.

Overview of TokenWorth

Figure 2. Overview of TokenWorth. Online execution feedback updates query-dependent memory worth, which guides subsequent experience retrieval and bounded memory-bank management.

TokenWorth consists of three components. First, an interpretable linear scorer captures stable memory-utility patterns, while a residual Recursive Feature Machine (RFM) models nonlinear, query-specific corrections [2, 18]. Second, fast value updates and slower AGOP-based feature adaptation balance stability and adaptivity under sparse feedback. Third, reward guides both retrieval and bounded memory management.

Learning Query-Dependent Memory Worth

Effective experience-driven adaptation requires identifying which past experiences are worth reusing for future decisions. Unlike a fixed memory-utility score, the usefulness of an experience depends on the current query and must be inferred from sparse execution feedback. Each task is executed only once, feedback is observed only for the memory actually used, and execution failure may arise from factors beyond the selected memory itself.

To balance stability and adaptivity under such feedback, TokenWorth decomposes memory worth into two complementary components. A lightweight linear base scorer captures stable and interpretable patterns across the task stream, while an RFM learns nonlinear residual structure not captured by the base scorer. The linear component is updated conservatively around an informative prior, whereas the RFM adapts more flexibly to local query–memory interactions.

Candidate recall and representation. Each memory mi∈Btm_i \in\mathcal{B}_t contains a compact record of a previously successful interaction together with lightweight statistics describing its historical use. Given the current query qtq_t, we first recall a small candidate set using a lightweight textual relevance function:

Ct=TopK⁡Kc{srecall(qt,m):m∈Bt},\mathcal{C}_t = \operatorname{TopK}_{K_c}\{s_{\mathrm{recall}}(q_t,m):m \in\mathcal{B}_t\},

where KcK_c controls only the internal candidate pool and is independent of the number of memories ultimately supplied to the agent.

For each candidate mi∈Ctm_i \in\mathcal{C}_t, we construct four interpretable features

ϕti=[ϕsim(qt,mi),ϕutil(mi),ϕrel(mi),ϕrecent(mi)],\boldsymbol{\phi}_t^i = [\phi_{\mathrm{sim}}(q_t,m_i),\phi_{\mathrm{util}}(m_i),\phi_{\mathrm{rel}}(m_i),\phi_{\mathrm{recent}}(m_i)],

capturing lightweight textual similarity, historical utility, reliability, and recency.

For residual estimation, we additionally construct a richer query–memory representation

zti=[∣et−ei∣,cos⁡(et,ei),ui,rel⁡t(mi),rec⁡t(mi),freq⁡t(mi)].\mathbf{z}_t^i = [\lvert e_t-e_i\rvert,\cos(e_t,e_i),u_i,\operatorname{rel}_t(m_i),\operatorname{rec}_t(m_i),\operatorname{freq}_t(m_i)].

This representation combines hashed textual similarity features with the empirical history of each memory. The text representation is deterministic and lightweight rather than a learned semantic embedding; detailed definitions are provided in Appendix B.

Prior-regularized base scorer. The base scorer captures stable global relationships between memory characteristics and downstream usefulness:

sbase,t(qt,mi)=wt⊤ϕti.s_{\mathrm{base},t}(q_t,m_i)=\mathbf{w}_t^{\top}\boldsymbol{\phi}_t^i.

Rather than learning wt\mathbf{w}_t from scratch, we initialize it from an informative prior w0\mathbf{w}_0 and regularize subsequent online updates toward this prior. Given observed execution feedback Dtbase={(ϕj∗,yj)}\mathcal{D}_t^{\mathrm{base}}=\{(\boldsymbol{\phi}_j^*,y_j)\}, we optimize

Lbase(w)=∑(ϕj∗,yj)∈Dtbaselog⁡(1+exp⁡(−yjw⊤ϕj∗))+λw∥w−w0∥22.\mathcal{L}_{\mathrm{base}}(\mathbf{w}) = \sum_{(\boldsymbol{\phi}_j^*,y_j)\in\mathcal{D}_t^{\mathrm{base}}} \log(1+\exp(-y_j\mathbf{w}^{\top}\boldsymbol{\phi}_j^*)) +\lambda_w\lVert\mathbf{w}-\mathbf{w}_0\rVert_2^2.

The prior anchors the scorer when feedback is scarce, while online updates allow it to capture evolving patterns of memory usefulness. Conservative periodic updates, smoothing, and bounded weights further reduce unstable drift; implementation details are provided in Appendix B.

Residual worth estimation. The linear base scorer captures stable global regularities but cannot model all nonlinear or query-specific interactions among memory signals. TokenWorth therefore augments it with an RFM-based residual correction:

st(qt,mi)=sbase,t(qt,mi)+ηtft(zit),(2)s_t(q_t,m_i) = s_{\mathrm{base},t}(q_t,m_i) + \eta_t f_t(z_i^t), \tag*{(2)}

where ftf_t predicts the residual memory worth not explained by the base scorer and ηt\eta_t controls its contribution. The selected memory is

mt∗=arg max⁡mi∈Ct st(qt,mi).m_t^* = \underset{m_i \in C_t}{\operatorname{arg\,max}}\ s_t(q_t,m_i).

The linear scorer captures stable patterns of memory usefulness, while the RFM models nonlinear, query-specific deviations.

After task execution, the observed reward provides execution-derived supervision for the selected query–memory pair:

yt=2rt−1∈{−1,+1}.y_t = 2r_t - 1 \in\{-1,+1\}.

The base scorer is updated directly from (ϕt∗,yt)(\phi_t^*,y_t). For the residual learner, we first compute the prediction implied by the base scorer,

y^tbase=2σ(sbase,t(qt,mt∗))−1,\hat{y}_t^{\mathrm{base}} = 2\sigma\left(s_{\mathrm{base},t}(q_t,m_t^*)\right) - 1,

and define the residual target

δt=yt−y^tbase.\delta_t = y_t - \hat{y}_t^{\mathrm{base}}.

The RFM is then updated from (zt∗,δt)(z_t^*,\delta_t). This feedback-driven update allows subsequent memory decisions to incorporate observed execution outcomes. Importantly, the supervision reflects downstream task success rather than the counterfactual causal contribution of mt∗m_t^*: TokenWorth does not re-execute the same task with alternative memories.

Two-Timescale RFM Adaptation

Continual adaptation from sparse feedback requires balancing responsiveness to recent outcomes with stability across the task stream. Within the residual learner, prediction and feature geometry need not adapt at the same rate. Recent outcomes provide immediate evidence about local residual structure, whereas the geometry governing query–memory features should evolve more conservatively. TokenWorth therefore separates fast residual adaptation from slow geometry adaptation.

Fast residual adaptation. Given a short feedback buffer Dtfast={(zj,δj)}j=1NfD_t^{\mathrm{fast}} = \{(z_j,\delta_j)\}_{j=1}^{N_f}, we fit a kernel ridge regressor

ft(z)=∑j=1NfαjKMt(z,zj),α=(KMt+λI)−1δ,(3)f_t(z) = \sum_{j=1}^{N_f} \alpha_j K_{M_t}(z,z_j), \qquad\boldsymbol{\alpha} = (K_{M_t}+\lambda I)^{-1}\boldsymbol{\delta}, \tag*{(3)}

where MtM_t is an adaptive diagonal feature metric. The KRR coefficients are updated frequently, allowing the residual learner to rapidly capture deviations from the global base scorer.

Slow geometry adaptation. A fixed kernel metric would assume that different query–memory features retain the same relative importance throughout the task stream. Instead, RFM adapts the feature geometry using the Average Gradient Outer Product (AGOP) [18, 13]. Given a longer feedback window Dtslow={(zj,δj)}j=1NsD_t^{\mathrm{slow}} = \{(z_j,\delta_j)\}_{j=1}^{N_s}, we compute the diagonal AGOP

G~t=Diag⁡(1Ns∑j=1Ns∇zft(zj)⊙∇zft(zj)),\widetilde{G}_t = \operatorname{Diag}\left(\frac{1}{N_s}\sum_{j=1}^{N_s} \nabla_z f_t(z_j) \odot\nabla_z f_t(z_j)\right),

and update the metric as

Mt+1=NormClip⁡((1−β)Mt+βG~t).(4)M_{t+1} = \operatorname{NormClip}\left((1-\beta)M_t + \beta\widetilde{G}_t\right). \tag*{(4)}

After each metric update, the KRR predictor is refitted under the updated geometry.

These adaptation mechanisms play complementary roles in online memory-worth learning. The prior-regularized linear scorer captures slowly evolving global regularities, the fast KRR update tracks recent residual structure, and the slower AGOP update adapts the feature geometry more conservatively. Together, they aim to balance stability and responsiveness when learning from limited execution feedback.

Worth-Guided Memory Lifecycle

Learning which memory to use for the current query addresses only part of experience-driven adaptation. Under a bounded persistent capacity Bmax⁡B_{\max}, the agent must also determine which experiences deserve to remain available for future tasks. TokenWorth therefore extends the same query-dependent notion of worth from immediate retrieval to long-term memory management.

Only successful, externally verified interactions are considered as new memory candidates. For a candidate memory mm, we estimate its broader worth over a small set of recent probe queries Pt\mathcal{P}_t:

Vt(m)=1∣Pt∣∑q∈Ptst(q,m).(5)V_t(m) = \frac{1}{|\mathcal{P}_t|} \sum_{q \in\mathcal{P}_t} s_t(q,m). \tag*{(5)}

While st(q,m)s_t(q,m) measures the query-dependent worth of mm for a particular query, Vt(m)V_t(m) aggregates this signal over recent queries to estimate whether the memory deserves persistent capacity under the current task distribution.

TokenWorth follows a coverage–quality principle for memory admission. When capacity remains available, successful experiences are admitted to build initial coverage. Once the bank is full, a candidate is admitted if it is sufficiently novel, or if its probe-averaged worth exceeds that of the best existing memory and satisfies a positive-score ratio criterion. Candidates failing this admission gate may still replace a low-utility nearest neighbor when they provide a sufficiently large worth improvement. Detailed admission and replacement criteria are provided in Appendix § 9.

For candidates passing the admission gate, TokenWorth enforces the capacity bound by evicting the memory with the lowest probe-averaged worth from the enlarged bank:

mevict=arg⁡min⁡m∈Bt∪{mnew} Vt(m).m_{\mathrm{evict}} = \underset{m \in B_t \cup\{m_{\mathrm{new}}\}}{\arg\min} \ V_t(m).

TokenWorth thus applies a unified notion of memory worth at two complementary timescales: query-dependent worth determines which experience should be used now, while probe-averaged worth determines which experience should be retained for later. This feedback-driven memory lifecycle continually reallocates limited capacity toward experiences estimated to be useful for future tasks, allowing the agent to adapt its experience-reuse policy over time. All adaptation occurs within the lightweight memory controller; TokenWorth requires no backbone updates, task replay, counterfactual execution, or additional language-model calls.

Experiments

Experimental Setup

Benchmarks. We conduct our main evaluation on three environments from LifelongAgentBench [34]: database interaction (DB), operating-system interaction (OS), and knowledge-graph interaction (KG). These environments cover heterogeneous forms of interactive decision making under an online lifelong protocol, where agents can continually adapt their experience-reuse policies based on preceding interactions. In all environments, the memory bank is initialized empty, each task is executed once, and memory decisions depend only on experience observed from previous tasks.

We additionally evaluate generalization beyond LifelongAgentBench using online lifelong variants of BigCodeBench [38] and ALFWorld [20]. These results are reported in Appendix § 10.

Backbone and deployment. We evaluate TokenWorth under two complementary deployment settings. In the local setting, all methods use Qwen2.5-14B-Instruct [17] as the frozen backbone, where generation and interaction are constrained by computation and latency. In the API-based setting, all methods use DeepSeek-V4-Flash [26] through an external API, where model generation and repeated interaction directly incur inference cost. The backbone remains frozen throughout evaluation, so adaptation occurs solely through external memory mechanisms.

Resource-constrained protocol. Following § 3, we evaluate all methods under a stringent joint resource budget that constrains generation, interaction, persistent memory capacity, and memory injection. Within each environment and deployment setting, all methods process the same task stream under the same resource budget. All language-model generation incurred by a method, including auxiliary calls for memory construction, reflection, or skill extraction, is counted toward the same per-task generation budget Omax⁡O_{\max}. This controlled protocol allows us to examine the effectiveness of experience-driven adaptation when both task execution and experience reuse are severely constrained. Across DB, OS, and KG, memory capacity is 64 and at most one memory is retrieved per task. The respective output-token budgets are 128, 512, and 128, with interaction limits of 3, 5, and 15 rounds. These results characterize effectiveness under this fixed stringent budget; we do not claim robustness across a range of budget levels.

Baselines. We compare TokenWorth with a no-memory agent (Standard), vanilla retrieval-augmented generation (RAG) [15], and representative lifelong-memory methods, including MemRL [32], Mem0 [5], MemP [7], MemSkill [30], Reflexion [19], EvoSC [28], and EvoSkill [1]. All methods share the same frozen backbone, task stream, and resource budget within each setting.

Metrics. We evaluate task effectiveness using task success rate (SR ↑\uparrow). To measure generation efficiency, we report the average number of output tokens per task (OutputTok ↓\downarrow), including all language-model generation incurred during task execution and method-specific auxiliary operations such as memory construction, reflection, or skill extraction. We further report the relative change in output-token usage with respect to the no-memory Standard agent:

ΔTok=OutputTokmethod−OutputTokStandardOutputTokStandard×100%,\Delta\mathrm{Tok} = \frac{\mathrm{OutputTok}_{\mathrm{method}}-\mathrm{OutputTok}_{\mathrm{Standard}}}{\mathrm{OutputTok}_{\mathrm{Standard}}} \times100\%,

where a negative value indicates lower generation consumption than the no-memory baseline.

Results and Analysis

RQ1: Can TokenWorth support effective experience-driven adaptation under stringent resource constraints? Table 1 reports the main results on LifelongAgentBench. TokenWorth achieves the highest task success rate in all six environment–deployment combinations, demonstrating the effectiveness of its feedback-driven memory adaptation framework across both local and API-based backbones.

MethodLocal: Qwen2.5-14B-Instruct DBLocal: Qwen2.5-14B-Instruct OSLocal: Qwen2.5-14B-Instruct KGAPI: DeepSeek-V4-Flash DBAPI: DeepSeek-V4-Flash OSAPI: DeepSeek-V4-Flash KG
Standard25.250.2<u>30.7</u>26.267.212.7
RAG<u>33.0</u><u>54.6</u>11.329.466.631.3
MemRL28.052.24.730.466.2<u>32.0</u>
Mem021.250.6<u>30.7</u><u>32.2</u>68.815.3
MemP23.446.827.328.069.821.3
MemSkill24.450.826.027.466.020.7
Reflexion22.048.830.030.667.214.7
EvoSC19.250.227.330.6<u>70.2</u>18.7
EvoSkill24.649.630.025.668.414.7
TokenWorth65.059.436.762.273.236.7

Table 1. Task success rate (%) on LifelongAgentBench under stringent joint resource constraints. Best results are shown in bold and second-best results are <u>underlined</u>.

Under the local deployment, the improvement is particularly pronounced on DB, where TokenWorth reaches 65.0%, outperforming the strongest baseline RAG (33.0%) by 32.0 percentage points. It also improves the strongest baseline by 4.8 points on OS and 6.0 points on KG. The same pattern holds under the API-based deployment: TokenWorth improves the best competing method by 30.0 points on DB, 3.0 points on OS, and 4.7 points on KG. Notably, several memory-based methods provide limited gains over the no-memory Standard agent and can even substantially underperform it, particularly on KG. These results suggest that accumulating and reusing experience alone does not guarantee effective adaptation. Learning which experiences are worth reusing is particularly important when generation, interaction, and memory resources are jointly constrained.

RQ2: Can effective experience reuse improve generation efficiency? Figure 3(a) compares TokenWorth’s output-token usage across the six LifelongAgentBench environment–deployment combinations. We report the relative change with respect to the no-memory Standard agent, while the diamonds indicate the most token-efficient competing method. TokenWorth achieves the lowest output-token usage in all six settings.

Efficiency and component analysis of TokenWorth

Figure 3. (a) Output-token usage relative to the no-memory Standard agent; diamonds indicate the most token-efficient competitor in each setting. (b) Core ablation on DB with the local backbone. The truncated vertical axis should be interpreted alongside the reported values.

Under the local Qwen2.5-14B-Instruct deployment, TokenWorth reduces output generation by 9.3%, 51.5%, and 18.7% on DB, OS, and KG, respectively. Under DeepSeek-V4-Flash, the corresponding reductions are 31.6%, 58.3%, and 21.3%. The reduction is particularly substantial on OS, where TokenWorth uses less than half the output tokens of the Standard agent under both deployments.

These savings accompany the highest success rate in all six settings (Table 1). TokenWorth also uses fewer output tokens than the most generation-efficient baseline in each setting, with clear margins on DB and OS. Although the margin over MemRL on API-based KG is smaller, TokenWorth still improves both success and token usage. These results suggest that learning to reuse higher-value experience helps the frozen backbone solve more tasks with less generation, supporting resource-efficient experience-driven adaptation.

RQ3: How do the adaptation components affect memory-worth learning? Figure 3(b) reports a core ablation on DB with Qwen2.5-14B-Instruct. We compare the base scorer alone (Base Only), the base scorer augmented with an RFM residual learner using a fixed feature metric (Base + RFM), and the full framework with AGOP-based feature adaptation (Full).

The base scorer achieves 64.2%, demonstrating the effectiveness of stable, interpretable memory signals. Adding the RFM residual learner with a fixed feature metric reduces performance to 63.0%, indicating that nonlinear residual modeling alone does not necessarily improve memory-worth estimation. With AGOP-based feature adaptation, the full framework reaches 65.0%, recovering this degradation and modestly outperforming the base-only variant. These results suggest that adaptive feature geometry improves residual corrections under sparse execution feedback, highlighting the importance of balancing stability and adaptivity in online memory-worth learning.

Conclusion

We study experience-driven adaptation in lifelong agents under joint constraints on generation, interaction, and memory. We propose TokenWorth, a lightweight feedback-driven memory adaptation framework that learns query-dependent memory worth from online execution feedback and uses it for retrieval and bounded memory management. Across three LifelongAgentBench environments and local and API-based backbones, TokenWorth achieves the highest task success rates among evaluated methods while using the fewest output tokens. Additional experiments show competitive performance on coding and embodied-agent tasks. These results suggest that resource-efficient self-improvement depends not on accumulating more experience, but on learning what is worth remembering. Since feedback is observed only for selected memories, their causal contributions remain unidentified. Developing budget-efficient credit assignment remains an important direction for future work.

Acknowledgments and Disclosure of Funding

This work was supported by the National Key R&D Program of China under Grant No. 2024YFE0202800 and the National Natural Science Foundation of China under Grant Nos. 62522605 and 62376118.

Additional Experimental Details

Benchmarks

Our main experiments use three environments from LifelongAgentBench [34]: database interaction (DB), operating-system interaction (OS), and knowledge-graph interaction (KG). Tasks are processed sequentially, and only experience from preceding tasks may be reused. DB requires structured database operations and answers grounded in retrieved observations. OS requires multi-step system management through Bash commands. KG follows an AgentBench-style protocol in which the agent interacts with a knowledge graph through structured tool calls, while SPARQL queries are executed by the backend. The environments thus cover heterogeneous forms of interactive decision making under a shared online lifelong-learning protocol.

We additionally evaluate online lifelong variants of BigCodeBench [38] and ALFWorld [20]; their results are reported in Appendix § 10.

Beyond language agents, class-incremental learning has examined the impact of task ordering on continual adaptation [12] and the variability of performance across evaluation sequences [14]. These studies highlight the importance of evaluation protocols in continual learning, while our experiments focus on online memory adaptation under fixed resource budgets.

Baselines

We compare TokenWorth with a no-memory agent (Standard), retrieval-augmented generation (RAG), and representative memory- and skill-learning methods.

Standard. The frozen backbone solves every task independently, without persistent cross-task memory.

RAG. RAG [15, 22, 23] stores successful experiences and retrieves them by lightweight textual relevance, without online value learning.

MemRL. MemRL [32] uses execution feedback to learn utility signals for episodic memories, serving as a value-aware baseline.

Mem0. Mem0 [5] supports memory extraction, storage, retrieval, and update in long-running agents.

MemP. MemP [7] retains procedural task experience for later reuse.

MemSkill. MemSkill [30] converts experience into reusable memory skills and evolves them online.

Reflexion. Reflexion [19] stores verbal reflections derived from task feedback for reuse in subsequent tasks.

EvoSC. EvoSC [28] consolidates and evolves agent experience.

EvoSkill. EvoSkill [1] extracts reusable skills from interaction trajectories and updates its skill repository.

Within each environment and deployment setting, methods share the same task sequence, backbone, environment interface, and resource budget. We preserve baseline-specific auxiliary operations such as reflection, memory construction, and skill extraction; their generated output tokens are included in both the per-task budget and the reported OutputTok. Baseline implementations are adapted to satisfy the common resource limits.

Backbones and Deployment Settings

Local deployment. All methods use the frozen Qwen2.5-14B-Instruct [17] backbone on NVIDIA A800 GPUs.

API-based deployment. All methods use the frozen DeepSeek-V4-Flash [26] backbone through an external inference API.

In both deployments, the memory bank starts empty, task order is fixed within an environment, and no backbone parameters are updated. TokenWorth uses neither offline pretraining nor task replay or counterfactual re-execution.

Evaluation Protocol

We measure task effectiveness with task success rate (SR ↑). A task succeeds only if the environment evaluator marks its final answer or state as correct. Generation efficiency is measured by average output tokens per task (OutputTok ↓), including tokens from task execution and all method-specific auxiliary language-model calls. Relative to Standard,

ΔTok=OutputTokmethod−OutputTokStandardOutputTokStandard×100%.\Delta\mathrm{Tok} = \frac{\mathrm{OutputTok}_{\mathrm{method}}-\mathrm{OutputTok}_{\mathrm{Standard}}}{\mathrm{OutputTok}_{\mathrm{Standard}}} \times100\%.

Negative values indicate fewer generated tokens. OutputTok does not include input tokens or controller-side computation and should not be interpreted as total inference cost.

Implementation Details of TokenWorth

Common Online Implementation

Online feedback protocol. At the beginning of task tt, retrieval uses the bank BtB_t and feedback available through task t−1t-1. Task tt is executed once. Following its completion, the observed reward updates the worth model and the selected memory’s statistics, and memory admission or eviction constructs Bt+1B_{t+1}. These updates may affect task t+1t+1 and later tasks; there is no same-task counterfactual execution or backbone fine-tuning.

Lightweight text representation. We construct deterministic 512-dimensional text vectors by token hashing and character 3–5-gram hashing, followed by ℓ2\ell_2 normalization. This representation requires no learned encoder and captures lightweight textual similarity rather than learned semantic embeddings. For a query qq and memory mm, the residual input is

z(q,m)=[∣eq−em∣,cos⁡(eq,em),um,rel⁡(m),rec⁡(m),freq⁡(m)].\mathbf{z}(q,m)=\left[\lvert\mathbf{e}_q-\mathbf{e}_m\rvert,\cos(\mathbf{e}_q,\mathbf{e}_m),u_m,\operatorname{rel}(m),\operatorname{rec}(m),\operatorname{freq}(m)\right].

Here umu_m is historical utility. With hmh_m and dmd_m denoting counts of successful and unsuccessful executions, respectively, conditioned on selecting mm, the other statistics are

rel⁡(m)=hm+1hm+dm+2,\operatorname{rel}(m)=\frac{h_m+1}{h_m+d_m+2},
rec⁡(m)=exp⁡(−κΔtm),\operatorname{rec}(m)=\exp(-\kappa\Delta t_m),
freq⁡(m)=cmmax⁡(1,t−τm+1).\operatorname{freq}(m)=\frac{c_m}{\max(1,t-\tau_m+1)}.

Here Δtm\Delta t_m is the number of steps since last access, cmc_m is the access count, and τm\tau_m is the creation step. We set κ=0.02\kappa=0.02. The success and failure counts are execution-derived statistics, not causal estimates of a memory’s effect.

Candidate recall and base scorer. The bank is screened by lightweight textual relevance to form

Ct=TopK⁡κc{srecall(qt,m):m∈Bt}.C_t=\operatorname{TopK}_{\kappa_c}\{s_{\mathrm{recall}}(q_t,m):m\in B_t\}.

For each candidate, define ϕ(q,m)=[ϕsim,ϕutil,ϕrel,ϕrecent]\boldsymbol{\phi}(q,m)=[\phi_{\mathrm{sim}},\phi_{\mathrm{util}},\phi_{\mathrm{rel}},\phi_{\mathrm{recent}}] and sbase,t(q,m)=wtTϕ(q,m)s_{\mathrm{base},t}(q,m)=\mathbf{w}_t^{\mathsf{T}}\boldsymbol{\phi}(q,m). We initialize w0=[1.0,0.10,0.10,0.02]\mathbf{w}_0=[1.0,0.10,0.10,0.02] and fit

Lbase(w)=∑(ϕj,yj)∈Dtbaselog⁡(1+exp⁡(−yjwTϕj))+λw∥w−w0∥22.\mathcal{L}_{\mathrm{base}}(\mathbf{w})= \sum_{(\phi_j,y_j)\in D_t^{\mathrm{base}}} \log\left(1+\exp(-y_j\mathbf{w}^{\mathsf{T}}\phi_j)\right) +\lambda_w\lVert\mathbf{w}-\mathbf{w}_0\rVert_2^2.

The FIFO training window contains at most 256 selected query–memory pairs, with yj∈{−1,+1}y_j \in\{-1,+1\}. We use λw=0.1\lambda_w = 0.1 and refit after every 50 new feedback examples using deterministic Newton optimization with backtracking line search. Updated weights are smoothed with coefficient βw=0.5\beta_w = 0.5 and clipped coordinate-wise between [0,0,0,0][0,0,0,0] and [2.0,1.0,1.0,1.0][2.0,1.0,1.0,1.0].

Residual worth estimation. The combined score and selected memory are

st(q,m)=sbase,t(q,m)+ηtft(z(q,m)),mt⋆=arg⁡max⁡m∈Ct st(qt,m).s_t(q,m) = s_{\mathrm{base},t}(q,m) + \eta_t f_t(z(q,m)), \qquad m_t^\star= \underset{m\in\mathcal{C}_t}{\arg\max}\ s_t(q_t,m).

To avoid abrupt residual corrections during early adaptation, we linearly increase the residual coefficient over the first three KRR fits:

ηt=ηmax⁡min⁡{nKRR(t)3,1}.\eta_t = \eta_{\max}\min\left\{\frac{n_{\mathrm{KRR}}(t)}{3},1\right\}.

where nKRR(t)n_{\mathrm{KRR}}(t) denotes the number of completed KRR fits and ηmax⁡\eta_{\max} is the environment-specific coefficient given in Table A1. For a task reward rt∈{0,1}r_t \in\{0,1\}, the execution label and residual target are

SettingDBOSKG
Generation budget Omax⁡O_{\max}128512128
Interaction budget Jmax⁡J_{\max}3515
Memory capacity Bmax⁡B_{\max}646464
Retrieved memories Kmax⁡K_{\max}111
Injection budget Lmax⁡L_{\max}900 chars800 chars4096 chars
Candidate pool size KcK_c121212
KRR update interval502525
AGOP update interval200100100
Residual influence η\eta0.150.050.10
RFM warm-up feedback4424

Table A1. Environment-specific resource and adaptation configurations for LifelongAgentBench.

yt=2rt−1,y^tbase=2σ(sbase,t(qt,mt⋆))−1,δt=yt−y^tbase.y_t = 2r_t - 1, \qquad\widehat{y}^{\mathrm{base}}_t = 2\sigma\left(s_{\mathrm{base},t}(q_t,m_t^\star)\right) - 1, \qquad\delta_t = y_t - \widehat{y}^{\mathrm{base}}_t.

Only the selected pair (qt,mt⋆)(q_t,m_t^\star) receives feedback. These labels reflect downstream task outcomes, not same-task comparisons among memories.

Kernel ridge regression and AGOP. The residual predictor fits kernel ridge regression (KRR) to a FIFO window of at most 128 feedback pairs {(zj,δj)}\{(z_j,\delta_j)\}, using the Laplacian kernel

KMt(z,z′)=exp⁡[−γ(z−z′)⊤Mt(z−z′)].K_{M_t}(z,z') = \exp\left[-\gamma\sqrt{(z-z')^\top M_t(z-z')}\right].

with λKRR=0.01\lambda_{\mathrm{KRR}} = 0.01 and γ=1.0\gamma= 1.0. The metric MtM_t is diagonal. Fast KRR coefficients are periodically refitted; slower feature-geometry updates use the diagonal Average Gradient Outer Product (AGOP):

G~t=Diag⁡(1Ns∑j=1Ns∇zft(zj)⊙∇zft(zj)),\widetilde{G}_t = \operatorname{Diag}\left(\frac{1}{N_s}\sum_{j=1}^{N_s}\nabla_z f_t(z_j)\mathbin{\odot}\nabla_z f_t(z_j)\right),
Mt+1=NormClip⁡((1−βM)Mt+βMG~t).M_{t+1} = \operatorname{NormClip}\left((1-\beta_M)M_t+\beta_M\widetilde{G}_t\right).

The slow window contains at most 256 feedback examples. We set βM=0.25\beta_M = 0.25, clip diagonal weights to [0.05,8.0][0.05,8.0], and normalize them to mean 1. KRR is refitted after every AGOP update; update intervals are listed in Table A1.

Execution-derived memory statistics. A newly created memory starts with utility u(m)=1.0u(m)=1.0. After a task with selected memory mt⋆m_t^\star, its utility is updated without an EMA:

ut(mt⋆)=clip⁡(ut−1(mt⋆)+{+0.25,rt=1,−0.45,rt=0,−2,5).u_t(m_t^\star)=\operatorname{clip}\left(u_{t-1}(m_t^\star)+ \begin{cases} +0.25, & r_t=1,\\ -0.45, & r_t=0, \end{cases} -2,5\right).

Successful (unsuccessful) task execution with the selected memory increments hmh_m (dmd_m). Access count and recency are updated after each use.

Memory admission, replacement, and eviction. Only externally verified successful tasks produce candidate memories. While ∣Bt∣<Bmax⁡|\mathcal{B}_t| < B_{\max}, each eligible candidate is admitted to establish coverage. For a full bank, let mnearm_{\mathrm{near}} denote the nearest existing memory in the same hashed textual representation. Define

nov⁡t(mnew)=1−max⁡mi∈Btcos⁡(enew,ei),\operatorname{nov}_t(m_{\mathrm{new}})=1-\max_{m_i\in\mathcal{B}_t}\cos(e_{\mathrm{new}},e_i),
Vt(m)=1∣Pt∣∑q∈Ptst(q,m),V_t(m)=\frac{1}{|\mathcal{P}_t|}\sum_{q\in\mathcal{P}_t}s_t(q,m),
ρˉt+(mnew)=1∣Pt∣∑q∈PtI[st(q,mnew)>0].\bar{\rho}^{+}_t(m_{\mathrm{new}})=\frac{1}{|\mathcal{P}_t|}\sum_{q\in\mathcal{P}_t}\mathbb{I}[s_t(q,m_{\mathrm{new}})>0].

The probe set Pt\mathcal{P}_t includes the current query and up to eight previous queries on which memory retrieval occurred (FIFO), hence ∣Pt∣≤9|\mathcal{P}_t| \le9. The positive-score ratio ρt+\rho_t^{+} measures the fraction of probe queries for which the candidate receives a positive worth score, rather than the fraction on which it outperforms the nearest memory.

For a full bank, a candidate passes the admission gate if

nov⁡t(mnew)>τnov\operatorname{nov}_t(m_{\mathrm{new}}) > \tau_{\mathrm{nov}}
∨[Vt(mnew)>max⁡m∈BtVt(m)+δwrite∧ρt+(mnew)≥τpos].\lor\left[V_t(m_{\mathrm{new}}) > \max_{m\in B_t} V_t(m) + \delta_{\mathrm{write}} \land\rho_t^{+}(m_{\mathrm{new}}) \ge\tau_{\mathrm{pos}}\right].

where τnov=0.35\tau_{\mathrm{nov}} = 0.35, δwrite=0.02\delta_{\mathrm{write}} = 0.02, and τpos=0.45\tau_{\mathrm{pos}} = 0.45. Thus, admission requires either sufficient novelty or a worth improvement over the best existing memory together with a sufficiently high positive-score ratio.

Candidates passing this admission gate are added to the bank. The capacity bound is then enforced by evicting the memory with the lowest probe-averaged worth from the enlarged bank:

mevict=arg⁡min⁡m∈Bt∪{mnew}  Vt(m),∣Bt+1∣≤Bmax⁡.m_{\mathrm{evict}} = \underset{m\in B_t\cup\{m_{\mathrm{new}}\}}{\arg\min}\; V_t(m), \qquad|B_{t+1}| \le B_{\max}.

The newly admitted candidate may itself be evicted if it has the lowest probe-averaged worth.

If the candidate fails the admission gate, the controller instead considers direct replacement of its nearest existing memory. Replacement occurs only when the nearest memory has low utility and the candidate exceeds its probe-averaged worth by a larger margin:

u(mnear)<τutil=0.5,Vt(mnew)>Vt(mnear)+δrep,δrep=0.10.u(m_{\mathrm{near}}) < \tau_{\mathrm{util}} = 0.5,\qquad V_t(m_{\mathrm{new}}) > V_t(m_{\mathrm{near}}) + \delta_{\mathrm{rep}},\qquad\delta_{\mathrm{rep}} = 0.10.

When both conditions hold, mnewm_{\mathrm{new}} directly replaces mnearm_{\mathrm{near}} without invoking the lowest-worth eviction rule. Candidates satisfying neither the admission gate nor the fallback replacement conditions are rejected.

Common Hyperparameters

The main common parameters are w0=[1.0,0.10,0.10,0.02]\mathbf{w}_0 = [1.0, 0.10, 0.10, 0.02], λw=0.1\lambda_w = 0.1, βw=0.5\beta_w = 0.5, λKRR=0.01\lambda_{\mathrm{KRR}} = 0.01, γ=1.0\gamma= 1.0, βM=0.25\beta_M = 0.25, and κ=0.02\kappa= 0.02. The base, fast KRR, and slow AGOP feedback windows contain at most 256, 128, and 256 examples, respectively. The shared memory-management thresholds are τnov=0.35\tau_{\mathrm{nov}} = 0.35, δwrite=0.02\delta_{\mathrm{write}} = 0.02, τpos=0.45\tau_{\mathrm{pos}} = 0.45, and δrep=0.10\delta_{\mathrm{rep}} = 0.10. Further bounds and update rules are specified in Appendix B above, and the environment-dependent settings in Table A1.

Environment-Specific Configuration

TokenWorth uses the same worth-learning method across DB, OS, and KG, with resource limits and online-update intervals adapted to the environment.

Environment-Specific Memory Construction

DB. Successful tasks are stored as compact demonstrations containing the question, valid SQL actions, truncated database observations, and final answer. Invalid actions and unnecessary output are omitted.

OS. Complete shell trajectories contain instance-specific paths, user names, and process identifiers that transfer poorly. We retain concise patterns from successful Bash actions, including permission management, batch file processing, text editing, symbolic links, and process management. A task is successful when the environment evaluator reports correct, including when the interaction limit is reached after a correct final state.

KG. Memories contain successful knowledge-graph tool calls and truncated knowledge-graph observations, rather than SPARQL queries executed by the backend. KG allows up to 15 interaction rounds and 4096 characters of injected memory; residual adaptation starts after at least 24 query–memory feedback pairs. In all three environments, TokenWorth first screens up to Kc=12K_c = 12 memories and injects at most one selected experience.

Generalization Beyond LifelongAgentBench

We evaluate online lifelong variants of BigCodeBench [38] (code generation) and ALFWorld [20] (text-based embodied decision making). Each run starts without stored experience from benchmark tasks. Tasks are processed sequentially, with retrieval using only preceding experience. Memory is updated after the current task has been evaluated, without access to future tasks. The language-model backbone remains frozen throughout each run.

BigCodeBench. We use BigCodeBench Full v0.1.4 in the Instruct format, comprising 1,140 coding problems. Each method makes a single pass through the same deterministic sequence: the 992 problems in Full excluding Hard, followed by the 148 problems in the Hard subset. Within these two groups, we preserve the order of the pinned Full and Hard dataset files, respectively; no random shuffling is applied. The memory bank is carried across the two groups without resetting. For each problem, the agent generates one solution, which is sanitized and evaluated using BigCodeBench’s official execution-based evaluator inside a Docker worker. A problem succeeds only when the evaluator returns pass; generated-code failures and execution timeouts count as unsuccessful outcomes. Evaluator infrastructure errors invalidate the run. We report pass@1 over all 1,140 problems, counting each problem once. Memory is updated after evaluation, and previously evaluated problems are not revisited. The local deployment uses Qwen2.5-14B-Instruct. The API deployment uses DeepSeek-V4-Flash with thinking explicitly disabled. Both deployments use temperature zero. Reference solutions and unit tests are excluded from the model’s memory and input prompts.

ALFWorld. We use Qwen2.5-14B-Instruct as the frozen backbone, with temperature zero and top-pp equal to one. A complete run contains 574 episodes: 300 training episodes selected by task-type-stratified sampling, all 140 validation-seen episodes, and all 134 validation-unseen episodes. The phases run in this order. The base seed is 42; the sampling and ordering routines use seeds 42, 43, and 44 for the three phases, respectively. Within each phase, game paths are sorted, shuffled within task-type groups using the phase seed, and selected by round-robin traversal of the groups. The resulting ordered episode manifest is fixed and shared across methods, and the runner checks that the environment follows this order. Each selected episode is executed once. An episode succeeds when TextWorld’s external won flag indicates task completion. The success rate reported here is the total number of successful episodes divided by 574, including all three phases; it is not an unweighted average of phase success rates. Memory persists across phase boundaries and is updated after every completed episode, including validation-seen and validation-unseen episodes. Thus, this is an online lifelong protocol rather than evaluation with memory frozen after training. Expert trajectories are excluded from memory.

Resource accounting. We follow the resource-constrained evaluation principle in § 3, using benchmark-specific limits. Within each benchmark and deployment, methods share the backbone, ordered task stream, solver-call output limit, and, for ALFWorld, interaction controller. Memory contexts are bounded by the complete injected block, including its headings and separators. Injection lengths below are measured in characters. The two adapters enforce output limits per model call, rather than pooling all calls into a single per-task output allowance. Method-specific auxiliary calls, including memory construction, reflection, and skill extraction, have a separate limit of 512 output tokens per call. Their actual usage is recorded in addition to solver usage, including action repairs in ALFWorld. TokenWorth makes no auxiliary language-model calls. Consequently, the methods share per-call limits but need not consume equal total output tokens per task or episode.

BigCodeBench configuration. The solver output limit is Omax⁡=1280O_{\max} = 1280 tokens per call for both the local and API deployments. Auxiliary API calls have thinking disabled. TokenWorth uses a memory capacity of Bmax⁡=50B_{\max} = 50 records, injects at most Kmax⁡=1K_{\max} = 1 record, and caps the complete injection block at Lmax⁡=4096L_{\max} = 4096 characters. Each stored experience is also capped at 4096 characters. BM25 recalls at most Kc=12K_c = 12 candidates for learned worth ranking. All TokenWorth representation, learning, and memory-management parameters are identical across the local and API deployments; the solver output budget and thinking setting follow the selected deployment.

ALFWorld configuration. The interaction limit is Jmax⁡=50J_{\max} = 50 environment steps per episode. Each action-generation call has an output limit of Omax⁡=128O_{\max} = 128 tokens. An inadmissible action permits at most one repair call for that step, also capped at 128 output tokens. These are per-call limits, not a 128-token allowance for the entire episode. The same action controller is used for all methods, with memory-dependent loop removal disabled. TokenWorth uses Bmax⁡=128B_{\max} = 128 records, Kmax⁡=1K_{\max} = 1, a complete injection budget of Lmax⁡=4200L_{\max} = 4200 characters, a per-experience limit of 4096 characters, and a BM25 candidate pool of at most Kc=12K_c = 12.

Online learning configuration. Both benchmarks use the same deterministic 512-dimensional hashing representation of tokens and character 3–5-grams. Only a memory actually injected into the agent receives outcome supervision. KRR and AGOP updates are scheduled every 75 and 225 accumulated feedback examples, respectively, with FIFO buffers of 128 and 256 examples. These counters track feedback examples, not elapsed tasks or episodes. Each scheduled residual fit requires at least four feedback examples; this minimum does not trigger an immediate fit at the fourth example. Under these settings, the first scheduled KRR fit occurs at feedback example 75. The residual coefficient is ηt=0.10min⁡(1,ut/3)\eta_t = 0.10 \min(1, u_t/3), where utu_t is the number of completed KRR fits: its influence ramps linearly over the first three fits. KRR uses ridge regularization 0.01 and Laplacian-kernel scale 1. AGOP uses smoothing 0.25, clips the updated diagonal metric to [0.05,8][0.05, 8], normalizes it to have mean one, and immediately refits KRR. The base scorer is refitted every 50 feedback examples, using a FIFO of 256, regularization 0.1, and smoothing 0.5. Successful interactions can create new experiences; unsuccessful interactions provide negative feedback to injected memories without creating successful-experience records.

Table A2 shows that TokenWorth achieves 43.1% on local BigCodeBench and 73.5% on local ALFWorld, exceeding the best competitors by 0.2 and 0.3 percentage points, respectively. On API-based BigCodeBench, TokenWorth reaches 50.6%, below RAG’s 50.9%. These small margins support competitive transfer rather than consistent dominance beyond the three main interactive environments.

MethodLocal: Qwen2.5-14B-Instruct — BigCodeLocal: Qwen2.5-14B-Instruct — ALFWorldAPI: DeepSeek-V4-Flash — BigCode
Standard41.759.149.9
RAG42.6<u>73.2</u>50.9
MemRL42.969.750.5
Mem041.764.150.2
MemP42.366.449.6
MemSkill42.963.649.1
Reflexion40.869.249.0
EvoSC42.665.049.6
EvoSkill41.864.848.8
TokenWorth43.173.5<u>50.6</u>

Table A2. Task success rate (%) on additional generalization benchmarks. Best results are bold; second-best results are <u>underlined</u> (including ties).

Hyperparameter Sensitivity

We evaluate the sensitivity of TokenWorth to its key hyperparameters on the same 500-task DB stream using Qwen2.5-14B-Instruct. Starting from the default configuration, which achieves a 65.0% task success rate, we vary one parameter at a time while keeping all others fixed. Table A3 summarizes the results.

ParameterDefaultTested valueSR (%)Δ\Delta (pp)
RFM influence η\eta0.150.0562.4−2.6-2.6
RFM influence η\eta0.150.1063.8−1.2-1.2
RFM influence η\eta0.150.2064.2−0.8-0.8
RFM influence η\eta0.150.3064.0−1.0-1.0
Base regularization λw\lambda_w0.100.0364.8−0.2-0.2
Base regularization λw\lambda_w0.100.3062.6−2.4-2.4
Base regularization λw\lambda_w0.101.0063.0−2.0-2.0
Base smoothing0.500.2564.2−0.8-0.8
Base smoothing0.500.7562.8−2.2-2.2
Base smoothing0.501.0062.6−2.4-2.4
Base update interval502565.2+0.2+0.2
Base update interval5010062.4−2.6-2.6
AGOP smoothing0.250.1064.4−0.6-0.6
AGOP smoothing0.250.5064.6−0.4-0.4
AGOP smoothing0.250.7562.2−2.8-2.8
KRR update interval502562.2−2.8-2.8
KRR update interval5010063.4−1.6-1.6
AGOP update interval20010062.6−2.4-2.4
AGOP update interval20040062.0−3.0-3.0
Kernel γ\gamma1.00.564.0−1.0-1.0
Kernel γ\gamma1.02.063.0−2.0-2.0

Table A3. Hyperparameter sensitivity on DB using Qwen2.5-14B-Instruct. The default configuration achieves 65.0% task success. Δ\Delta denotes the change in percentage points relative to the default.

TokenWorth maintains relatively stable performance under moderate changes to several hyperparameters. Varying the RFM influence η\eta between 0.10 and 0.30 results in performance differences of at most 1.2 percentage points, while adjusting AGOP smoothing between 0.10 and 0.50 leads to differences within 0.6 points. Reducing the base update interval from 50 to 25 yields a comparable success rate of 65.2%.

Larger deviations in adaptation settings lead to more pronounced performance degradation. Reducing η\eta to 0.05 decreases success by 2.6 points, while increasing AGOP smoothing to 0.75 causes a 2.8-point drop. The update schedules also play an important role: changing the KRR update interval from 50 to 25 reduces success by 2.8 points, while changing the AGOP interval from 200 to 100 or 400 decreases success by 2.4 and 3.0 points, respectively. These results highlight the importance of balancing adaptation speed and stability, supporting the conservative, two-timescale design of TokenWorth.

References

  1. [1]Salaheddin Alzubi, Noah Provenzano, Jaydon Bingham, Weiyuan Chen, and Tu Vu. Evoskill: Automated skill discovery for multi-agent systems. arXiv preprint arXiv:2603.02766, 2026.arxiv.org/abs/2603.02766
  2. [2]Daniel Beaglehole, David Holzmüller, Adityanarayanan Radhakrishnan, and Misha Belkin. xrfm: Accurate, scalable, and interpretable feature learning models for tabular data. In International Conference on Learning Representations, volume 2026, pages 146422–146454, 2026.arxiv.org/abs/2508.10053
  3. [3]Zhibao Chen and Qian Cheng. Learning what to remember: A cognitively grounded multi-factor value model for agentic memory. arXiv preprint arXiv:2606.12945, 2026.arxiv.org/abs/2606.12945
  4. [4]Junyan Cheng and Peter Chin. Sociodojo: Building lifelong analytical agents with real-world text and time series. In ICLR, 2024.
  5. [5]Prateek Chhikara, Dev Khant, Saket Aryan, Taranjeet Singh, and Deshraj Yadav. Mem0: Building production-ready ai agents with scalable long-term memory. arXiv preprint arXiv:2504.19413, 2025.arxiv.org/abs/2504.19413
  6. [6]Jinyuan Fang, Yanwen Peng, Xi Zhang, Yingxu Wang, Xinhao Yi, Guibin Zhang, Yi Xu, Bin Wu, Siwei Liu, Zihao Li, et al. A comprehensive survey of self-evolving ai agents: A new paradigm bridging foundation models and lifelong agentic systems. arXiv preprint arXiv:2508.07407, 2025.arxiv.org/abs/2508.07407
  7. [7]Runnan Fang, Yuan Liang, Xiaobin Wang, Jialong Wu, Shuofei Qiao, Pengjun Xie, Fei Huang, Huajun Chen, and Ningyu Zhang. Memp: Exploring agent procedural memory. In Findings of the Association for Computational Linguistics: ACL 2026, pages 17490–17502, 2026.arxiv.org/abs/2508.06433
  8. [8]Shubham Gupta. Ai agents collaboration under resource constraints: Practical implementations. International journal of artificial intelligence research and development, 3(1):51–63, 2025.DOI
  9. [9]Sina Hajimiri, Masih Aminbeidohkhti, Jose Dolz, Ismail Ben Ayed, Issam H Laradji, Spandana Gella, and Nicolas Gontier. Are online skill and memory modules always worth their tokens? a budget-constrained study of web agents. arXiv preprint arXiv:2606.15017, 2026.arxiv.org/abs/2606.15017
  10. [10]Guanyu Jiang, Zhaochен Su, Xiaoye Qu, and Yi R Fung. Xskill: Continual learning from experience and skills in multimodal agents. In ICML, 2026.
  11. [11]Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng, Lianmin Zheng, Cody Hao Yu, Joseph Gonzalez, Hao Zhang, and Ion Stoica. Efficient memory management for large language model serving with pagedattention. In Proceedings of the 29th symposium on operating systems principles, pages 611–626, 2023.arxiv.org/abs/2309.06180
  12. [12]Guannan Lai, Yujie Li, Xiangkun Wang, Junbo Zhang, Tianrui Li, and Xin Yang. Order-robust class incremental learning: Graph-driven dynamic similarity grouping. In 2025 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 4894–4904. IEEE, 2025.arxiv.org/abs/2502.20032
  13. [13]Guannan Lai, Da-Wei Zhou, Zhenguo Li, and Han-Jia Ye. The golden subspace: Where efficiency meets generalization in continual test-time adaptation. In CVPR, 2026.
  14. [14]Guannan Lai, Da-Wei Zhou, Xin Yang, and Han-Jia Ye. The lie of the average: How class incremental learning evaluation deceives you? In International Conference on Learning Representations, volume 2026, pages 110530–110562, 2026.arxiv.org/abs/2509.22580
  15. [15]Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tomáš Kočiský, et al. Retrieval-augmented generation for knowledge-intensive nlp tasks. NeurIPS, 2020.arxiv.org/abs/2005.11401
  16. [16]Weidi Luo, Shenghong Dai, Xiaogeng Liu, Suman Banerjee, Huan Sun, Muhao Chen, and Chaowei Xiao. Agrail: A lifelong agent guardrail with effective and adaptive safety detection. In ACL, 2025.arxiv.org/abs/2502.11448
  17. [17]Qwen Team. Qwen2.5: A party of foundation models, September 2024. URL https://qwenlm.github.io/blog/qwen2.5/.
  18. [18]Adityanarayanan Radhakrishnan, Daniel Beaglehole, Parthe Pandit, and Mikhail Belkin. Mechanism for feature learning in neural networks and backpropagation-free machine learning models. Science, 383(6690):1461–1467, 2024.DOI
  19. [19]Noah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan, and Shunyu Yao. Reflexion: Language agents with verbal reinforcement learning. NeurIPS, 2023.arxiv.org/abs/2303.11366
  20. [20]Mohit Shridhar, Xingdi Yuan, Marc-Alexandre Côté, Yonatan Bisk, Adam Trischler, and Matthew Hausknecht. Alfworld: Aligning text and embodied environments for interactive learning. arXiv preprint arXiv:2010.03768, 2020.arxiv.org/abs/2010.03768
  21. [21]Yiheng Shu, Bernal Jiménez Gutiérrez, Saisri Padmaja Jonnalagadda, Yuguang Yao, Huan Sun, and Yu Su. Agentctl: Toward rigorous evaluation of continual learning in language agents. arXiv preprint arXiv:2606.02461, 2026.arxiv.org/abs/2606.02461
  22. [22]Xu Sun, Tongkai Xu, Baiheng Xie, Li Huang, Qiang Gao, and Kunpeng Zhang. M-rag: Semantic key-value indexing for retrieval-augmented generation. arXiv e-prints, pages arXiv–2603, 2026.
  23. [23]Xun Sun, Baiheng Xie, Li Huang, and Qiang Gao. Scaling dpps for rag: Density meets diversity. arXiv preprint arXiv:2604.03240, 2026.arxiv.org/abs/2604.03240
  24. [24]Guanzhi Wang, Yuqi Xie, Yunfan Jiang, Ajay Mandlekar, Chaowei Xiao, Yuke Zhu, Linxi Fan, and Anima Anandkumar. Voyager: An open-ended embodied agent with large language models. TMLR, 2023.arxiv.org/abs/2305.16291
  25. [25]Beining Wu, Zihao Ding, Jun Huang, and Yanxiao Zhao. Forget to improve: On-device llm-agent continual learning via budget-curated memory. arXiv preprint arXiv:2606.25115, 2026.arxiv.org/abs/2606.25115
  26. [26]Anyi Xu, Bangcai Lin, Bing Xue, Bingxuan Wang, Bingzheng Xu, Bochao Wu, Bowei Zhang, Chaofan Lin, Chen Dong, Chenchen Ling, et al. Deepseek-v4: Towards highly efficient million-token context intelligence. arXiv preprint arXiv:2606.19348, 2026.arxiv.org/abs/2606.19348
  27. [27]Yutao Yang, Junsong Li, Qianjun Pan, Bihao Zhan, Yuxuan Cai, Lin Du, Jie Zhou, Kai Chen, Qin Chen, Xin Li, et al. Autosk ill: Experience-driven lifelong learning via skill self-evolution. arXiv preprint arXiv:2603.01145, 2026.arxiv.org/abs/2603.01145
  28. [28]Hongzhuo Yu, Fei Zhu, Guo-Sen Xie, and Ling Shao. Self-consolidation for self-evolving agents. arXiv preprint arXiv:2602.01966, 2026.arxiv.org/abs/2602.01966
  29. [29]Liangqi Yuan, Wenzhi Fang, Shiqiang Wang, H Vincent Poor, and Christopher G Brinton. Large language models over networks: Collaborative intelligence under resource constraints. arXiv preprint arXiv:2605.08626, 2026.arxiv.org/abs/2605.08626
  30. [30]Haozhen Zhang, Quanyu Long, Jianzhu Bao, Tao Feng, Weizhi Zhang, Haodong Yue, and Wেনya Wang. Memskill: Learning and evolving memory skills for self-evolving agents. arXiv preprint arXiv:2602.02474, 2026.arxiv.org/abs/2602.02474
  31. [31]Haozhen Zhang, Haodong Yue, Tao Feng, Quanyu Long, Jianzhu Bao, Bowen Jin, Weizhi Zhang, Xiao Li, Jiaxuan You, Chengwei Qin, et al. Learning query-aware budget-tier routing for runtime agent memory. arXiv preprint arXiv:2602.06025, 2026.arxiv.org/abs/2602.06025
  32. [32]Shengtao Zhang, Jiaqian Wang, Ruiwen Zhou, Junwei Liao, Yuchen Feng, Zhuo Li, Yujie Zheng, Weinan Zhang, Ying Wen, Zhiyu Li, et al. MemrI: Self-evolving agents via runtime reinforcement learning on episodic memory. arXiv preprint arXiv:2601.03192, 2026.arxiv.org/abs/2601.03192
  33. [33]Andrew Zhao, Daniel Huang, Quentin Xu, Matthieu Lin, Yong-Jin Liu, and Gao Huang. Expel: Llm agents are experiential learners. In AAAI, 2024.arxiv.org/abs/2308.10144
  34. [34]Junhao Zheng, Xidi Cai, Qiuke Li, Duzhen Zhang, ZhongZhi Li, Yingying Zhang, Le Song, and Qianli Ma. Lifelongagentbench: Evaluating llm agents as lifelong learners. arXiv preprint arXiv:2505.11942, 2025.arxiv.org/abs/2505.11942
  35. [35]Junhao Zheng, Chengming Shi, Xidi Cai, Qiuke Li, Duzhen Zhang, Chenxing Li, Dong Yu, and Qianli Ma. Lifelong learning of large language model based agents: A roadmap. TPAMI, 2026.DOI
  36. [36]Shanshan Zhong, Yi Lu, Jingjie Ning, Yibing Wan, Lihan Feng, Yuyi Ao, Leonardo FR Ribeiro, Markus Dreyer, Sean Amirati, and Chenyang Xiong. Skillearnbench: Benchmarking continual learning methods for agent skill generation on real-world tasks. arXiv preprint arXiv:2604.20087, 2026.arxiv.org/abs/2604.20087
  37. [37]Wanjun Zhong, Lianghong Guo, Qiqi Gao, He Ye, and Yanlin Wang. Memorybank: Enhancing large language models with long-term memory. In AAAI, 2024.arxiv.org/abs/2305.10250
  38. [38]Terry Yue Zhuo, Minh Chien Vu, Jenny Chim, Han Hu, Wenhao Yu, Ratnadira Widyasari, Imam Nur Bani Yusuf, Haolan Zhan, Junda He, Indraneil Paul, et al. Bigcodebench: Benchmarking code generation with diverse function calls and complex instructions. In International Conference on Learning Representations, volume 2025, pages 66602–66656, 2025.arxiv.org/abs/2406.15877

Paper details

vlnc:W_cn5584dm

published · Fresh — added to the Hub within the last 30 days

added ·

Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

CC BY 4.0

Original source

  • Computer Science

Not recorded for this paper · View statement →

Looking for related papers…
Contents