EconBase
← Back to paper

Handover of In-Context Learning State Across Session Boundaries

The exact contents of citations.db main_text.text for this paper — one flattened LaTeX string, title through conclusion, appendix excluded, unmodified except for removing email addresses. This is what our citation measures are computed over.

64,748 characters

Handover of In-Context Learning State Across Session Boundaries





\maketitle


\begin{abstract}
This study investigates the methodological and theoretical properties of session handover in applications that use large language models. A task may continue in a new session when the context reaches the model's input limit, when the application restarts, or when another agent is asked to finish the task. The application must then decide which information from the earlier session to pass on. We formulate handover as the transfer of a task-relative in-context learning (ICL) state and distinguish exact recovery of earlier material from preservation of the target distribution. Under an exogeneity condition, predictive equivalence characterizes the coarsest deterministic sufficient handover and gives a fixed-length bit requirement. The analysis isolates the effects of the memory constraint, the writer, and the continuation procedure, and quantifies the cost of writing before the realized downstream query is known. We propose a three-part record that stores decisions and constraints exactly, uses task-justified statistics for repeated evidence, and retains original observations whose effect is not preserved by those statistics. Gaussian linear regression gives an exact finite-dimensional handover and finite-bit perturbation bounds, while nonparametric regression gives upper and lower bounds that relate memory to squared prediction error. These results provide a theory and method for deciding what a handover must retain and how its memory requirement depends on the continuation task.
\end{abstract}


{\flushleft{{\bf Keywords:} session handover; in-context learning; predictive sufficiency; memory-constrained prediction; prompt compression}}


\section{Introduction}
\label{sec:introduction}

An application may call a large language model more than once while completing a task, and we call the application an \emph{agent} when the model chooses an action, the application executes it, and the result is included in a later call. A \emph{session} is a sequence of model calls that share the same earlier messages and tool results. The \emph{context} of a call is all information supplied to the model in that call. As the task continues, the context may reach the model's input limit and require the application to shorten the context or start a new session. A new session may also begin after the application restarts or when another agent is asked to finish the task. In the setting studied here, the new session receives only the information that the application passes on. We call the transition from one session to the next a \emph{session handover} or \emph{session handoff}, the information placed directly in the new session the \emph{handover record}, and the model or program that prepares the record the \emph{writer}. A file or database created from the earlier session is counted separately when the new session can still read it.

The handover record need not reproduce the earlier conversation, but it must retain the information on which the unfinished task still depends. A constraint may rule out an action, and examples in the earlier context may change a later prediction. Because a prose summary can omit either type of information, we judge the record by the prediction or action after the handover rather than by its similarity to the earlier wording.

Information from the earlier session can reach the next model call through the prompt or through a file or archive that the agent can read, and we count every such source because each one can affect the result. A key--value (KV) cache serves a different purpose: it stores values used by attention so that the model need not repeat earlier calculations, but it does not explicitly represent the task objective, commitments, or supporting observations. Because the application usually writes the handover before it knows the next query or tool result, the record must retain the information needed across the later inputs included in the evaluation.

This information order makes handover a pre-query state-coding problem, unlike query-aware prompt compression. The writer knows the task and the earlier context, but the continuation procedure observes the realized later input only after the record has been written. Classical tools from statistical sufficiency, Bayesian decision theory, comparison of experiments, and source coding can describe this order. We study which distinctions among earlier contexts remain relevant to the continuation, how a memory limit changes the attainable risk, and how pre-query encoding differs from compression performed after the later query is known.

\subsection{Research Questions}

We ask what the handover record must contain for the new session to preserve the prediction or decision available from the full earlier context and how much storage such a record requires. We also ask how to distinguish loss caused by missing information from loss caused by the continuation procedure that receives the record.

\subsection{Contributions}

We make four contributions to the analysis and construction of session handover.

\paragraph{Formulation and handover method.}
We model the writer, the prompt built from the handover record, the continuation procedure, and the task score separately, with the writer creating the record before the realized later input is known. This formulation distinguishes reproduction of the earlier text from preservation of the information needed for the task. Our method records decisions and constraints directly and uses a shorter representation for repeated examples or tool results only when that representation has an explicit guarantee or error bound for the task. When no such guarantee or bound is available, the method keeps selected original observations.

\paragraph{Task-relative state and memory limits.}
Predictive sufficiency identifies preservation with the conditional target law. Under an exogeneity condition, its equivalence classes give the coarsest deterministic sufficient handover and a direct fixed-length bit requirement. We further identify the capacity loss forced by the memory budget, the loss attributable to the chosen writer, and the gap between the continuation procedure and the ideal decoder for the same record. Under log loss, discarded task information is exactly a conditional mutual information. A separate lower bound quantifies the cost of writing before the realized query is observed.

\paragraph{Statistical analysis.}
Gaussian linear regression supplies an exact finite-dimensional sufficient record, an equivalent representation by synthetic sufficient demonstrations, and finite-bit perturbation bounds for posterior prediction. Nonparametric regression supplies an achievable memory--risk relation together with sample-size and memory lower bounds for the squared-loss problem considered below. The two models characterize when a handover can remain finite-dimensional and when its size must grow with target accuracy.

\paragraph{Comparison of handover records.}
A deterministic ordering result identifies when one record contains no more information than another. When two representations determine each other, their ideal risks are equal, so any difference under one fixed continuation procedure belongs to the procedure's gap from the ideal decoder and not to unequal task information. The memory account also includes every external record derived from the earlier session.

\section{Overview of Session Handover}
\label{sec:overview}

This section separates the boundary event from the information carried across it and from the current task state observed after resumption.

\subsection{Handover and the Handover Record}

Context carryover keeps earlier information available within the same session, but handover moves unfinished work to a new session or another agent. The record supplied at that boundary may be empty, incomplete, or sufficient for the continuation.

An \emph{external record} is a file or database produced during the earlier session and still available after resumption. Although it does not enter the first post-handover prompt automatically, it carries earlier information and counts toward total retained memory. Table~\ref{tab:overview-terms} distinguishes the current task state, which is observed only after resumption, from a KV cache, which stores attention state for computation and is not a task record.

\begin{table}[t]
\centering
\caption{Terms and objects used at a session boundary.}
\label{tab:overview-terms}
\small
\begin{tabularx}{\linewidth}{>{\raggedright\arraybackslash}p{0.25\linewidth}>{\raggedright\arraybackslash}p{0.44\linewidth}>{\raggedright\arraybackslash}X}
\toprule
Term or object & What it denotes & Use in this study \\
\midrule
Session handover or handoff & Event in which an unfinished task moves to a new session or another agent & Boundary being studied \\
\midrule
Handover record & Information placed directly in the new session & Record written and analyzed \\
\midrule
Current task state & Files, data, and runtime observed after the new session begins & Information obtained after the handover \\
\midrule
External record & File or database created from the earlier session and still available afterward & Included in retained memory when used \\
\midrule
KV cache & Cached attention keys and values for tokens already processed & Runtime cache, not task information \\
\bottomrule
\end{tabularx}
\end{table}

\subsection{Existing Approaches and the Remaining Problem}

Prompt compression shortens an input in an attempt to preserve the model's output. Because a compressor that sees the query first can remove information that the query does not use, it has an informational advantage over a handover writer, which usually writes before the downstream query or tool output is realized even though it knows the task and current goal \citep{Nagle2024fundamentallimit,Colaco2026keepforget}. The handover record must therefore support the set of later inputs included in the analysis.

Applications that make many model calls either shorten the prompt or store earlier text and tool results outside it \citep{Cim2026parallelcontext,Semenov2026compactionstructured}. Work on memory for agents separates writing, storage, retrieval, and later use \citep{Wu2025longmemevalbenchmarking,Hu2026evaluatingmemory,Shen2026mem2actbencha}. Our focus is narrower: the information a handover must preserve for a given continuation task, especially when the writer does not know the realized later input.

