Engineering.Reference:26.4.4.4 - Choose a different estimator or a different learned memory operation
AGILE Appendix B.4 uses a heuristic instead of an estimated continuation value: when a later similar question exists in the training sequence, give bonus beta/(n+1), where n counts previous similar stored questions. In the initial fixture, beta=0.1 and n=0 give consultation proxy 0.8 against self-answering 0.75. With n=3 the proxy is 0.725; with no later recurrence it is 0.7. The bonus encodes recurrence and repetition. It does not measure the gain obtained in a later session. Use it as an alternative to the value construction, or derive a justified combined objective; adding it to an already credited future benefit would count that presumed benefit twice. Later questions can supply training labels while remaining unavailable during live action selection.
AGILE’s historical construction explains the session-value connection. Its released runner supplies dataset-correct consultation answers and cached reflection; that repository edition does not supply the Appendix A PPO trainer. A receiving implementation must provide the selected optimizer and any uncached reflection operation it requires. Compare a direct decision rule when the relevant consequence model is already known, as it is in the finite fixture.
If the target is learning how to extract facts and edit persistent memory, Memory-R2 v1, §§3–4 and Appendix A offers a different controlled-feedback construction. A shared model performs extraction and memory editing with different prompts. A fixed answering module evaluates the resulting memory on gold questions whose evidence is attributed to sessions. The construction proceeds as follows:
- Generate several full memory-construction trajectories from the same conversation. Cache each pre-session memory. Evaluate each terminal memory on the question subsets associated with each session, subtract the selected memory-size penalty, and standardize these rewards across full trajectories separately for each session.
- Select sessions for additional local trials. For each, choose one cached pre-session memory as the common starting point and generate several new executions of that session. Evaluate their resulting memories on that session’s question subset, with the same reward meaning at the local horizon, and standardize within this local group.
- Assign each extraction or editing step the advantage from its own global or local group. Keep old and current probabilities for its generated tokens and the histories in which they were generated. Train the shared model using the selected step reduction below; preserve the global branch because the session-local questions do not assess every later consequence.
- Begin with an affordable shorter horizon, retain a candidate selected using separate validation, and extend the number of sessions when the resulting memory operations support that use. The source uses 8, then 16, then 32 sessions; another task needs its own justified allowance.
The source reward uses mean answer F1 on the selected question subset. Its size penalty is max(0, memory_tokens - alpha*cumulative_input_tokens) / cumulative_input_tokens, scaled by lambda_comp and subtracted from that F1. Global rewards use terminal memory and terminal input length; local rewards use the selected session’s resulting memory and cumulative length through that session. Obtain nonempty evaluable question subsets and positive input length, or select a specified handling rule before computing this reward. Each advantage subtracts its own group’s mean and divides by its standard deviation plus a chosen positive stabilizer. For a receiving implementation, use the population standard deviation and retain that convention with the learning rate; equal group rewards then yield zero advantages.
Memory-R2 also changes the reduction. For a generated step u it forms rho_u = exp(mean_generated_tokens(log p_current - log p_old)), a geometric mean of token ratios, and assigns the group’s advantage to that step. Define f_epsilon(r,A)=min(r*A,clip(r,1-epsilon,1+epsilon)*A). Its dual-clipped reward surrogate is f_epsilon(rho_u,A) for nonnegative A and max(f_epsilon(rho_u,A),c*A) for negative A, with c>1. Minimize the negative mean of those step terms over both branches, minus beta_ent times mean token entropy, plus beta_kl times mean token KL divergence from the selected reference policy. Keep that reference distinct from the rollout policy supplying the old probabilities. This differs from averaging individually clipped token terms in 26.4.1. Choose the clipping, regularization, group sizes and local selection probability. The local selection probability changes both computation and the influence of local feedback.
This branch needs memory snapshots, a fixed answerer, gold answers with session-evidence attribution, and extra rollouts. With n full trajectories of T sessions and m local executions for each of b selected sessions, it uses n*T + m*b session executions before feedback costs. The local comparison isolates alternatives from one starting memory. Different actions normally produce different later states. Full-trajectory learning can use those later outcomes even when the states diverge. Select local trials for the attribution they can supply, and retain the full-horizon question.
Choose among a qualified value estimate, a heuristic and controlled memory trials according to the target operation, available observations and whole development cost. The learned consultation choice and the learned memory editor need different action records and feedback even when both serve later information use. Assess the resulting complete arrangement through SYSE.45:4.4, including stale entries, changed questions, fallible help and older useful behavior.