Agentic post-training [ftip-004O]
✍️sourceAGENTDRAFTED
Agentic post-training [ftip-004O]
✍️sourceAGENTDRAFTED
Response-level training ends when a model emits an answer. Agentic post-training also trains decisions made after observations from tools or other external systems.
Definition 1. Action serializer [ftip-004P]AGENTDRAFTED
Definition 1. Action serializer [ftip-004P]AGENTDRAFTED
Fix the token vocabulary and strings of the tokenizer interface, and the action space \(\mathcal A\) from the declared interactive task realization. An action serializer is a pair of partial maps
\[ \operatorname {enc}:\mathcal A\rightharpoonup \mathcal V^*, \qquad \operatorname {dec}:\mathcal V^*\rightharpoonup \mathcal A. \]The encoder gives an action a textual representation. The decoder recognizes a completed representation and returns the executable action. A string outside the decoder's domain is malformed; it is not silently promoted to an environment action. For every action in the encoder's domain, the declared pair satisfies \(\operatorname {dec}(\operatorname {enc}(a))=a\).
Remark 2. Generated tokens and executable actions [ftip-004Q]AGENTDRAFTED
Remark 2. Generated tokens and executable actions [ftip-004Q]AGENTDRAFTED
An action serializer maps generated text to an executable action. Section 2 of ReAct: Synergizing reasoning and acting in language models[yao2023react] writes actions and observations in a textual trajectory. The proposed serializer interface in Definition 1 additionally distinguishes malformed calls, constrained grammars, and environment actions.
An improvement can therefore come from better reasoning, better serialization, or a more permissive parser. These are separate intervention coordinates.
Definition 3. tool interaction [yao2023react, Section 2] [ftip-004R]AGENTDRAFTED
Definition 3. tool interaction [yao2023react, Section 2] [ftip-004R]AGENTDRAFTED
A ReAct interaction alternates model-generated reasoning and actions with observations returned by an external interface. The observation is appended to the next model context, so subsequent actions may depend on earlier tool results.
A decoded action belongs to \(\mathcal A\) in the declared interactive task realization; the transition--observation kernel of Definition [ftip-001Z] returns the next observation. The cited construction does not by itself fix a sandbox, reward, or training algorithm.
Definition 4. Sandbox [ftip-004S]AGENTDRAFTED
Definition 4. Sandbox [ftip-004S]AGENTDRAFTED
Fix an interactive realization \(\mathsf {Env}_{\mathsf T}\) from the declared task interface, a measurable evidence space \(\mathcal E_{\rm box}\), and a cost dimension \(m\geq 1\). A sandbox specifies an allowed action set \(\mathcal A^{\rm box}_{\mathsf T}\subseteq \mathcal A_{\mathsf T}\) that is measurable, a cost bound \(b_{\rm box}\in \mathbb R_+^m\), and, for each \(x\in \mathcal X_{\mathsf T}\) and \(0\leq t<T_{\max }\), an execution kernel
\[ K_{t}^{\rm box,x}: \mathcal S_{\mathsf T}\times \mathcal A^{\rm box}_{\mathsf T} \rightsquigarrow \mathcal S_{\mathsf T}\times \mathcal O^{\rm obs}_{\mathsf T} \times \mathcal E_{\rm box}\times \mathbb R_+^m, \]It also specifies, for each \(x\in \mathcal X_{\mathsf T}\), a reset kernel
\[ \mathsf {Reset}^{x}_{\rm box}:\{\ast \}\rightsquigarrow \mathcal S_{\mathsf T}\times \mathcal O^{\rm obs}_{\mathsf T} \times \mathcal E_{\rm box}\times \mathbb R_+^m. \]For an allowed action, the state--observation marginal of \(K_t^{\rm box,x}\) is the kernel \(K_t^x\) in the task realization; the state--observation marginal of the reset kernel is \(\rho _0^x\). The remaining coordinates record reproducible evidence and a realized cost increment. An admitted stopped trajectory must have componentwise cumulative cost at most \(b_{\rm box}\).
The sandbox semantics include permissions, kernel and reset versions, evidence encoding, and cost accounting. A tool name or API schema alone does not determine these fields.
Remark 5. Sandbox restrictions and trajectory laws [ftip-004T]AGENTDRAFTED
Remark 5. Sandbox restrictions and trajectory laws [ftip-004T]AGENTDRAFTED
A sandbox restricts the environment through its executor, reset rules, permissions, and evidence. ReAct [yao2023react, Section 2] supplies the action--observation pattern. Software-agent systems surveyed in [wang2024agents, Section 2.3.2] add repositories, compilers, tests, and other digital tools. The combined sandbox interface is a proposed model of these choices.
Two protocols that share prompts but change reset or permission semantics need not induce the same trajectory law.
Definition 6. Agentic post-training state [ftip-004U]AGENTDRAFTED
Definition 6. Agentic post-training state [ftip-004U]AGENTDRAFTED
Let \(\mathcal M_{\rm exec}\) be the space of executable model artifacts, \(\mathcal Z_{\rm opt}\) the optimizer-state space, and \(\mathcal R_{\rm ag}\) a declared space of typed agentic round records. At training round \(n\), an agentic post-training state is a tuple \[ \Sigma _n=(M_n,s_n,\mathcal L_n) \in \mathcal M_{\rm exec}\times \mathcal Z_{\rm opt} \times \mathcal R_{\rm ag}^{n}, \] where \(M_n\) is the executable model artifact, \(s_n\) is the optimizer state, and \(\mathcal L_n=(r_0,\ldots ,r_{n-1})\) is an append-only training ledger.
The round-record schema records the task and instance draw, policy and inference stamp, environment version, stopped trajectory, feedback and credit outputs, update decision, proposed and committed next artifact and optimizer state, random seeds, operator versions, and realized cost vector. The tuple separates executable state from optimizer state and from evidence about how that state was reached.
Definition 7. One agentic post-training round [ftip-0073]AGENTDRAFTED
Definition 7. One agentic post-training round [ftip-0073]AGENTDRAFTED
At round \(n\), fix a task \(\mathsf T_n\), its law \(\mu _{\mathsf T_n}\), and a versioned interactive realization \(\mathsf {Env}^{\upsilon _n}_{\mathsf T_n}\). Let \(\mathcal I_{\rm art}\) and \(\mathcal I_{\rm inf}\) be declared identifier spaces. Let \(a_n\in \mathcal I_{\rm art}\) be an immutable content identifier resolving the artifact \(M_n\), and let \(\iota _n\in \mathcal I_{\rm inf}\) record all serializer, decoding, tool, and stopping settings. The policy--inference stamp \(\nu _n=(a_n,\iota _n)\in \mathcal I_{\rm art}\times \mathcal I_{\rm inf}\) resolves a non-anticipating policy \(\pi _n\). Let \(\Omega _n^{\rm task}\), \(\Omega _n^{\rm roll}\), \(\Omega _n^{\rm feed}\), \(\Omega _n^{\rm credit}\), and \(\Omega _n^{\rm update}\) be declared seed spaces. The rollout seed contains both policy-decoding and environment randomness. Write \(\Omega _n=\Omega _n^{\rm task}\times \Omega _n^{\rm roll}\times \Omega _n^{\rm feed}\times \Omega _n^{\rm credit}\times \Omega _n^{\rm update}\), and let \(\omega _n=(\omega _n^{\rm task},\omega _n^{\rm roll}, \omega _n^{\rm feed},\omega _n^{\rm credit},\omega _n^{\rm update})\) be sampled from a declared joint law on \(\Omega _n\). Write \(\mathcal Z_{\mathsf T_n}\) for the stopped trajectories admitted by the versioned realization.
For declared feedback and credit spaces \(\mathcal F_n\) and \(\mathcal G_n\), decision space \(\mathcal D_n=\{\mathsf {accept},\mathsf {reject}\}\), accounting dimension \(m\geq 1\), and exact implementation versions \(v_n^{\rm S}\), \(v_n^{\rm R}\), \(v_n^{\rm F}\), \(v_n^{\rm C}\), \(v_n^{\rm U}\), and \(v_n^{\rm A}\), the round specifies maps
\[ \begin {aligned} \mathsf S_n^{v_n^{\rm S}}&: \Omega _n^{\rm task}\longrightarrow \mathcal X_{\mathsf T_n},\\ \mathsf R_n^{v_n^{\rm R}}&: \mathcal X_{\mathsf T_n}\times \Omega _n^{\rm roll} \longrightarrow \mathcal Z_{\mathsf T_n},\\ \mathsf F_n^{v_n^{\rm F}}&: \mathcal X_{\mathsf T_n}\times \mathcal Z_{\mathsf T_n} \times \Omega _n^{\rm feed}\longrightarrow \mathcal F_n,\\ \mathsf C_n^{v_n^{\rm C}}&: \mathcal X_{\mathsf T_n}\times \mathcal Z_{\mathsf T_n} \times \mathcal F_n\times \Omega _n^{\rm credit} \longrightarrow \mathcal G_n,\\ \mathsf U_n^{v_n^{\rm U}}&: \mathcal M_{\rm exec}\times \mathcal Z_{\rm opt}\times \mathcal G_n \times \Omega _n^{\rm update} \longrightarrow \mathcal D_n\times \mathcal M_{\rm exec}\times \mathcal Z_{\rm opt},\\ \mathsf A_n^{v_n^{\rm A}}&: \mathcal M_{\rm exec}\times \mathcal Z_{\rm opt} \times \mathcal X_{\mathsf T_n}\times \mathcal Z_{\mathsf T_n}\\ &\quad {}\times \mathcal F_n\times \mathcal G_n\times \mathcal D_n\\ &\quad {}\times \mathcal M_{\rm exec}\times \mathcal Z_{\rm opt} \times \Omega _n\longrightarrow \mathbb R_+^m. \end {aligned} \]The accounting map receives the starting state, proposed state, decision, and realized seeds, so update work and rejected proposals remain observable in the cost record.
They produce
\[ \begin {aligned} X_n&=\mathsf S_n^{v_n^{\rm S}}(\omega _n^{\rm task}),\\ Z_n&=\mathsf R_n^{v_n^{\rm R}}(X_n,\omega _n^{\rm roll}),\\ F_n&=\mathsf F_n^{v_n^{\rm F}}(X_n,Z_n,\omega _n^{\rm feed}),\\ \Gamma _n&=\mathsf C_n^{v_n^{\rm C}} (X_n,Z_n,F_n,\omega _n^{\rm credit}),\\ (d_n,\widetilde M_{n+1},\widetilde s_{n+1}) &=\mathsf U_n^{v_n^{\rm U}} (M_n,s_n,\Gamma _n,\omega _n^{\rm update}),\\ c_n&=\mathsf A_n^{v_n^{\rm A}}( M_n,s_n,X_n,Z_n,F_n,\Gamma _n,d_n, \widetilde M_{n+1},\widetilde s_{n+1},\omega _n). \end {aligned} \]The task sampler pushes its seed law forward to \(\mu _{\mathsf T_n}\). Conditional on \(X_n\), the rollout sampler pushes its seed law forward to the interaction law of Remark [ftip-0028] under \(\mathsf {Env}^{\upsilon _n}_{\mathsf T_n}\) and \(\pi _n\).
If \(d_n=\mathsf {accept}\), set \((M_{n+1},s_{n+1})=(\widetilde M_{n+1},\widetilde s_{n+1})\); if \(d_n=\mathsf {reject}\), set \((M_{n+1},s_{n+1})=(M_n,s_n)\). The realized cost \(c_n\) includes proposal work even after rejection. With \(v_n^{\rm ops}=(v_n^{\rm S},v_n^{\rm R},v_n^{\rm F},v_n^{\rm C}, v_n^{\rm U},v_n^{\rm A})\), append
\[ \begin {aligned} r_n={}&(\mathsf T_n,X_n,\nu _n,\upsilon _n,Z_n,F_n,\Gamma _n,d_n, \widetilde M_{n+1},\widetilde s_{n+1},M_{n+1},s_{n+1}, \omega _n,v_n^{\rm ops},c_n),\\ \mathcal L_{n+1}={}&\operatorname {append}(\mathcal L_n,r_n). \end {aligned} \]The record belongs to \(\mathcal R_{\rm ag}\) from Definition 6 and determines \(\Sigma _{n+1}\) without rewriting an earlier record.
Definition 8. Agentic post-training run [ftip-0074]AGENTDRAFTED
Definition 8. Agentic post-training run [ftip-0074]AGENTDRAFTED
An agentic post-training run fixes a finite round count \(N_{\rm ag}\geq 0\), an initial state \(\Sigma _0\), a fixed accounting dimension \(m\geq 1\), a componentwise budget \(b_{\rm ag}\in \mathbb R_+^m\), and the round specifications of Definition 7. Put \(\Omega _{\rm ag}=\prod _{n=0}^{N_{\rm ag}-1}\Omega _n\), using a singleton for the empty product. Once those specifications and their exact versions \(v_{\rm ag}\) are fixed, the run is the map
\[ \mathsf {Run}_{\Sigma _0,v_{\rm ag}}:\Omega _{\rm ag}\longrightarrow \mathcal M_{\rm exec}\times \mathcal R_{\rm ag}^{N_{\rm ag}} \times \mathbb R_+^m. \]Write a realized round-seed tuple as
\[ \omega _{\rm ag}=(\omega _0,\ldots ,\omega _{N_{\rm ag}-1}). \]The run recursively constructs \(\Sigma _1,\ldots ,\Sigma _{N_{\rm ag}}\); the seed tuple and state sequence are empty beyond \(\Sigma _0\) when \(N_{\rm ag}=0\). Its cumulative realized cost is \[ c_{\rm ag}=\sum _{n=0}^{N_{\rm ag}-1}c_n. \] The empty sum is \(0\in \mathbb R_+^m\) when \(N_{\rm ag}=0\). The map returns \((M_{N_{\rm ag}},\mathcal L_{N_{\rm ag}},c_{\rm ag})\). A run claiming the hard budget must declare a pre-admission or stopping rule that guarantees \(c_{\rm ag}\preceq b_{\rm ag}\).
The run declaration includes the task sampler, environments, serializers, rollout inference settings, feedback and credit maps, update maps, stopping rule, seed laws, implementation versions, and resource account. The round records retain every realized seed, version, decision, and cost. Leaving one of these fields implicit defines a family of runs rather than one reproducible intervention.
Remark 9. Post-training with intermediate observations [ftip-004X]AGENTDRAFTED
Remark 9. Post-training with intermediate observations [ftip-004X]AGENTDRAFTED
A proposed interactive extension of the response-level RLVR cycle in § [ftip-0042] uses the environment of § [ftip-001W] and the action boundary of Definition 1. It retains intermediate observations and environment state instead of treating a whole response as one indivisible action.
This change introduces new questions about partial observability, long-horizon credit, environment versioning, recovery after interruption, and the cost of external execution. It does not assert that multi-turn training is uniformly better than response-level training.
Example 10. A short code-agent trace with tool evidence [ftip-004V]AGENTDRAFTED
Example 10. A short code-agent trace with tool evidence [ftip-004V]AGENTDRAFTED
A failing test observation triggers a second edit, whose passing tool evidence determines the terminal result.
The public history records both edits and both test outputs. The first tool call returns the evidence string expected 9, got 6; the second returns exit status \(0\) and 1 passed. The success rule reads the second test result rather than the model's assertion that its edit is correct.
The action--observation alternation follows the tool-interleaving pattern in [yao2023react, Section 2]. The transparent sandbox interaction certifies only the displayed test result; completeness of the suite and satisfaction of unstated intent remain unverified.
Example 11. A DeepSeek-family resilient rollout and sandbox schematic [ftip-004W]AGENTDRAFTED
Example 11. A DeepSeek-family resilient rollout and sandbox schematic [ftip-004W]AGENTDRAFTED
Two coupled panels place resumable generation beside sandbox evidence in a single rollout record.
A write-ahead log and cached state allow a resumable rollout; a sandbox execution contributes a separately recorded evidence tuple. The two records should remain distinguishable when lifecycle cost is audited.
Token-granular write-ahead logging with key--value cache recovery and DeepSeek Elastic Compute (DSec), the report's named sandbox interface, are described in Sections 5.2.3 and 5.2.5 of the DeepSeek-V4 family report [⧉]. The cited sources do not establish that DeepSeek-V4-Flash-0731 used this job, resource limit, rollout schedule, or sandbox configuration.