\citet{Baptista2026largelanguage} describes a trained language model through the distribution of output token sequences produced for a given prompt. We use this input--output description, place a writer before the later prompt is built, and score the resulting answer or trajectory against the task. Theory of in-context learning shows that transformers can use examples in the prompt to implement learning procedures \citep{Bai2023transformersas,VanOswald2023transformerslearn,Kim2024transformerslearn,Oko2024pretrainedtransformer}. The handover problem begins when those examples can no longer be supplied in full, and the record must retain the part that still affects the task. Appendix~\ref{app:memory-systems} compares this problem with current memory systems, prompt compression, and in-context learning.

\section{General Formulation of Session Handover}
\label{sec:formulation}

We now define the information available before and after a handover, the prompt shown to the model, the resulting response or trajectory, and the loss used for evaluation in both text-generation and interactive tasks. Section~\ref{sec:statistical-analysis} then specializes this formulation to regression.

\subsection{Episode and Information Available after the Handover}

We call one evaluation case an \emph{episode} and represent it by \(\omega=(C,T,X,Y)\), drawn from a distribution \(\mathsf P_{\mathrm{ep}}\). The pre-handover variable \(C\) contains the conversation, instructions, examples, and tool results, and \(T\) contains the task information known when the writer prepares the record, including the form of the target and the scoring rule. After the boundary, the application receives \(X\) as either a query or an observation of the current task state. The target \(Y\) is the answer, final state, or allowed action used for scoring.

After observing \((C,T)\), the handover writer \(E\) creates
\begin{equation}
  H=(V,M),
  \label{eq:complete-boundary-channel}
\end{equation}
where \(V\) is the record placed in the first prompt after the handover and \(M\) contains any file, index, or archive produced during the earlier session and still available afterward. Because \(H=(V,M)\) includes every retained source that the application may use, we call the handover \emph{self-contained} only when no external source is allowed and \(M=\varnothing\). A randomized writer satisfies
\begin{equation}
  H\sim P_E(\cdot\mid C,T).
  \label{eq:encoder-channel}
\end{equation}

The size of the first prompt and the total amount stored for the handover are different quantities. We write
\begin{equation}
  b_{\mathrm{act}}(V)\leq B_{\mathrm{act}},
  \qquad
  b_{\mathrm{tot}}(V,M)\leq B_{\mathrm{tot}},
  \label{eq:active-total-budgets}
\end{equation}
when both are bounded. A method may keep \(V\) short by moving earlier information into \(M\), which may grow as the task proceeds. Any comparison of handover methods must therefore report both quantities. In a self-contained comparison, the limit applies to all information in \((V,M)\), not only to the first prompt.

\subsection{From the Handover to a Model Response}

Fix a tokenizer, a vocabulary \(\mathcal V\) containing end-of-sequence and padding tokens, and a maximum response length \(L_{\mathrm{out}}\), and represent every response by a sequence \(Z_{1:L_{\mathrm{out}}}\in\mathcal V^{L_{\mathrm{out}}}\) padded after the end-of-sequence token. The maps \(s_{\mathrm{full}}\) and \(s_H\) then build one prompt from the full earlier context and another from the handover:
\begin{equation}
  p_{\mathrm{full}}=s_{\mathrm{full}}(C,X,T),
  \qquad
  p_H=s_H(H,X,T).
  \label{eq:full-handover-prompts}
\end{equation}
For a single model call, \(p_H\) includes every item read from \(M\) before generation begins. If the application can query \(M\) after it begins to act, the trajectory distribution below includes those queries.

Let \(\theta\) denote fixed model parameters, and let \(\delta\) denote a fixed decoding rule, including the temperature and any truncation of token probabilities. Together, the model and decoding rule define a conditional distribution \(\Pi_{\theta,\delta}(\cdot\mid p)\) on response sequences. For an autoregressive model, the response distribution factorizes as
\begin{equation}
  \Pi_{\theta,\delta}(z_{1:L_{\mathrm{out}}}\mid p)
  =\prod_{m=1}^{L_{\mathrm{out}}}
  \pi_{\theta,\delta,m}
  (z_m\mid p,z_{1:m-1}).
  \label{eq:autoregressive-response}
\end{equation}
A deterministic decoding rule assigns probability one to a single sequence, as in the standard probabilistic description of an autoregressive language model \citep{Baptista2026largelanguage}.

Let
\begin{equation}
  Z_{\mathrm{full}}
  \sim\Pi_{\theta,\delta}(\cdot\mid p_{\mathrm{full}}),
  \qquad
  Z_H
  \sim\Pi_{\theta,\delta}(\cdot\mid p_H).
  \label{eq:full-handover-responses}
\end{equation}
A deterministic parser \(g\), which may also use the task information \(T\), extracts the answer or action evaluated by the task's scoring rule. We call the program that applies the rule the \emph{evaluator}, and \(g\) returns the sequence unchanged when the sequence itself is scored. Its expected loss under the fixed model is
\begin{equation}
  R_{\mathrm{ep}}(E;\theta,\delta,g)
  =\mathbb{E}[\ell(g(Z_H,T),Y)],
  \label{eq:fixed-model-handover-risk}
\end{equation}
where the expectation is over \(\omega\sim\mathsf P_{\mathrm{ep}}\), the writer, and the response distribution. The reference based on the full earlier context is
\begin{equation}
  R_{\mathrm{ep}}^{\mathrm{full}}(\theta,\delta,g)
  =\mathbb{E}[\ell(g(Z_{\mathrm{full}},T),Y)].
  \label{eq:fixed-model-full-risk}
\end{equation}

In an interactive task, the agent chooses an action that the application executes against the files, data, or service used by the task, collectively called the \emph{environment}. After each action, the application returns an observation according to a rule \(Q\), and \(\tau\) denotes the resulting sequence of actions and observations after the handover. The writer, model, decoding rule, and environment then induce
\begin{equation}
  P_{E,\theta,\delta,Q}(d\tau\mid C,T,X)
  =\int P_E(dh\mid C,T)
  P_{\theta,\delta,Q}(d\tau\mid h,X,T).
  \label{eq:trajectory-distribution}
\end{equation}
The task assigns loss \(\ell(\tau,Y)\) to this trajectory, whose stepwise factorization appears in Appendix~\ref{app:analysis-results}. Regression in Section~\ref{sec:statistical-analysis} is the one-step case, in which the action is a prediction and the environment does not change before the prediction is scored.

For statements that apply across tokenizers and model families, we combine prompt construction, response generation, parsing, and environment updates into one rule \(D\), so that
\begin{equation}
  (C,T)\longrightarrow H=E(C,T),
  \qquad
  A=D(H,X,T),
  \label{eq:central-map}
\end{equation}
where \(A\) is an answer, an action, or a full trajectory.

\subsection{Recovery, Preservation of the Task, and Downstream Behavior}

We distinguish three questions: whether a new session can reproduce an earlier item, whether the handover preserves the distribution of the target, and whether a fixed continuation procedure succeeds when it receives that information. The first two are properties of the record and are defined below. The third is assessed from task outcomes under the continuation rule being evaluated, since a single trajectory cannot establish which information the procedure used.

\begin{definition}[Exact recovery of a selected item]
\label{def:exact-recoverability}
Let \(O=\phi(C,T)\) be a selected item from the information available before the handover. The item \(O\) is exactly recoverable from \(H\) when there is a measurable map \(r\) such that
\begin{equation}
  O=r(H,T)
  \label{eq:exact-component-recovery}
\end{equation}
holds almost surely. Exact recoverability of the full context is the special case \(O=C\).
\end{definition}

Exact recovery is stronger than the condition required for most tasks. We therefore define preservation through the target \(Y\), without requiring reconstruction of the complete earlier context.

\begin{definition}[Predictive sufficiency]
\label{def:predictive-sufficiency}
A handover \(H\) is predictively sufficient for \(C\) relative to \((X,Y,T)\) when
\begin{equation}
  P(Y\mid C,X,T)=P(Y\mid H,X,T)
  \label{eq:predictive-sufficiency}
\end{equation}
holds almost surely.
\end{definition}

Definition~\ref{def:predictive-sufficiency} gives an exact criterion for a one-step response and for a fixed replay in which all compared procedures receive the same later observations. Because an action by a freely acting agent can change the next observation, sufficiency for one target does not guarantee preservation of an adaptive trajectory. For such trajectories, Equation~\eqref{eq:trajectory-distribution} remains the appropriate loss object.

For a fixed task value \(t\), let \(\mu_t\) be the later-input distribution specified by task \(t\). Two contexts \(c\) and \(c'\) define the same in-context learning state for the task when
\begin{equation}
  P(Y\mid C=c,X=x,T=t)
  =P(Y\mid C=c',X=x,T=t)
  \label{eq:predictive-equivalence}
\end{equation}
holds for \(\mu_t\)-almost every \(x\). We write this relation as \(c\sim_t c'\) and define the equivalence class \([c]_{\sim_t}\) by later predictions rather than by a transformer hidden vector. Under an exogeneity condition, the same relation characterizes the coarsest deterministic handover that preserves those predictions.

\begin{proposition}[Coarsest deterministic sufficient state]
\label{prop:coarsest-handover}
Fix \(T=t\), suppose that \(C\) has finite or countable support, and let \(H=E(C,t)\) be deterministic. Assume that the later input is exogenous within the task, so the conditional distribution of \(X\) given \((C=c,T=t)\) is \(\mu_t\) for every supported context \(c\). Then, \(H\) is predictively sufficient if and only if
\begin{equation}
  E(c,t)=E(c',t)
  \quad\Longrightarrow\quad
  c\sim_t c'
  \label{eq:encoder-fiber-equivalence}
\end{equation}
holds for all supported \(c\) and \(c'\). Consequently, the map
\begin{equation}
  q_t(c)=[c]_{\sim_t}
  \label{eq:predictive-quotient}
\end{equation}
is predictively sufficient. On the support of \(C\mid T=t\), it can be recovered from every other deterministic handover that is predictively sufficient.
\end{proposition}

When the number of predictive states is finite, the proposition gives a direct lower bound on the length of any fixed-length deterministic code.

\begin{corollary}[Number of distinct in-context learning states]
\label{cor:predictive-state-count}
Under Proposition~\ref{prop:coarsest-handover}, suppose that \(q_t(C)\) takes exactly \(N_t<\infty\) values with positive probability. Every fixed-length deterministic sufficient handover requires at least \(\lceil\log_2 N_t\rceil\) bits, and a code for the index of the equivalence class attains this length.
\end{corollary}

The corollary shows why task-specific memory can be shorter than a record that permits exact reconstruction of arbitrary earlier material: a handover for one task need only distinguish contexts that lead to different distributions of \(Y\), and it may discard distinctions needed solely to reproduce the earlier text.

The proposition assumes that every supported earlier context has the same distribution of later inputs, which allows the state to be defined from the earlier context alone. Definition~\ref{def:predictive-sufficiency} itself does not impose this exogeneity condition. When the later-input law depends on the earlier context, sufficiency must be evaluated under the joint task distribution and cannot be reduced to a quotient based on one common \(\mu_t\).

Predictive sufficiency concerns the target \(Y\), not the wording of the earlier conversation. For one specified decision problem, a weaker requirement uses an action space \(\mathcal A\), a loss \(\ell:\mathcal A\times\mathcal Y\to[0,\infty)\), and the following minimum expected loss for information \(Z\):
\begin{equation}
  R_{\ell}^{\star}(Z)
  =\inf_{d}\mathbb{E}[\ell(d(Z,X,T),Y)],
  \label{eq:decision-bayes-risk}
\end{equation}
where the infimum is over measurable decision rules. The handover preserves this decision problem when \(R_{\ell}^{\star}(H)=R_{\ell}^{\star}(C)\).

\begin{proposition}[Recovery, prediction, and a specified decision problem]
\label{prop:recoverability-sufficiency}
Suppose that \(H\) is generated from \((C,T)\). Exact recoverability of \(C\) from \((H,T)\) implies predictive sufficiency. Predictive sufficiency implies \(R_{\ell}^{\star}(H)=R_{\ell}^{\star}(C)\) for any fixed action space and loss for which the risks are finite. The first implication cannot be reversed in general, and equality of risk for that decision problem does not imply predictive sufficiency. Exact recovery of one selected part of \(C\) also does not, by itself, imply predictive sufficiency.
\end{proposition}

These implications also separate exact recall from task success: a record may reproduce one earlier observation yet omit information that changes \(Y\), and a model may act incorrectly even when the record is predictively sufficient.

For a fixed language model, we also measure how much its response distribution changes when the handover replaces the full context. Assume that the distribution under the handover is positive wherever the distribution under the full context is positive. We define
\begin{equation}
  \Delta_{\mathrm{ep}}(E;\theta,\delta)
  =\mathbb{E}\left[
    D_{\mathrm{KL}}\left(
      \Pi_{\theta,\delta}(\cdot\mid p_{\mathrm{full}})
      \mathbin\Vert
      \Pi_{\theta,\delta}(\cdot\mid p_H)
    \right)
  \right].
  \label{eq:model-relative-divergence}
\end{equation}
The expectation is over \(\omega\sim\mathsf P_{\mathrm{ep}}\) and the writer distribution in Equation~\eqref{eq:encoder-channel}. The divergence compares one model under the two prompts without measuring whether either response is correct for the task, and Proposition~\ref{prop:autoregressive-response-kl} decomposes it into expected token-level terms. Because deterministic decoding can make the divergence between distinct point-mass responses infinite, we use the model's token probabilities when they are available and retain task loss as the main outcome.

\subsection{Loss under a Memory Limit}

To state results independently of a tokenizer or model, let \(D\) denote everything that occurs after the handover: construction of the prompt, generation and parsing of the response, and any reply from the environment. Define
\begin{equation}
  R(E,D)=\mathbb{E}[\ell(D(H,X,T),Y)],
  \label{eq:risk-encoder-decoder}
\end{equation}
where the expectation is under the episode distribution and all randomness in the application. The risk with the full earlier context and the ideal risk for a fixed writer are
\begin{equation}
  R_{\mathrm{full}}^{\star}
  =\inf_D\mathbb{E}[\ell(D(C,X,T),Y)],
  \qquad
  R_{E}^{\star}=\inf_D R(E,D).
  \label{eq:full-and-encoder-risk}
\end{equation}
For a class \(\mathcal E_B\) of writers whose pair \(H=(V,M)\) obeys budget \(B\), define
\begin{equation}
  R_{B}^{\star}=\inf_{E\in\mathcal E_B}R_{E}^{\star}.
  \label{eq:optimal-budget-risk}
\end{equation}
For the model and procedure used after the handover, denoted by \(D_{\theta}\), the excess risk decomposes as
\begin{equation}
\begin{aligned}
  R(E,D_{\theta})-R_{\mathrm{full}}^{\star}
  ={}& (R_{B}^{\star}-R_{\mathrm{full}}^{\star})
  +(R_{E}^{\star}-R_{B}^{\star})\\
  &+(R(E,D_{\theta})-R_{E}^{\star}).
  \label{eq:three-loss-decomposition}
\end{aligned}
\end{equation}
The three terms measure, respectively, the unavoidable loss at budget \(B\), the additional loss caused by the chosen writer, and the continuation procedure's excess loss relative to the best decoder for the same record. They can be calculated separately only in a controlled problem with a known ideal decoder, such as the regression setting below. Without that reference, changing the writer under a fixed continuation procedure measures an end-to-end effect that combines the record's information content with the procedure's ability to use its presentation.

Under logarithmic loss, the information removed by the handover has an exact expression.
\begin{proposition}[Log-loss identity]
\label{prop:log-loss-identity}
Suppose that \(H\) is generated from \((C,T)\), that the quantities below are finite, and that \(R_{\log}^{\star}(C)\) and \(R_{\log}^{\star}(H)\) denote the smallest expected logarithmic losses with the full context and the handover. Then, it holds that
\begin{equation}
  R_{\log}^{\star}(H)-R_{\log}^{\star}(C)
  =I(Y;C\mid H,X,T).
  \label{eq:log-loss-identity}
\end{equation}
\end{proposition}
For a finite action space and a bounded loss, the same information quantity controls the decision loss.
\begin{theorem}[Decision loss after a handover]
\label{thm:bounded-loss-information}
Let \(\mathcal A\) be finite, let \(\ell(a,Y)\in[0,L_{\max}]\), and assume the conditions of Proposition~\ref{prop:log-loss-identity}. Then, it holds that
\begin{equation}
  0\leq R_{E}^{\star}-R_{\mathrm{full}}^{\star}
  \leq
  L_{\max}
  \sqrt{\frac{I(Y;C\mid H,X,T)}{2}},
  \label{eq:bounded-loss-information}
\end{equation}
where mutual information is measured in nats.
\end{theorem}
The proof appears in Appendix~\ref{app:proof-bounded-loss-information}. For finite targets, Proposition~\ref{prop:brier-posterior-distortion} in Appendix~\ref{app:analysis-results} gives the corresponding exact identity for the Brier score.

A limit on serialized size is not the same as a limit on information. We use
\begin{equation}
  D_{\mathrm{len}}(B)
  =\inf_{E:\,b_{\mathrm{tot}}(E(C,T))\leq B}
  I(Y;C\mid E(C,T),X,T)
  \label{eq:length-distortion}
\end{equation}
for a token or byte limit, and
\begin{equation}
  D_{\mathrm{info}}(B)
  =\inf_{P(H\mid C,T):\,I(C;H\mid T)\leq B}
  I(Y;C\mid H,X,T)
  \label{eq:information-distortion}
\end{equation}
when the limit is measured in bits or nats. The second expression has the information pattern used in source coding with side information at the decoder: the writer sees \((C,T)\), and the decoder additionally sees \(X\) \citep{Wyner1976therate,Nagle2024fundamentallimit}. Actual bytes and tokenizer tokens must be distinguished from these theoretical units whenever a serialized record is compared.


The information pattern in Equation~\eqref{eq:information-distortion} differs sharply from a compressor that sees the realized later query before writing. The following example quantifies that distinction.

\begin{proposition}[Cost of writing before the query]
\label{prop:unknown-query-cost}
Let \(C=(C_1,\ldots,C_m)\), where the coordinates are independent \(\operatorname{Bernoulli}(1/2)\) variables. Let \(X\) be uniform on \(\{1,\ldots,m\}\), independent of \(C\), and let \(Y=C_X\). If an encoder writes \(H\) after observing \(C\) but before observing \(X\), and \(I(C;H)\leq B\) bits, then the Bayes log loss in bits satisfies
\begin{equation}
  \mathsf H_2(Y\mid H,X)
  \geq
  \max\left\{0,1-\frac{B}{m}\right\}.
  \label{eq:unknown-query-cost}
\end{equation}
By contrast, an encoder that observes \((C,X)\) can send \(C_X\) in one bit and attain zero log loss.
\end{proposition}

The example isolates the cost of committing to a boundary record before the realized query is known. A query-aware encoder can spend its bit on the requested coordinate, but the handover writer must retain information that remains useful across the query distribution. The proof appears in Appendix~\ref{app:general-proofs}.

Blackwell's comparison of information sources and the probabilistic description of autoregressive generation \citep{Blackwell1953equivalentcomparisons,Baptista2026largelanguage} provide the starting point. Placing the writer before prompt construction and charging every retained channel yields the handover-specific risk account in Equation~\eqref{eq:three-loss-decomposition}, which Section~\ref{sec:statistical-analysis} computes in two regression models.

\subsection{Scope at the Session Boundary}

The analysis concerns a clean resumption in which the external facts that determine the target remain stable across the boundary. The files and runtime need not be byte-identical, but permitted changes preserve both the information path and the conditional target law. If the repository, data, rules, or runtime change after the record is written, the validity of earlier evidence becomes a separate state variable.

\section{Proposed Handover Method}
\label{sec:representation}

The proposed method copies decisions and constraints that must remain exact, uses a shorter representation only when the task supplies an explicit guarantee or error bound, and keeps original observations that cannot be replaced under that rule.

Let \(S=\phi(C,T)\) contain the information from the earlier context needed to satisfy Definition~\ref{def:predictive-sufficiency}. The task and its scoring rule determine which information belongs in \(S\), so its definition follows the effect on the target, not a particular hidden vector. The proposed method writes a record for \(S\) within a size limit.

Let \(S_{\mathrm{exact}}\) contain decisions, constraints, and unresolved issues that must be recorded without changing their status. Among records that recover this part exactly, the writer seeks one with low ideal risk:
\begin{equation}
  \min_{E}\ R_{E}^{\star}
  \quad\text{subject to}\quad
  b_{\mathrm{tot}}(H)\leq B,
  \qquad
  S_{\mathrm{exact}}=r_{\mathrm{exact}}(H,T).
  \label{eq:structured-writer-objective}
\end{equation}
The equality is exact because rewriting an adopted decision as a suggestion or treating an unresolved issue as settled can change which actions are allowed. Subject to this requirement, the writer uses the remaining space for evidence that affects later predictions and decisions.

The resulting record is
\begin{equation}
  H=(H_{\mathrm{exact}},H_{\mathrm{stat}},H_{\mathrm{residual}}).
  \label{eq:three-part-handover}
\end{equation}
The three-part division guides construction and allows the statistical part to be empty. When the task provides no sufficient statistic or other justified compression, the writer places the relevant observations in \(H_{\mathrm{residual}}\).

\subsection{Three Parts of the Record}

The part \(H_{\mathrm{exact}}\) stores the current goal, decisions that constrain the next step, rejected options, and unresolved issues together with the source of each entry, without averaging them or turning an unresolved issue into a tentative answer.

The part \(H_{\mathrm{stat}}\) replaces repeated examples or tool results with a shorter quantity only when the replacement comes with an explicit relation to the task loss. The replacement may be a sufficient statistic, which preserves the relevant distribution exactly, or an approximation with an explicit error bound. If neither is available, the writer keeps selected original observations instead.

The part \(H_{\mathrm{residual}}\) stores original observations that \(H_{\mathrm{stat}}\) does not summarize, since a rare example or specific failure may determine the next step even when an aggregate does not. To retain an effective size limit, the method must state how these observations are selected.

\begin{proposition}[A recoverable sufficient state yields a sufficient handover]
\label{prop:state-recovery-sufficiency}
Let \(S=\phi(C,T)\) be predictively sufficient for \(C\) relative to \((X,Y,T)\). If \(S\) is exactly recoverable from \((H,T)\), then \(H\) is predictively sufficient.
\end{proposition}

The proposition connects the proposed record to the general definition: in parametric regression, \(S\) is a finite set of sufficient statistics. In a long-running task with decisions and tool results, the task specification determines which commitments and observations must remain available, after which the record can be checked for recoverability before its downstream effect is evaluated.

\subsection{Writing the Handover}

At the boundary, the writer receives the pre-boundary information and writes the record before observing the realized later input. It checks which decisions and constraints remain in force, computes any task-justified shorter quantity, selects the original observations that must remain, and divides the available space among the three parts. Deterministic checks verify the required fields, numerical dimensions, references, and total size before the record is evaluated. An application may instead maintain the same fields as the task proceeds, provided that the information available to each update and the resulting memory cost are recorded.

Deterministic transformations used to construct the fields are part of the writer \(E\), and their outputs count toward the record budget.

\subsection{Presentation and Selected External Records}

The map \(s_H\) in Equation~\eqref{eq:full-handover-prompts} builds the post-handover prompt through \emph{serialization}, which combines the record, later input, and fixed task instructions without changing the stored values. If serialization rounds a value, omits a field, or adds a calculated value, we treat that change as part of the writing method and log it accordingly.

Equation~\eqref{eq:structured-writer-objective} concerns the information in \(H\) itself. The same information may be presented as structured fields, numerical values, or examples. The loss of a fixed continuation procedure also depends on how \(s_H\) presents that information, how the response is generated, and how it is parsed. A comparison between two forms is controlled only when their information content is known to be the same or ordered. Section~\ref{sec:statistical-analysis} gives a case in which two formats determine exactly the same state. Any observed difference between them can then be attributed to numerical precision, parsing, or downstream handling of the representation and not to missing information.

Selected residual observations may remain outside \(V\), the record placed in the prompt, under identifiers. Write
\begin{equation}
  V=(H_{\mathrm{exact}},H_{\mathrm{stat}},J_{\mathrm{res}}),
  \qquad
  M_{\mathrm{res}}
  =\{(j,o_j):j\in J_{\mathrm{res}}\},
  \label{eq:selected-external-records}
\end{equation}
where \(J_{\mathrm{res}}\) is the set of identifiers placed in \(V\). Let \(b_{\mathrm{ext}}(M_{\mathrm{res}})\) denote the serialized size of the external records, including identifiers and metadata, measured in the same unit as \(b_{\mathrm{act}}\). For this condition, the total size is \(b_{\mathrm{act}}(V)+b_{\mathrm{ext}}(M_{\mathrm{res}})\). Both components must be included when the record is compared with a self-contained alternative.

If the external record preserves \(o_j\) exactly, a valid identifier can return the same observation without rerunning the action that produced it. Exact storage alone does not establish that the writer selected every observation needed later or that the continuation procedure retrieves the relevant item. Appendix~\ref{app:handover-details} gives further details on selection, serialization, and deterministic checks.

\section{Statistical Analysis}
\label{sec:statistical-analysis}

Regression provides two settings in which the general handover problem can be solved explicitly using standard tools for Gaussian sufficiency and nonparametric minimax estimation. What is specific to handover is the information order in Section~\ref{sec:formulation}: the writer sees the sample before the later covariate is realized and must encode all retained information within budget \(B\). The first setting admits a finite-dimensional real-valued sufficient state and a finite-bit approximation with explicit perturbation control. The second gives an achievable memory--risk relation and a matching memory floor, up to coding logarithms, for the squared-loss problem below.

\subsection{Setup for Statistical Analysis}

We apply Section~\ref{sec:formulation} to a regression sample \(\mathcal D_n=((X_i,Y_i))_{i=1}^{n}\) available before the handover. The writer sees \(\mathcal D_n\) and the task information \(T\) before the realized value of \(X\) is known and must construct \(H\) within the bit limit. After the boundary, the decoder receives the new covariate \(X\) and predicts the corresponding response \(Y\).

The parametric subsection asks when a finite-dimensional state gives the same posterior predictive distribution as the full sample and thereby supplies an exact instance of Definition~\ref{def:predictive-sufficiency}. The nonparametric subsection asks how the smallest worst-case integrated squared error depends on the sample size and the bit limit, focusing on this decision problem without requiring equality of the complete conditional distribution.

\subsection{Parametric Regression}
\label{sec:parametric}

We first consider linear regression with Gaussian noise because the information needed for later prediction is known exactly. Let the demonstrations before the boundary satisfy
\begin{equation}
  y_i=x_i^{\top}\beta+\varepsilon_i,
  \qquad
  \varepsilon_i\sim\mathcal N(0,\sigma^2),
  \label{eq:linear-model}
\end{equation}
where \(\sigma^2\) is known, and let the prior be
\begin{equation}
  \beta\sim\mathcal N(m_0,V_0),
  \qquad V_0\succ0.
  \label{eq:gaussian-prior}
\end{equation}
The task information \(T\) contains \((m_0,V_0,\sigma^2)\). Let \(X_n\) contain the demonstration inputs and \(y_n\) their outputs, and define
\begin{equation}
  G_n=X_n^{\top}X_n,
  \qquad
  b_n=X_n^{\top}y_n.
  \label{eq:linear-statistics}
\end{equation}
The posterior covariance and mean are
\begin{equation}
  V_n^{-1}=V_0^{-1}+\sigma^{-2}G_n,
  \qquad
  m_n=V_n\left(V_0^{-1}m_0+\sigma^{-2}b_n\right),
  \label{eq:linear-posterior}
\end{equation}
and the posterior predictive distribution at a later input \(x\) is
\begin{equation}
  Y\mid x,X_n,y_n
  \sim
  \mathcal N\left(x^{\top}m_n,
  \sigma^2+x^{\top}V_nx\right).
  \label{eq:linear-predictive}
\end{equation}
These expressions depend on the demonstrations only through \(G_n\) and \(b_n\). The next theorem states the resulting handover property.

\begin{theorem}[Exact handover using sufficient statistics]
\label{thm:linear-sufficiency}
Under Equations~\eqref{eq:linear-model} and~\eqref{eq:gaussian-prior}, the record
\begin{equation}
  H_n=(G_n,b_n)
  \label{eq:linear-handover}
\end{equation}
is predictively sufficient for every later input \(x\). In particular, the associated conditional mutual information vanishes:
\begin{equation}
  I(Y;X_n,y_n\mid H_n,x,T)=0.
  \label{eq:linear-mutual-information}
\end{equation}
\end{theorem}
The record contains \(d(d+1)/2+d\) real numbers regardless of the number of demonstrations, so it is a finite-dimensional real-valued state. Theorem~\ref{thm:linear-quantization} and Corollaries~\ref{cor:linear-predictive-kl}--\ref{cor:linear-bit-kl-rate} treat finite-precision error and finite coding. An unknown noise variance would require additional quantities, which is why the primary theorem treats the variance as known.

Many continuation procedures accept example sequences more directly than matrix fields. To compare an example-based representation with the direct statistic record, we construct synthetic input--output pairs with the same sufficient statistics. Let \(r=\operatorname{rank}(G_n)\), and write
\begin{equation}
  G_n=U_r\Lambda_rU_r^{\top},
  \label{eq:gram-eigendecomposition}
\end{equation}
where \(\Lambda_r\) contains the positive eigenvalues. Define
\begin{equation}
  \widetilde X=\Lambda_r^{1/2}U_r^{\top},
  \qquad
  \widetilde y=\Lambda_r^{-1/2}U_r^{\top}b_n.
  \label{eq:synthetic-sufficient-construction}
\end{equation}
The rows of \(\widetilde X\) and the corresponding entries of \(\widetilde y\) are called synthetic sufficient demonstrations in this study. Because the construction reproduces both \(G_n\) and \(b_n\), the next theorem compares two representations of the same sufficient state.

\begin{theorem}[Equivalence of synthetic sufficient demonstrations]
\label{thm:synthetic-sufficient-equivalence}
For every \(X_n\) and \(y_n\), the construction in Equation~\eqref{eq:synthetic-sufficient-construction} satisfies
\begin{equation}
  \widetilde X^{\top}\widetilde X=G_n,
  \qquad
  \widetilde X^{\top}\widetilde y=b_n.
  \label{eq:synthetic-sufficient-statistics}
\end{equation}
Consequently, the original demonstrations and the synthetic sufficient demonstrations give the same posterior in Equation~\eqref{eq:linear-posterior}. They also give the same ridge estimate for every \(\lambda>0\):
\begin{equation}
  (G_n+\lambda I)^{-1}b_n
  =
  (\widetilde X^{\top}\widetilde X+\lambda I)^{-1}
  \widetilde X^{\top}\widetilde y.
  \label{eq:ridge-synthetic-sufficient-equivalence}
\end{equation}
\end{theorem}
For this regression model, the two records contain the same information. When numerical precision and parsing are held fixed, any difference under the same continuation procedure arises after encoding and not from different stored information. The minimum-row property and spectral truncation bounds appear in Appendix~\ref{app:analysis-results}. The finite-bit construction below connects the stored precision to posterior perturbation, predictive log loss, and the total number of encoded scalars.

\paragraph{Quantized sufficient statistics}

A finite record stores quantized approximations rather than exact real numbers. Let \(\overline G\succeq0\) and \(\overline b\) approximate \(G_n\) and \(b_n\), and define
\begin{equation}
\begin{aligned}
  A&=V_0^{-1}+\sigma^{-2}G_n,
  &h&=V_0^{-1}m_0+\sigma^{-2}b_n,\\
  \overline A&=V_0^{-1}+\sigma^{-2}\overline G,
  &\overline h&=V_0^{-1}m_0+\sigma^{-2}\overline b,
\end{aligned}
\label{eq:quantized-posterior-objects}
\end{equation}
and let \(V=A^{-1}\), \(m=Vh\), \(\overline V=\overline A^{-1}\), and \(\overline m=\overline V\overline h\).

\begin{theorem}[Stability under statistic quantization]
\label{thm:linear-quantization}
Let \(\alpha=\lambda_{\min}(V_0^{-1})>0\). Suppose
\begin{equation}
  \lVert\overline G-G_n\rVert_{\mathrm{op}}\leq\delta_G,
  \qquad
  \lVert\overline b-b_n\rVert_2\leq\delta_b.
  \label{eq:quantization-errors}
\end{equation}
Then, the covariance and mean perturbations satisfy
\begin{equation}
  \lVert\overline V-V\rVert_{\mathrm{op}}
  \leq
  \frac{\delta_G}{\sigma^2\alpha^2},
  \label{eq:covariance-quantization-bound}
\end{equation}
and
\begin{equation}
  \lVert\overline m-m\rVert_2
  \leq
  \frac{\delta_b}{\sigma^2\alpha}
  +\frac{\delta_G\lVert h\rVert_2}
  {\sigma^2\alpha^2}.
  \label{eq:mean-quantization-bound}
\end{equation}
Consequently, for every query with \(\lVert x\rVert_2\leq L_x\), the predictive mean and variance satisfy
\begin{equation}
\begin{aligned}
  \left|x^{\top}(\overline m-m)\right|
  &\leq L_x\lVert\overline m-m\rVert_2,\\
  \left|x^{\top}(\overline V-V)x\right|
  &\leq
  \frac{L_x^2\delta_G}{\sigma^2\alpha^2}.
\end{aligned}
\label{eq:predictive-quantization-bound}
\end{equation}
\end{theorem}

The theorem applies after projecting a symmetrically quantized Gram matrix onto the positive semidefinite cone. Because \(G_n\) is positive semidefinite, this projection does not increase its Frobenius distance from the truth.

\begin{corollary}[Predictive log loss under finite precision]
\label{cor:linear-predictive-kl}
Let \((\mu_x,v_x)\) and \((\overline\mu_x,\overline v_x)\) denote the posterior predictive mean and variance obtained from \((G_n,b_n)\) and \((\overline G,\overline b)\), respectively, at a query with \(\lVert x\rVert_2\leq L_x\). Define
\begin{equation}
\begin{aligned}
  \varepsilon_{\mu}
  &=L_x\left(
    \frac{\delta_b}{\sigma^2\alpha}
    +\frac{\delta_G\lVert h\rVert_2}{\sigma^2\alpha^2}
  \right),\\
  \varepsilon_v
  &=\frac{L_x^2\delta_G}{\sigma^2\alpha^2}.
\end{aligned}
\label{eq:predictive-kl-errors}
\end{equation}
If \(\varepsilon_v\leq\sigma^2/2\), then
\begin{equation}
  D_{\mathrm{KL}}\!\left(
    \mathcal N(\mu_x,v_x)
    \mathbin\Vert
    \mathcal N(\overline\mu_x,\overline v_x)
  \right)
  \leq
  \frac{\varepsilon_{\mu}^2}{2\sigma^2}
  +\frac{\varepsilon_v^2}{\sigma^4}.
  \label{eq:predictive-kl-quantization}
\end{equation}
\end{corollary}

\begin{corollary}[A linear handover stored with finitely many bits]
\label{cor:linear-bit-budget}
Suppose \(\lVert x_i\rVert_2\leq L\) and \(|y_i|\leq B_y\). Quantize the unique entries of \(G_n\) with step \(q_G\), quantize \(b_n\) with step \(q_b\), and project the matrix to the positive semidefinite cone. The resulting record uses at most
\begin{equation}
\begin{aligned}
 B_{\mathrm{lin}}
 \leq{}&
 \frac{d(d+1)}{2}
 \left\lceil
 \log_2\left(1+\frac{2nL^2}{q_G}\right)
 \right\rceil\\
 &+d
 \left\lceil
 \log_2\left(1+\frac{2nLB_y}{q_b}\right)
 \right\rceil
 +O(d^2)
 \label{eq:linear-bit-budget}
\end{aligned}
\end{equation}
bits, and Theorem~\ref{thm:linear-quantization} holds with
\begin{equation}
  \delta_G\leq q_G d,
  \qquad
  \delta_b\leq q_b\sqrt d.
  \label{eq:linear-entrywise-errors}
\end{equation}
\end{corollary}

Corollary~\ref{cor:linear-bit-budget} connects exact real-valued sufficiency to a finite code and explains why theoretical bits, serialized bytes, and tokenizer tokens should be reported separately.

\begin{corollary}[Finite-bit predictive rate]
\label{cor:linear-bit-kl-rate}
Under the assumptions of Corollary~\ref{cor:linear-bit-budget}, let
\begin{equation}
  p=\frac{d(d+1)}{2}+d.
  \label{eq:linear-state-dimension}
\end{equation}
For fixed \((n,d,L,B_y,V_0,m_0,\sigma^2,L_x)\), there are constants \(B_0\) and \(K\) such that every \(B\geq B_0\) admits a fixed-length handover of at most \(B\) bits satisfying
\begin{equation}
  \sup_{\lVert x\rVert_2\leq L_x}
  D_{\mathrm{KL}}\!\left(
    \mathcal N(\mu_x,v_x)
    \mathbin\Vert
    \mathcal N(\overline\mu_x,\overline v_x)
  \right)
  \leq
  K2^{-2(B-B_0)/p}.
  \label{eq:linear-bit-kl-rate}
\end{equation}
\end{corollary}

\subsection{Nonparametric Regression}
\label{sec:nonparametric}

A fixed-dimensional statistic cannot represent every function in a nonparametric class. We consider
\begin{equation}
  Y_i=f(X_i)+\varepsilon_i,
  \qquad X_i\in[0,1]^d,
  \label{eq:nonparametric-model}
\end{equation}
where the observations are independent and identically distributed. The input density \(p\) satisfies
\begin{equation}
  0<p_{\min}\leq p(x)\leq p_{\max}<\infty,
  \label{eq:density-bounds}
\end{equation}
the noise has conditional mean zero, and \(|Y_i|\leq B_y\) almost surely. For \(0<\beta\leq1\), let \(\mathcal H^\beta(L,B_f)\) contain functions satisfying \(|f(x)|\leq B_f\) and
\begin{equation}
  |f(x)-f(x')|
  \leq L\lVert x-x'\rVert_2^\beta
  \label{eq:holder-condition}
\end{equation}
for every \(x,x'\in[0,1]^d\). We measure error by the integrated squared error over the distribution of later inputs:
\begin{equation}
  \lVert\widehat f-f\rVert_{P_X}^2
  =\int_{[0,1]^d}(\widehat f(x)-f(x))^2p(x)\,dx.
  \label{eq:integrated-risk}
\end{equation}

Partition \([0,1]^d\) into \(M=m^d\) equal cubes \(A_1,\ldots,A_M\). For each cell, the writer stores the count and the sum of the responses,
\begin{equation}
  N_j=\sum_{i=1}^{n}\mathbf 1(X_i\in A_j),
  \qquad
  S_j=\sum_{i:X_i\in A_j}Y_i.
  \label{eq:cell-statistics}
\end{equation}
For \(N_j>0\), let \(\overline Y_j=S_j/N_j\), set \(\overline Y_j=0\) when \(N_j=0\), and let \(Q_q\) be a quantizer with \(|Q_q(z)-z|\leq q\). The resulting handover is
\begin{equation}
  H_M=\left((N_j,Q_q(\overline Y_j)):
  j=1,\ldots,M\right).
  \label{eq:cell-handover}
\end{equation}
The decoder uses the stored mean for a later input in a nonempty cell and zero in an empty cell. The following theorem separates the resulting error into approximation within a cell, sampling variation, empty cells, and quantization.

\begin{theorem}[Risk of a handover based on cell statistics]
\label{thm:nonparametric-upper}
Under Equations~\eqref{eq:nonparametric-model}--\eqref{eq:holder-condition}, suppose \(M\leq n\). There are constants \(C_1,C_2,C_3,C_4\), depending only on \((d,\beta,L,B_f,B_y,p_{\min},p_{\max})\), such that
\begin{equation}
\begin{aligned}
  \sup_{f\in\mathcal H^\beta(L,B_f)}
  \mathbb{E}_f[\lVert\widehat f_{H_M}-f\rVert_{P_X}^2]
  \leq{}& C_1M^{-2\beta/d}
  +C_2\frac{M}{n}\\
  &+C_3\exp\left(-\frac{np_{\min}}{M}\right)
  +C_4q^2.
  \label{eq:nonparametric-upper}
\end{aligned}
\end{equation}
\end{theorem}
The terms arise from approximating the function by a constant within each cell, sampling variation, empty cells, and quantization. Choosing
\begin{equation}
  M\asymp n^{d/(2\beta+d)},
  \qquad
  q\asymp n^{-\beta/(2\beta+d)}
  \label{eq:nonparametric-optimal-choice}
\end{equation}
gives
\begin{equation}
  \sup_{f\in\mathcal H^\beta(L,B_f)}
  \mathbb{E}_f[\lVert\widehat f_{H_M}-f\rVert_{P_X}^2]
  =O\left(n^{-2\beta/(2\beta+d)}\right),
  \label{eq:nonparametric-minimax-rate}
\end{equation}
which matches the standard full-data order for this class. The same rate can be attained with a finite code for the stored counts and means.

\begin{corollary}[Bit budget needed to attain the full-data rate]
\label{cor:nonparametric-bit-budget}
If each count and each quantized nonempty-cell mean is stored with the fixed-length code described in Appendix~\ref{app:proof-nonparametric-bit-budget}, then the handover uses
\begin{equation}
  B_n=O\left(n^{d/(2\beta+d)}\log n\right)
  \label{eq:nonparametric-bit-budget}
\end{equation}
bits and attains the rate in Equation~\eqref{eq:nonparametric-minimax-rate}.
\end{corollary}

For a fixed design distribution, define the minimax risk under a \(B\)-bit handover by
\begin{equation}
  R_{n,B}
  =\inf_{\substack{P_{H\mid\mathcal D_n},D:\
  H\in\mathcal Z_B,\ |\mathcal Z_B|\leq2^B}}
  \sup_{f\in\mathcal H^\beta(L,B_f)}
  \mathbb{E}_f[\lVert\widehat f_{H,D}-f\rVert_{P_X}^2],
  \label{eq:minimax-budget-risk}
\end{equation}
where \(\mathcal D_n\) denotes the \(n\) demonstrations, the decoder observes the message and future query, and the encoder and decoder may be randomized.

\begin{corollary}[Upper bound under a memory limit]
\label{cor:nonparametric-budget-upper}
There is a constant \(c_{\mathrm{code}}>0\), depending only on the fixed coding convention and the class parameters, such that the encoder can use any partition with
\begin{equation}
  M\leq M_B
  =\min\left\{
    n,
    \left\lfloor
      \frac{c_{\mathrm{code}}B}{\log_2(n+1)}
    \right\rfloor
  \right\}
  \label{eq:nonparametric-feasible-cells}
\end{equation}
and store the counts and means with \(q^2\lesssim M^{-2\beta/d}\). For budgets with \(M_B\geq1\), the risk satisfies
\begin{equation}
  R_{n,B}
  \lesssim
  \inf_{1\leq M\leq M_B}
  \left(
    M^{-2\beta/d}
    +\frac{M}{n}
    +\exp\left(-\frac{np_{\min}}{M}\right)
  \right),
  \label{eq:nonparametric-budget-upper}
\end{equation}
where the infimum ranges over partitions of the form \(M=m^d\).
\end{corollary}

The encoder need not spend the entire budget on a finer partition. When \(M_B\) is smaller than the unconstrained choice in Equation~\eqref{eq:nonparametric-optimal-choice}, the largest feasible partition gives the predicted rate, up to coding logarithms, in the range where the memory budget is the binding constraint. Once the budget can encode that unconstrained choice, the encoder keeps the same partition and remains at the sample floor instead of increasing variance by using every available bit.

To obtain a matching lower bound, specialize Equation~\eqref{eq:minimax-budget-risk} to uniform \(X_i\) on \([0,1]^d\) and a bounded binary-response submodel. Conditional on \(X_i=x\), let \(Y_i\in\{-B_y,B_y\}\) satisfy
\begin{equation}
  \Pr(Y_i=B_y\mid X_i=x)
  =\frac{1}{2}\left(1+\frac{f(x)}{B_y}\right),
  \label{eq:bounded-binary-submodel}
\end{equation}
where the packing amplitude is chosen so that \(|f(x)|\leq B_y/2\). This choice gives \(\mathbb{E}[Y_i\mid X_i=x]=f(x)\), and the submodel obeys the bounded-outcome assumptions used in the upper bound.

\begin{theorem}[Lower bounds from the sample size and memory limit]
\label{thm:nonparametric-lower}
There is a constant \(c>0\), depending only on \((d,\beta,L,B_f,B_y)\), such that
\begin{equation}
  R_{n,B}
  \geq
  c\max\left\{
    n^{-2\beta/(2\beta+d)},
    (B+1)^{-2\beta/d}
  \right\}.
  \label{eq:nonparametric-lower}
\end{equation}
\end{theorem}
The first term is the error that remains even when the decoder receives all observations, and the second is caused by the finite number of possible handovers. Combined with the upper bound, the theorem shows that the required memory depends on the chosen error level and the function class, not only on the number of observations. Appendix~\ref{app:analysis-results} states extensions to smoother functions and to functions known to depend on fewer coordinates.

\section{Implications for Evaluating Handover Records}
\label{sec:evaluation-protocol}

Comparing arbitrary summaries does not identify the theoretical quantities defined above. A controlled study must specify what the writer knows at the boundary, the distribution of later inputs, every channel through which earlier information remains available, the serialization shown to the continuation procedure, and the task loss.

\subsection{Ideal-Decoder Calibration}

A comparison of writers holds the continuation rule, later inputs, and loss fixed. Its observed effect is generally end-to-end because it reflects both the information carried by each record and the rule's ability to interpret the resulting representation. The three terms in Equation~\eqref{eq:three-loss-decomposition} can be separated only when the ideal risk of each record is known. In the Gaussian setting of Section~\ref{sec:parametric}, the exact posterior calculation supplies that reference, so information loss can be separated from numerical or algorithmic error introduced after the boundary.

The full earlier context and a record with no earlier information are reference conditions, not universal upper and lower bounds for an arbitrary fixed model. A task may contain predictive information in \(T\) or \(X\). A long input may also make a particular continuation procedure less reliable. The theoretical comparison therefore uses excess risk relative to the ideal decoder under the information available in each condition, not an assumed ordering of prompt formats.

\subsection{Information-Equivalent Records}

For a handover record \(H\), define
\begin{equation}
  R^{\star}(H)
  =\inf_D\mathbb{E}[\ell(D(H,X,T),Y)],
  \label{eq:record-ideal-risk}
\end{equation}
where the infimum is over continuation rules with the output space and loss fixed in the comparison. Presentation comparisons are controlled only when the information relation between their records is known.

\begin{proposition}[Ideal-risk ordering under deterministic representations]
\label{prop:serialization-ordering}
Let \(H_1\) and \(H_2\) be evaluated with the same \((X,Y,T)\), output space, and loss. If \(H_2=s(H_1,T)\) almost surely for a deterministic map \(s\), then
\begin{equation}
  R^{\star}(H_1)\leq R^{\star}(H_2).
  \label{eq:serialization-risk-ordering}
\end{equation}
If there is also a deterministic map \(r\) such that \(H_1=r(H_2,T)\) almost surely, then the two ideal risks are equal.
\end{proposition}

When the deterministic maps exist in both directions, a fixed continuation rule can still incur different losses because its gap from the common ideal risk may differ across the two representations.

\begin{corollary}[Representation-gap identity]
\label{cor:representation-gap}
Suppose the two deterministic maps in Proposition~\ref{prop:serialization-ordering} exist. For a fixed continuation rule \(D\), write
\begin{equation}
  R(D;H_j)=\mathbb{E}[\ell(D(H_j,X,T),Y)]
  \label{eq:fixed-decoder-record-risk}
\end{equation}
for \(j\in\{1,2\}\). Then, we have
\begin{equation}
\begin{aligned}
  R(D;H_1)-R(D;H_2)
  ={}&\left(R(D;H_1)-R^{\star}(H_1)\right)\\
  &-\left(R(D;H_2)-R^{\star}(H_2)\right).
  \label{eq:representation-gap-identity}
\end{aligned}
\end{equation}
\end{corollary}
The identity follows by subtracting the equal ideal risks. It rules out unequal task information as the source of the observed difference but does not identify why the fixed continuation procedure has a different gap from the ideal decoder across the two representations.

In the Gaussian setting, the sufficient-statistic record and the exact synthetic sufficient demonstrations both determine \((G_n,b_n)\). Theorem~\ref{thm:synthetic-sufficient-equivalence} and Proposition~\ref{prop:serialization-ordering} therefore give them the same ideal risk. A truncated or otherwise lossy representation must instead be compared with the exact state, because its risk combines information loss with any additional decoder gap.

\subsection{Memory Accounting}

A short prompt does not imply a small handover when earlier information remains in files, indexes, or databases. A controlled comparison should report the active record, external storage, and content returned to the continuation procedure separately, then use their total when comparing self-contained methods. Serialized bytes and tokenizer tokens are also distinct from the information budget in Equation~\eqref{eq:information-distortion}.

A memory comparison should state the task distribution, the unit in which the budget is measured, and every retained channel. When several budgets are considered, the object of interest is the resulting risk curve rather than one arbitrary operating point.

\section{Discussion}
\label{sec:discussion}

The formulation, handover construction, and statistical results separate three properties that are often combined in a single summary. The record may omit task-relevant information, the memory limit may make some loss unavoidable, and the continuation procedure may fail to attain the risk permitted by the information it receives.

\subsection{What Makes a Handover Better}

The proposed method records what the unfinished task still requires, with decisions and constraints written directly because changing or omitting one can change the next permitted action. Repeated observations are shortened only when the task supplies a theorem or an approximation bound that justifies the replacement. An exceptional observation remains in the record when it determines the next step. The task and its scoring rule therefore determine what the writer may shorten.

Memory size cannot be interpreted independently of the continuation task. The Gaussian example has a finite-dimensional sufficient state whose dimension is independent of the number of demonstrations. The finite-precision results connect code length to predictive log loss. In the nonparametric example, the record must grow with the target accuracy until the sample-size floor is reached. Proposition~\ref{prop:unknown-query-cost} identifies another source of cost: a writer that commits before the realized query may need to retain information about several possible downstream uses that a query-aware encoder could discard.

The representation also matters after the state has been selected. Proposition~\ref{prop:serialization-ordering} identifies when two records have the same ideal risk, and Corollary~\ref{cor:representation-gap} assigns any remaining difference under one fixed continuation procedure to its gap from the ideal decoder. This separation prevents a failure to parse or use a representation from being described as information loss by the writer.

\subsection{Relation to Current Memory Systems}

Compaction shortens the prompt, persistent memory inserts selected records into later sessions, and retrieval returns content from an external source. A KV cache serves a different role by reducing repeated computation without recording the task. These mechanisms can help an application continue, but they do not determine what the next decision requires.

External records change the meaning of a memory limit because a short prompt does not limit the amount stored in files or databases. The formulation therefore counts prompt content, external storage, and returned content as parts of the handover whenever they derive from the earlier session.

\subsection{Scope of the Theory}

The general results apply to the joint distribution of earlier context, later input, target, and task information. The regression models furnish solvable instances in which the relevant state and the ideal decoder can be characterized, yielding exact and approximate memory requirements for those tasks.

Predictive sufficiency is relative to the later-input law. A change in that law can alter which information is sufficient, and an adaptive trajectory requires a trajectory-level loss because earlier actions change later observations. The results here concern the session boundary under the continuation law.

\section{Conclusion}
\label{sec:conclusion}

A session handover succeeds when the information passed to the new session supports the continuation required by the task. By modeling the writer, the prompt built from the record, the continuation procedure, and the task score separately, we distinguish reproduction of earlier text from preservation of task information and separate information omitted by the writer from loss introduced after the record has been supplied.

The proposed method records decisions and constraints directly, shortens repeated evidence only when the relation between the replacement and task loss is explicit, and keeps observations that cannot be replaced. Predictive equivalence characterizes the coarsest deterministic sufficient state under the exogeneity condition of Proposition~\ref{prop:coarsest-handover}, and the memory analysis shows how the budget and the timing of the writer constrain attainable risk. Gaussian regression gives an exact finite-dimensional handover and finite-bit predictive bounds, and nonparametric regression gives an achievable memory--risk relation and a distinct memory floor. These results establish a theoretical basis for constructing and comparing handover records across session boundaries.

\bibliography{arXiv2.bbl}

\bibliographystyle{tmlr}

\clearpage