In my previous article on Claude Code's homoglyph problem, a path error led me to Unicode, security attacks and different causes of anomalous model output. Discussing training data and rewards left me with a more basic question: how exactly does data change model behavior?
I then read 猛猿's explanation of RLHF-PPO, tomsheep's introduction to Agent Lightning and Unsloth's training docs. 123 The think switch common in reasoning models also intrigued me. Why can a model write out some reasoning before answering? How does that relate to reinforcement learning and tool use?
This reading connected with earlier work. In September 2025 I helped design a travel planning product. In working documents I proposed starting with APO (Automatic Prompt Optimization) and accumulating task samples, run results and feedback. Once the company grew and training became practical, we'd consider fine-tuning or reinforcement learning. A question with a longer life than the choice of algorithm was how much data these stages could share. Could we design the data model accordingly and avoid costly recollection later?
I've long followed continual learning and reinforcement learning for agents, including how specific approaches work in practice, their costs and where they might lead. That puts the harness in scope too: the runtime system that organizes context, executes tools, manages state and records feedback. How can it serve the product today and leave interfaces for future optimization?
I'll first explain that background, then use a stage diagram and comparison table to show how models are trained. From SFT, PPO and think I'll move into agent training and return to the choice of self-improvement strategies. Readers new to training can start with the overview and consult algorithm details as needed. The thread throughout is a system performs tasks, retains experience, receives feedback, then changes prompts, memory, workflows or model parameters accordingly. Each path must define a good result, where feedback belongs and whether the update actually improves things.
September 2025: first make product experience reusable
The travel product I helped design envisioned a user giving requirements, an agent generating an itinerary, a planner reviewing and editing it, and the plan being delivered to the user. Several feedback signals arise naturally: what users click or select, where planners make changes and why, whether delivery passes review, and what the user's actual experience is. I wanted to link them so each human intervention supported the next generation as well as completing the current delivery.
In my September 2025 working document Initial Product Development Roadmap, I proposed collecting and reusing these experiences. In September 17 comments I called for user ratings, the complete history of follow-up conversations about the itinerary (chat with plan), and structured revisions (patches) by planners to AI drafts. Another comment said “最好能全链路收集 feedback” (ideally collect feedback throughout). The next day, in Development Roadmap v1 for the same product, I added “内部反馈也做到同一个数据集合里。” (put internal feedback into the same dataset too).
Comments and archived screenshots show that the following designs had been recorded by at least September 17, 2025:
| Design I proposed for the travel planning product | What I wanted to retain |
|---|---|
| Planner revision patches | Additions, removals and changes from AI draft to revision, and reasons |
| Quote + Suggest | Quote a passage and attach a suggestion, preserving its context |
| Prompt derivation and candidate comparison | Derive prompts from feedback, generate candidates for the same request and record selections |
| Prompt registry and end-to-end tracing | Prompt versions, outputs, ratings and A/B comparison relationships |
| Versioned knowledge base and data warehouse | Connect consultations, itinerary versions, feedback and patches into retrievable knowledge and samples |
| Longer-term RL + APO | After accumulating data, explore deeper model optimization with planner preferences and edits |
I also recorded the team's trade-off in the initial roadmap. We considered RL and fine-tuning, but cost and rapid base-model updates led us to prioritize prompts, workflows and data foundations. I helped develop these phased product plans. Their longer-term training goals still awaited implementation and verification.
A later work proposal, the Playbook Governance Framework PRD dated May 9, 2026, expanded on this. Playbook means a runtime and governance framework for multi-agent business workflows. It separates the business UI, governance engine, agent execution and tool data, manages workflow template versions and run instances, and feeds post-run reviews back into policy iteration. My planning expanded from “how to save one revision” to “how to manage execution and evolution of the whole system.”
The mechanism research and architecture discussion here therefore start from the same point: we may not train models immediately, but today's data and runtime should retain as much of the evidence needed for future learning as possible. The open-source frameworks I later found can help test and refine that direction.
The big picture: stages of model training
A simplified distinction: pretraining learns broad patterns of language, knowledge and tasks from large amounts of material. Post-training further shapes how the model follows task requirements, chooses better responses and uses tools. Their contributions overlap. Knowledge cannot all be credited to the former or reasoning to the latter. GPT-3 demonstrated pretrained models performing varied tasks through in-context examples. InstructGPT showed how demonstrations and preference feedback could improve instruction following on top of a pretrained model. 45
Four terms suffice for now. A token is a basic text unit, not necessarily a Chinese character or whole word. Parameters or weights are learnable numbers. A loss function turns a training objective into a number to optimize. A checkpoint stores model state at a point in training. Loss computation, backpropagation and optimizer updates gradually change the probabilities of generated content.
flowchart LR
A[数据准备与质量控制] --> B[预训练]
B --> C[基础模型]
C --> D[可选的持续预训练或中间训练]
C --> E[后训练]
D --> E
E --> F[评测与部署]
F --> G[产品推理与反馈]
subgraph P[后训练中可组合的方法]
H[SFT 学习示范]
I[偏好优化 比较回答]
J[RL 根据任务奖励学习]
end
P -.-> E
Figure 1. Introductory diagram of training stages, drawn by the author. Post-training methods can be selected, alternated and repeated. Models need not follow this exact sequence, and evaluation also runs throughout training.
Data and methods for different stages
The table focuses on autoregressive language models. Each row describes a typical approach. Specific models may combine different data and objectives.
| Stage and objective | Data | Typical technique | Main engineering requirements |
|---|---|---|---|
| Pretraining: build broad foundational capabilities | Large, diverse, filtered text, code and possibly synthetic Q&A. Human-written target answers for each passage are usually unnecessary. | Predict subsequent tokens from preceding text. The text supplies its own targets. Pretraining from scratch starts with initialized weights. | Cleaning, deduplication, sources, mixture proportions, tokenization and loading. At scale, distributed training and reliable checkpoint recovery.46 |
| Continued pretraining or mid-training: add capabilities such as domain knowledge or long context | Relevant domain material, long sequences or synthetic tasks, often mixed with existing data | Continue from an existing checkpoint, potentially changing objectives, sequence lengths and sampling recipes | Control distributions and learning rate, monitor regression in old capabilities. Longer sequences increase memory and compute requirements.67 |
| Supervised fine-tuning (SFT): learn how to respond and act for a task | Inputs and high-quality targets, including Q&A, multi-turn dialogue, tool calls or revised demonstrations | Can still use token-prediction loss, often only on designated response or action positions | Chat templates, role/tool formats, training masks and demonstration quality. LoRA can support small-scale adaptation.589 |
| Preference optimization, e.g. DPO: favor better responses | Paired answers to the same input conditions with a preferred version labeled | Directly adjust relative answer probabilities with a preference objective. Classic DPO need not train an independent reward model first. | Consistent criteria, comparable inputs, negative example quality and reference policy settings. Higher/lower ratings alone don't automatically form usable preference pairs.10 |
| Reinforcement learning (RL): increase likelihood of behaviors earning task rewards | Tasks, answers or interaction trajectories sampled from the model, and corresponding rewards. Agents also need environments and tools. | Policy optimization such as PPO or GRPO. Rewards may come from a model trained on human preferences, rules or verifiers. | Coordinate sampling and training, design rewards, reset environments, track policy versions and allocate credit. Generation and tool execution can dominate time.111213 |
Post-training is the umbrella category, with SFT, preference optimization and RL among its common methods. RLHF emphasizes human feedback and isn't synonymous with PPO. DPO and RL are not mandatory sequential steps. DeepSeek-R1-Zero studied applying RL directly to a base model. Other recipes establish consistent behavior through SFT first. 14
Continued pretraining and mid-training aren't strict synonyms either. The former emphasizes continuing pretraining-style learning from an existing model. The latter indicates a phase's position in a recipe and naming varies. Phi-4's mid-training included long-context extension, for instance, but not every project's mid-training does only that. 7
One task across all stages
Suppose we want itineraries satisfying constraints. Pretraining can supply general patterns from language, geography, code and planning texts. Continued domain pretraining can add curated specialist material. SFT demonstrates how to ask questions, call tools and give an itinerary under these requirements. Preference optimization compares two plans for the same request and indicates which better meets the criteria. Agent RL lets the model look things up and revise routes in an interactive environment, receiving rewards for constraint satisfaction.
The data needs expand from learnable material to demonstrations, comparisons and trials with known conditions. A final itinerary without original requirements and tool results is hard to turn into a reliable behavioral training sample. A low user rating without a reason gives little indication which behavior should become less likely.
Cost bottlenecks differ too. Large-scale pretraining depends on long-term throughput, data coverage and distributed stability. SFT can repeatedly compute loss over fixed data. Agent RL must repeatedly generate answers, execute tools and score results. Few training samples needn't mean low compute or execution cost. LoRA and QLoRA address parameter-update and memory costs. They cannot replace the work of obtaining demonstrations, preferences or rewards. 815
Two more distinctions are easy to conflate. Distillation and synthetic data aren't fixed chronological stages. A teacher model can provide demonstrations or other signals, and synthetic data can enter pretraining or post-training. 167 Inference and evaluation usually leave parameters unchanged. Generating longer reasoning, calling a tool or running a test suite does not itself constitute training. When APO improves a closed model through prompt search, it changes the system's input configuration.
A product team can explore much by adopting an existing model and doing APO, SFT or task RL. Saving reusable data does not make pretraining one's own base model from scratch necessary. Let's distinguish inference from parameter updates more precisely before unpacking post-training methods.
Context changes and parameter updates happen in different places
For an autoregressive language model, write next-token generation as:
Here is input context, the tokens generated so far and the model parameters. A user's follow-up, a tool result or the model's own reasoning steps all change the context for the next step.
This gives a direct distinction: in ordinary inference a model can change its answer with fixed parameters. Training updates parameters through a loss, backpropagation and an optimizer. DeepSpeed-Chat explicitly separates generating experience from performing parameter updates. 11
flowchart LR
subgraph I[一次普通推理]
A[输入与已有上下文] --> B[模型生成新 token]
B --> C[追加到上下文]
C --> B
end
subgraph T[一次训练迭代]
D[示范或模型生成的样本] --> E[计算损失与训练信号]
E --> F[反向传播与优化器更新]
F --> G[新的模型参数]
end
Figure 2. Context changes versus parameter updates, drawn by the author. Inference usually fixes parameters. Parameters produced by training can be used for subsequent inference.
An erroneous character copied after entering context therefore doesn't establish contaminated weights. A different propagation path arises if samples with systematic errors are selected for training and actually influence parameters. Saving chat history, updating memory files and inserting retrieved passages into prompts are not model training merely because they preserve information.
This matters especially when asking whether an agent gets smarter with use. Better memory retrieval can improve a system, or a separate training run might update its model. Identify which step actually occurred.
From imitating demonstrations to learning preferences
Supervised fine-tuning (SFT) usually begins with demonstrations pairing inputs and desired outputs. Training increases the model's tendency under similar inputs to generate the demonstrated content and format. Demonstrations may be short answers or include reasoning steps, tool calls or whole interactions.
Many questions lack a unique correct answer. For the same code explanation, people may prefer an accurate concise version over a repetitive one. InstructGPT's classic pipeline first performed SFT on human demonstrations, then collected preference rankings over answers and trained a reward model, and finally optimized the language model using PPO. 5
These data serve distinct purposes:
| Data or signal | Information supplied | Training use |
|---|---|---|
| Input and demonstration answer | Desired response | SFT learns the demonstration |
| Comparison of answers to one input | Which answer is preferred | Train a reward model or optimize preferences directly |
| Newly generated model answer | What the current policy actually does | RL sampling and evaluation |
| Answer validation, test outcomes, etc. | Whether a checkable target is satisfied | Construct a task reward |
RLHF describes human feedback's role in training, while PPO is a policy optimization algorithm. They aren't synonyms, and not every post-training method requires four models and the same workflow.
A reward model is easily mistaken for a judge holding the right answer. It learns a proxy for preferences in its data, which may favor particular expression and miss factual errors. Optimizing its score won't automatically remove those biases. 5
How the four PPO roles work together
In a common RL formulation of language generation, the state is prompt plus generated prefix, the action the next token, and the policy the language model's probability distribution over tokens.
DeepSpeed-Chat's RLHF-PPO implementation has four roles. “Updated” below refers to this PPO phase, irrespective of earlier training. 11
| Role | Main output or purpose | Updated in this phase? |
|---|---|---|
| Actor, policy model | Generates answers and computes probabilities of selected tokens | Yes |
| Reward model | Evaluates completed answers | No |
| Critic, value model | Estimates future cumulative return given the current prefix | Yes |
| Reference model | Provides fixed probabilities to constrain policy drift | No |
flowchart TD
P[一批提示词] --> A[Actor 生成回答]
A --> X[提示词与回答组成的同一条序列]
X --> R[Reward 给出回答分数]
X --> V[Critic 估计各前缀的价值]
X --> F[Reference 计算对应 token 的概率]
A --> L[保存采样策略的 token 概率]
R --> S[构造奖励与优势估计]
V --> S
F --> S
L --> S
S --> U[计算损失并更新 Actor 与 Critic]
Figure 3. PPO data flow using DeepSpeed-Chat as an example, drawn by the author. Reference and Reward are frozen in this phase. Not every implementation needs four entirely separate networks for the roles.
Reward and Critic are easiest to confuse. The former evaluates an answer already generated. The latter learns to predict expected return if generation continues from this prefix under the current policy. Its state value is a baseline, not foreknowledge of what one particular next action will earn.
For example, if Critic estimates future return of 0.4 for a prefix and one continuation has an estimated return of 0.7, it did better than the baseline. Differences like this help decide whether to encourage or discourage the behavior. These numbers are illustrative. Implementations often use generalized advantage estimation (GAE), combining multi-step temporal-difference errors to balance bias and variance. 17
How a score for a complete answer influences earlier tokens
DeepSpeed-Chat doesn't need independent human preference scores for every token. It first computes a reference constraint at each generated position, then adds the whole-answer reward to the last valid generated position. Omitting details such as reward clipping: 11
Here is the answer score and controls the reference constraint. The log-probability difference for a sampled action can be negative on a particular observation. It isn't the exact KL divergence summed over the vocabulary. The relationship to KL comes from its expectation under the corresponding policy distribution.
An end reward doesn't mean only the last token learns. Return and advantage estimation connect subsequent outcomes to earlier decisions. The Critic trains its predictions against those return estimates. Its targets themselves contain estimates, so they aren't error-free objective truths. 17
The Reference needn't independently generate another answer and compare strings. Feed the Actor's sequence to the reference model and extract the probability of the same token under the same prefix. A causally masked forward pass scores every position of a known sequence together. 11
What the two references constrain
PPO updates also use a different reference from the fixed Reference model: the old policy that collected this batch of samples. Across several updates reusing a batch, old-policy probabilities stay fixed and new-policy probabilities change with the parameters. Their ratio is:
The surrogate objective maximized by PPO-Clip includes this term: 18
Here is the advantage estimate and sets the clipping interval.
For a positive-advantage action, raising its probability improves the objective, but beyond a certain ratio this term no longer supplies the same incentive. For negative advantage, clipping limits the incentive to decrease the probability excessively.
Clipping applies to the objective. It doesn't guarantee a probability stays in bounds or that the whole model stops updating outside the interval. Other samples and loss terms still affect shared parameters. Training may also use KL monitoring and early stopping. 19
The fixed Reference concerns drift from reference behavior. The old policy measures the distance from the sampling policy on this batch. That distinction explains why ref_log_probs and old_logprobs aren't redundant.
From PPO to DPO and GRPO
With that mechanism in view, ask which part other methods replace.
Direct Preference Optimization (DPO) in the classic offline setting uses preference pairs directly and optimizes probability relationships relative to a reference policy. It needs no separate trained reward model followed by PPO's online sampling and Critic updates. It isn't just PPO by another name. 10
Group Relative Policy Optimization (GRPO) samples a group of answers for one question and estimates advantages through relative rewards within the group, dispensing with a separate Critic. It still generates samples, computes rewards and updates the policy. Dropping the Critic does not drop evaluation. 12
For a simple example, generate four answers to one question. If two pass validation and two fail, the group differences supply a signal. If all receive the same reward, within-group comparison distinguishes little. Difficulty, sampling and reward design directly affect whether training helps.
Reinforcement Learning with Verifiable Rewards (RLVR) emphasizes rewards from answer checkers, tests or other verification mechanisms. This differs from choosing PPO or GRPO: the former describes where rewards come from, the latter how those rewards update a policy.
How think capability connects to a switch
Seeing <think>...</think> makes it easy to view thinking mode as an output format. Format is part of it, but why did the model learn to generate useful steps at this position?
Training makes intermediate steps useful
DeepSeek-R1-Zero applied RL directly to an already pretrained base model without preceding SFT. The paper reports reasoning and self-checking behaviors, along with poor readability and mixed languages. The subsequent R1 recipe added stages including cold-start data. “Zero” does not mean the model lacked pretraining. 14
Rewards in such experiments can emphasize final answer correctness without requiring human standard solutions for each reasoning step. Generated intermediate tokens enter subsequent input. Training can increase the probabilities of generation paths more likely to reach high rewards.
A correct final answer doesn't establish every explanation step is correct or that the displayed text fully explains internal computation. Controlled studies have found input biases influencing answers that weren't always mentioned in explanations. A chain of thought is an observable generated sequence. Its role requires experimental assessment. 20
Qwen3's published training procedure gives another concrete path: cold-start on long chains of thought, apply reasoning RL, fuse thinking and non-thinking modes, then apply general RL. 21

Figure 4. Qwen3 post-training. Source: Qwen Team (2025), Post-training. Original image retained. 21
The figure distinguishes flagship and smaller model paths. Smaller models can gain capabilities through distillation from a stronger model, so every size needn't independently pass through exactly the same four stages. Distillation here means using stronger-model outputs or distribution signals to train a smaller one. 16
Reasoning capabilities can therefore arise from several training combinations. “RLHF forces a model to write reasoning first” is no universal explanation. Demonstrations, verifiable rewards, preferences and mode fusion each play roles.
Templates turn control options into input
For example, the official template for Qwen3-8B from the initial 2025 series supports enable_thinking. When disabled, it puts an already closed, empty thinking block at the start of assistant generation, essentially: 22
<think>
</think>
This prefixes generation with “the thinking section has ended.” When thinking is enabled, /think and /no_think also allow switching through textual instructions. Their effect depends on model training and its template. They aren't universal commands. 22
A switch needn't retrain the model as the request arrives. It changes the input conditions to invoke learned behavior. Adding the same string to another model may imitate the format or have no consistent effect.
Output parsing and budgets are separate controls
After generation, a service can parse reasoning and answer into separate fields. DeepSeek's API uses reasoning_content and content. Switches, budgets and whether reasoning is passed back on later turns depend on the model and API version. 23
This field split belongs to the service protocol. It implies neither two backend models nor a common <think> tag across vendors.
Similarly, a total generation limit like max_new_tokens is distinct from a dedicated thinking budget. The answer might be incomplete when total length runs out. Ending thinking at a budget and continuing to answer requires the corresponding model behavior or service control. Qwen3's technical report describes inserting an end-thinking prompt when the budget is reached, then letting the model answer. 16 A larger budget gives more compute opportunity. Judge its value by answer quality, latency and cost, not reasoning text length alone.
Agent training: actions can span an entire model call
RL for one response can treat each token as an action. An agent task may search, read results, revise a query, execute code and then produce a final answer.
For example, a research agent might follow this sequence:
问题 → 生成检索词 → 搜索工具返回资料
→ 判断信息不足并再次检索 → 生成最终回答
A low final score could come from bad search terms, choosing the wrong source or incorrectly summarizing a correct source. Associating outcomes with earlier decisions is the credit assignment problem. This adds engineering around trajectories, evaluation and learning between being able to call tools and improving tool use through training.
Agent Lightning treats the entire output of one LLM call as an action and organizes an interaction trajectory into transitions of inputs, outputs and rewards. Token-level optimization can still happen within each call. The paper distinguishes agent state from the actual input the model observes, which may omit some system information. 13

Figure 5. Single-call GRPO, multi-turn concatenation and LightningRL compared. Source: Luo et al. (2025), Figure 3. Original image retained. 13
In the paper's implementation, each call initially receives the final task return. The underlying algorithm handles token-level training signals. This simplified assignment doesn't identify each step's independent contribution. If the task succeeds, a pointless intermediate search might receive positive feedback too. The objective still needs to fit the task.
Splitting into transitions has limits. It avoids the training system forcibly concatenating all calls into one extra-long sequence. If a particular call already includes a long history, that input stays long. Summarization, retrieved memory and context trimming belong to the agent's own input construction.
Separating execution from training still requires a complete workflow
Figure 6. Agent Lightning's Training-Agent Disaggregation architecture. Source: Luo et al. (2025), Figure 4. Original image retained. 13
The architecture separates the agent side, where tools and business workflows execute, from the training side, which handles model generation, trajectory management and parameter updates. An existing agent can integrate through a compatible call interface, reducing the cost of rewriting training logic for different business frameworks. 13
But “change an API address” covers only integration. Updating weights still requires a trainable model, task data, rewards, a training backend and evaluation and deployment of the updated model. Forwarding a closed model request to a proxy cannot grant the ability to change its parameters.
The paper experimented on text-to-SQL, RAG and mathematical tool use. The “ANY” in its title expresses the design aim of supporting many agents. Whether a task benefits still depends on useful trajectories, reasonable feedback and completed training.
Continual learning requires specifying what changed
While designing a feedback loop for travel planning, I kept asking how agents could improve through use. Continual learning is the common research term. Product discussions also use “continuous learning.” In concrete designs, first specify where experience was stored and how the next run uses it.
Reflexion turns task feedback into reflective text in episodic memory to affect later attempts, without changing model weights. 24 Voyager accumulates executable skills through black-box model calls, likewise without fine-tuning parameters. 25 These illustrate system-level learning but don't make every memory update PPO-style training.
| Improvement method | What actually changes | Effect on future runs |
|---|---|---|
| APO | Prompts, examples or related configuration | Uses a selected new input configuration |
| Memory and skill accumulation | External records, executable skills and versions | Retrieves, loads or invokes these items |
| Routing and workflow optimization | Branch rules or a separately trained decision policy | Changes tool/model selection, retry and stop decisions |
| Fine-tuning and parametric RL | Trainable parameters of an LLM or another policy model | Generates actions with an updated policy |
Distinguish training a policy to manage memory from writing one record at runtime. The first may update parameters. The latter executes one action of that policy. A harness can host these mechanisms without itself being a training algorithm.
Similarly, specify which workflow decisions can be optimized. If code fixes the branch after a tool call, training an LLM won't rewrite that code. If LLM output determines the branch, optimizing the model may change the choice. Agent Lightning's separation of execution and training doesn't mean it only optimizes outer scheduling or leaves the underlying model fixed. 13
What Unsloth contributes
While Agent Lightning helps organize the data flow between agent execution and training, Unsloth provides hands-on model fine-tuning and RL tooling and tutorials. Its docs are an entry point for SFT, GRPO and reward experiments. 326 Within the agent improvement ecosystem, distinguish coordination of execution and optimization from training components that actually update parameters.
There are working combinations. Unsloth publishes a guide to multi-turn agent training with ART (Agent Reinforcement Trainer) + Unsloth. ART organizes trajectories containing tool calls, returns and subagents, collects rewards and uses a backend to update the model. 27 ART backend docs list local implementations with Unsloth and torchtune. Here Unsloth is genuinely one component of a complete workflow. 28
Agent Lightning's 0.2.0 documentation also supplies an Unsloth SFT example: run tasks, collect trajectories and token information, filter answers by reward, then perform LoRA SFT with Unsloth to produce the next checkpoint. Filtering uses rewards, but the update is still supervised fine-tuning. That version also offers APO and verl integrations. APO then optimized only one prompt template at a time. 92930
Thus the two projects that drew me in both relate to improvement but play different roles. Agent Lightning connects execution, data and optimization. Unsloth is closer to a training component that such a framework can use. They can be combined, rather than viewed as two interchangeable full-stack solutions. Integration still depends on model, algorithm, data and software versions.
Separate training algorithms from parameter-update mechanisms too. LoRA freezes base weights and adds trainable low-rank updates to selected layers. QLoRA additionally uses a quantized base model to reduce VRAM while training adapters. They answer which parameters update and how to reduce cost. SFT and RL answer which signal drives updates. 815
Using LoRA therefore still trains parameters. Freezing base weights does not limit the system to in-context learning. Changes to adapters also change output behavior.
The previous article's homoglyph issue suggests a focused experiment: have a model preserve the exact input-specified string in tool arguments. First compare prompts on the same task, then SFT. Consider RL only after establishing reliable verification. A possible design:
| Element | Design |
|---|---|
| Task | Extract the target path and output structured tool arguments |
| Samples | Ordinary paths, valid multilingual paths and distractors with visually similar but different characters |
| Primary measure | Does the output path exactly match the specified target? |
| Control | Use the same base model and prompt template and compare before/after |
| Independent test | Hold out paths, combinations and distractor characters, grouping by template source to prevent leakage |
| Cost measures | Besides accuracy, record generation length, latency and malformed output rate |
“Only output ASCII” would be the wrong objective. A real user-specified path may be Chinese or Cyrillic. Unrequested transliteration would be an error. Optimize faithful identifier preservation and make rewards reflect the task's meaning.
Avoid rewarding format alone too. Valid JSON with the wrong path still parses. Task rewards must check field values. Outside training, tools can also validate arguments deterministically. This is an experimental design, not an already demonstrated fix.
Practical paths to self-improvement
After finding these integrations I cared more about which part of our current business to make optimizable. “Self-improvement” covers several technical routes. An optimizer, a training framework and an ecosystem spanning runtime to deployment have different scopes.
The following representative approaches have papers or official implementations. They illustrate architecture trade-offs rather than a popularity ranking. Project capabilities and published experiments come from their respective sources. The comparison of benefits, costs and business fit is my engineering judgment.
| Route and representative approach | What it changes and covers | Benefits | Costs and boundaries |
|---|---|---|---|
| DSPy / GEPA: feedback-driven prompt optimization31 | Propose, evaluate and combine prompt candidates from traces and textual feedback; an optimization layer | Retains existing model APIs and directly uses “what went wrong and how to change it” | Repeated candidate runs cost money and may overfit development data. Collection and production deployment need surrounding systems. |
| EvoAgentX: workflow evolution32 | Connect workflow generation, execution, evaluation and optimization across prompts, tool configuration and topology | Explores system structure beyond one prompt, relevant to multi-agent workflows | Larger search space. Restrict mutable structures, preserve versions and verify business constraints. |
| LangGraph + LangMem: memory and procedural experience33 | Extract, store and retrieve experience within the runtime and optionally update prompts | Needs no access to weights. Fits accumulating user preferences and task experience. | Incorrect memories can be reused repeatedly. Needs conflict handling, expiry, deletion and retrieval evaluation. |
| Agent Lightning: connect execution and optimization1392930 | Organize agent runs into data and interfaces for APO, SFT or RL, depending on version and backend | Retain existing execution logic and add optimization methods gradually | Supply tasks, rewards and training environments. A common interface does not guarantee benefits for every agent. |
| ART + Unsloth: multi-turn agent RL2728 | Sample trajectories, reward, train and iterate the model | Concrete path from existing agent to parameter training, suitable for bounded tool tasks | Needs trainable models, compute and repeatable environments. Automatic judges can misreward. |
| AgentScope ecosystem + Trinity-RFT: runtime and training infrastructure3435 | Ecosystem covers execution, memory, evaluation and training. Trinity-RFT separates exploration, training and data buffering. | Suits joint planning of environment interactions, data pipelines and training | Broader configuration and operations. A complete component set doesn't connect a business loop automatically and can be heavy at small scale. |
| AgentEvolver: further automate learning36 | Combines task generation, experience-assisted exploration and credit assignment | Optimizes where training tasks come from and how to explore effectively | Requires interactive environments and trustworthy feedback. Generated tasks need external validation against real user needs. |
Chronology matters. Releases or papers for LangMem, Trinity-RFT, EvoAgentX, GEPA and Agent Lightning appeared during 2025. The Agent Lightning integration docs above date to October 2025, and AgentEvolver's paper to November. 1393132333436 They help me revisit my September 2025 travel product proposal but cannot establish that I had already selected implementations published later. The AgentScope row describes its ecosystem when I consulted it, without dating all those components back to the initial proposal.
Which approaches can substitute for one another, and which work together?
GEPA and Lightning's APO implementation can both generate and compare prompt candidates, but their search methods, data interfaces and scope differ. EvoAgentX extends the mutable space to workflow structure and isn't a drop-in replacement for a single-prompt optimizer.
Lightning, ART and Trinity-RFT all connect agent interactions to model optimization and can be compared as training architectures. Their abstractions and backends differ, so migration takes more than swapping a package name. Discuss Unsloth at the training implementation layer. ART offering Unsloth or torchtune does not make Unsloth a wholesale substitute for verl or Trinity-RFT. 283034
With those distinctions, I can draw the combinations in my system as follows. The branches are choices and needn't all be adopted at once.
flowchart TD
A[业务任务与人工反馈] --> B[Harness 执行与轨迹记录]
B --> C[版本化经验与评测数据]
C --> D[提示词与工作流优化]
C --> E[记忆与技能整理]
C --> F[SFT 与偏好优化]
C --> G[任务与环境准备]
G --> H[当前策略重新采样与 Agent RL]
D --> I[候选版本]
E --> I
F --> I
H --> I
I --> J[独立评测与发布控制]
J --> B
Figure 7. A data and execution feedback loop for multiple optimization methods. Drawn by the author as an architectural proposal, without implying interoperability of these frameworks has been implemented.
OpenAI and Anthropic: how product experience enters model and system iteration
These public solutions raise a natural question: how do the companies behind Codex and Claude Code use product experience to improve later systems? They face many of the same problems as open-source frameworks while also controlling model research, product harnesses, evaluations and deployment. I'll first outline verifiable public practices, then give a reference design I consider closest in terms of responsibilities.
This section draws on sources available November 14, 2026. It discusses a research and development loop without equating every in-session adaptation with weight updates or assuming either company uses the open-source components listed below.
OpenAI: connecting real-task training with product signals
At Codex's 2025 launch OpenAI said codex-1 was trained with reinforcement learning on real software engineering tasks in diverse environments. Goals included following instructions, matching human preferences for code and PRs, and completing work by running tests, observing results and revising. This establishes that environmental interaction participated in training. “Real tasks” by itself doesn't establish that training materials came from arbitrary users' production repositories or sessions. 37
A public Codex research role further listed responsibilities connecting product and training: build data, environments, graders and training methods, turn failures into training data, product fixes or research directions, and work with product teams to turn usage signals into model improvements. That is public evidence of roles and responsibilities, not a full training recipe. 38
Product experience can change execution systems directly too. In introducing GPT-5.3-Codex, OpenAI described using an early model to analyze training and evaluations and help diagnose context rendering and caching issues. This kind of feedback can enter both model R&D and harness or service engineering. 39
OpenAI also published a developer example: collect agent traces, add human and model feedback, turn it into repeatable evaluations and propose harness changes for Codex to implement. This resembles my travel product proposal to collect feedback and improve prompts and workflows. It's a public tutorial rather than a replica of OpenAI's internal training pipeline. 40
Anthropic: from usage feedback to repeatable behavioral evaluations
Anthropic's public Claude Code retrospective describes a clear path. Early iteration drew on employee and external user feedback. The team then established evaluations for concision, file editing and overengineering and combined production monitoring, A/B tests and user research to advance improvements. It distinguishes trajectories from outcomes: an agent declaring completion doesn't establish that the environment's final state satisfies the requirement. 41
Feedback can thus become a measurable problem first. “It often changes too much” can become tasks checking edit scope, necessity and final functionality, beyond assigning the original session a low rating. Experiments determine whether the specific fix belongs in prompts, tools, context or model.
Anthropic's transparency materials also list multiple data sources for training, including public or nonpublic data, internally generated data and eligible user data. Some descriptions list deduplication and classification methods as well. This supports authorized data being processed for model development but doesn't disclose proportions of Claude Code traces going to SFT, preference optimization or RL. 42
The public evidence emphasizes different things. OpenAI's Codex materials explicitly describe real-task RL and research team responsibilities. Anthropic's Claude Code materials explain more specifically how feedback becomes behavioral evaluations. Differences in disclosure do not show that either company lacks the other capability.
Retention, troubleshooting, evaluation and training are different data uses
A product's access to certain interactions does not make all of them available for training. According to the official descriptions at the time of review:
| Product and account | Boundaries on model-improvement use |
|---|---|
| Individual Codex account | Task content follows relevant model-improvement settings. Complete environments have a separate Include environments setting. |
| OpenAI business products and API | Inputs and outputs are not used for training by default. Separate sharing choices and agreements must be handled individually. |
| Claude Code consumer account | With the model-improvement option enabled, relevant data may train future models. |
| Claude Code business account | Code and prompts are not used for training by default, except where customers separately choose to share. |
These are usage rules, not proof a particular record went into training. 4344 Claude Code's session satisfaction survey explicitly distinguishes ratings from optional subsequent trace sharing and says materials from that survey channel cannot be used for model training. Other feedback channels and training preferences are separate mechanisms. 44
In my design each record should link to usage permissions as well as provenance and version. Sessions for support, internal regression material and data eligible for training can overlap or remain isolated. A boolean saying the user provided feedback cannot express these distinctions.
A reference pipeline spanning product, evaluations and training
I think a design resembling these public practices lets product execution, task and evaluation development, and model training each operate separately, connected by versions and evidence. Completeness comes from assigning responsibility throughout, not from one algorithm covering everything.
flowchart TD
A[产品 Harness 执行任务] --> B[用途许可与采集规则]
B --> C[轨迹、反馈、结果与环境快照]
C --> D[清洗、标注、分组与版本化]
D --> E[问题归类与可复现任务]
E --> F[提示词、工具、记忆或 Harness 修改]
D --> G[经审核的示范与偏好数据]
E --> H[训练环境与评分器]
H --> I[待训练策略重新采样]
G --> J[模型后训练]
I --> J
F --> K[候选系统版本]
J --> K
K --> L[独立评测与回归比较]
L --> M[灰度发布与线上观察]
M --> A
M --> N[失败案例与下一轮研究问题]
N --> E
Figure 8. Product and post-training iteration based on public evidence, designed by the author. This is not an internal architecture diagram of either company. Usage permissions constrain all data paths. Evaluation eligibility does not confer training eligibility. See Figure 9 for the cross-generation pretraining branch.
The components below are open-source implementations with relevant responsibilities, not a list verified to fit seamlessly together. Capabilities follow the official docs. “Still to build or verify” is an engineering judgment for this design, not a claim that a project lacks the function in every configuration. Blank cells indicate no selection or specific gap for this review, not the absence of solutions. Distinguish hosted or enterprise capabilities from open-source releases.
Step 1: Turn product runs into experience backed by evidence
| Stage | Artifacts to retain | Possible open-source components | Still to build or verify in this design |
|---|---|---|---|
| 1. Define tasks and success | Constraints, delivery standards and cost budgets | Business owners weigh quality, conversion and human editing effort | |
| 2. Run agents and handle human intervention | Actual inputs, actions, tool results, state and interruptions | LangGraph; AgentScope4535 | Business tools, context assembly, environment snapshots and rules for side effects |
| 3. Decide collection and usage scope | Source, permitted purposes, rule version, retention and withdrawal status | Connect and enforce product settings and organization rules across derived datasets | |
| 4. Collect traces and attach feedback | Traces, sessions, call relationships, latency and costs | OpenTelemetry + Langfuse4647 | OpenTelemetry has no storage backend. Add business links between task IDs, patches, environment outcomes and product feedback. |
| 5. Handle sensitive content and quality | Processed copies, filtering reasons and processing versions | Presidio; Data-Juicer4849 | Detection rules for proprietary code and business fields. Check processing preserves task meaning. De-identification doesn't replace usage permission. |
| 6. Human revisions and preference labels | Quote anchors, edit reasons, preferences and disagreement handling | Argilla50 | Custom patch and multi-turn review UI. At review time the project had announced no new features, so consider maintenance and extension costs. |
| 7. Freeze auditable data versions | Manifests, transformations, provenance and splits | DVC51 | Split by session, repository or task family. Propagate changes in source permissions to future exports. |
Final outcomes are easiest to overlook here. An agent saying “done,” a tool exiting zero and a user actually accepting delivery are three different events. For travel, record how much planners changed and which version the user accepted. For coding, distinguish model changes, test results and later human revisions. These are fields I'd retain, without implying both companies collect them.
Step 2: Route experience to an appropriate optimization path
| Stage | Artifacts to retain | Possible open-source components | Still to build or verify in this design |
|---|---|---|---|
| 8. Classify failures and choose where to intervene | Hypothesis, reproduction conditions and candidate change target | Distinguish model, context, tool, material and changed requirements. Automated clustering can't replace root-cause experiments. | |
| 9. Construct tasks, environments and verifiers | Initial state, instructions, environment version and verification rules | Harbor; AgentEvolver for exploring task generation5236 | Wrap the business system as a resettable environment, calibrate generated tasks, isolate verifiers and check for reward loopholes. |
| 10A. Optimize external behavior configuration | Candidate prompts, workflows, memory or skills | GEPA / Lightning APO; EvoAgentX; LangMem31293233 | Bound permitted edits, separate user preferences from global rules and fix comparison conditions. |
| 10B. Learn demonstrations and preferences | Reviewed training sets, training records, models or adapters | Unsloth; Lightning's Unsloth SFT example39 | Construct matched preference pairs, select training positions and verify truncation and template consistency. Not all successful trajectories are demonstrations. |
| 10C. RL through environment interaction | New policy trajectories, reward components, sampling-policy version and checkpoints | ART + Unsloth; Lightning + verl; Trinity-RFT273034 | Environment adapters, rewards, credit assignment and asynchronous policy versions. Old production logs cannot masquerade as current-policy samples. |
| 10D. Prepare next-generation or continued pretraining | Verified corpora, mixture recipe, tokenization, training config and checkpoints | Data-Juicer + DVC for data; Megatron Core for large-scale training495153 | Transform traces into appropriate material, control diversity and sampling, and prevent cross-stage test leakage. Components don't supply a complete recipe. |
10A–10D are branches that can run independently or be combined in stages. 10D extends into base-model iteration, beyond what every product team needs to take on. Separate task and dataset registries: a failure can contribute a task definition without providing an answer worth imitating. The RL branch uses tasks and environments for new policy attempts. Product records supply the problem distribution and task leads. The next section explores cross-generation pretraining transformations.
Harbor organizes tasks, environments, verification and batch execution here. It doesn't automatically turn a production incident into a sound experiment. 52 Recreating “selected the wrong same-named file” still requires preserving or reconstructing directory structure, inputs and acceptance rules. If users later added requirements, preserve when they did so to avoid labeling reasonable behavior under incomplete information a failure.
Step 3: Verify the full system and ship a version back to the product
| Stage | Artifacts to retain | Possible open-source components | Still to build or verify in this design |
|---|---|---|---|
| 11. Independent evaluation and regression | Baseline comparisons, failures, cost and stability metrics | Promptfoo; Harbor; Langfuse545247 | Adapter for the actual harness, untouched test sets, calibrated business scores and repeated trials |
| 12. Manage candidate system versions | Checkpoints, configurations, data and experiment provenance | MLflow + DVC; Langfuse for prompt versions555147 | Bind model, template, tools, harness and memory snapshot into one releasable version |
| 13. Serve candidate model inference | Callable model service and serving config | vLLM56 | Match training templates, tokenizer, tool protocol and numerical settings. Compatible APIs don't guarantee identical behavior. |
| 14. Gradual rollout, observation and rollback | Traffic allocation, quality metrics, release records and rollback target | Argo Rollouts; OpenTelemetry + Langfuse574647 | Argo Rollouts targets Kubernetes. Connect business metrics, experiment grouping, long-session version pinning and agent configuration rollback separately. |
| 15. Form the next research tasks | Regressions, open problems and next task priorities | Product and research jointly choose model or system changes, avoiding repeated optimization against the current grader alone. |
MLflow can manage model versions and the training runs they came from. Argo Rollouts can advance or reverse deployments based on configured metrics. These alone don't define an agent version. 5557 I'd release a combination: checkpoint or provider model ID, prompt template, tool protocol, harness code, available skills and versions of context resources. Otherwise rolling back a model could leave the new tool or summarization policy that caused the problem.
How I'd choose a component combination
To retain our business system while adding optimization methods gradually, I'd first assess the existing harness or LangGraph / AgentScope, with OpenTelemetry and Langfuse recording execution, versioned tasks and data connecting GEPA, SFT and agent RL, and independent evaluations and release controls deciding whether a candidate enters the product. Lightning could connect execution and optimization. If multi-turn model RL is already a definite investment, then compare ART, Trinity-RFT and related routes.
These training frameworks are alternatives to compare, without needing to chain all of them. Include Unsloth only for suitable models and training methods. A small team can implement interfaces with a database, object storage and simple release scripts, then replace parts as data volume, parallel training and operations grow. A complete division of responsibilities doesn't require deploying every component on day one.
What resembles the companies' public practices is that one type of product problem can yield different improvements: a regression case, a harness fix, supervised samples or an RL environment. There are clear gaps from their internal systems. Public frameworks don't supply private task distributions, review experience, training recipes or large-scale research infrastructure. Neither company has disclosed enough to establish equivalence for a particular combination in implementation or performance.
For my data model this section adds requirements beyond tasks, runs and feedback: explicitly retain usage_policy_id, environment_version, verifier_version, dataset manifests and a release combination ID, linked to optimization experiments. A planner patch can then support near-term APO and, when conditions mature, suggest a training task. Its actual uses still depend on permitted purpose, input conditions and verification.
Post-training experience can also feed the next generation's pretraining
Extend the pipeline across time. Can material prepared for today's post-training enter the next generation's pretraining? Yes, after reassessing and transforming the data rather than copying the previous training file unchanged. “Originally prepared for post-training” describes a use, not a permanent property of a record.
Which research supports this cross-stage use?
Instruction Pre-Training used a model to generate instruction–response pairs for raw corpora and combined them with the original text for pretraining. Experiments covered pretraining from scratch and continued domain pretraining, retaining next-token prediction and loss over all tokens. This directly shows instruction–response format isn't exclusive to SFT. 6
The Phi-4 technical report describes synthetic data for pretraining, mid-training and post-training, showing generated data can participate in several stages. 7 Both studies support reuse of formats and generation methods across stages. They don't establish that a vendor directly mixed a former product post-training dataset into the next generation's pretraining.
For OpenAI and Anthropic, public material lists data sources and training stages but is insufficient to identify stage destinations and proportions for individual batches of Codex or Claude Code traces. This cross-generation design is a research-supported possibility, not a publicly documented complete recipe from either company. 5842
One experience can become different training materials
Pretraining and SFT can both use token-prediction loss while differing in data distribution, sampling proportions and where loss is calculated. Preference optimization and RL add comparisons or rewards. A change of use therefore requires checking content and objective together.
| Existing material | Possible transformation for pretraining or continued pretraining | What cannot simply carry over |
|---|---|---|
| High-quality instructions and answers | Turn into task demonstrations, Q&A or explanatory prose and mix with other corpora | Don't assume equal sampling weights or that all must preserve the original dialogue format |
| Human revisions and patches | Reconstruct requirements, fixes and verification as a case with complete conditions | If the revision depends on new information, include it in the training context first |
chosen / rejected preference pairs | Select a reviewed answer or explicitly construct comparison and correction material | Ordinary token prediction doesn't automatically treat rejected as negative reward |
| Successful RL trajectories | After verification, extract useful tool-use or problem-solving demonstrations | Final success doesn't validate every step. Removing useless steps must preserve state relationships. |
| Failed trajectories and repairs | Label errors, causes and corrections or generate new verifiable tasks from them | Indiscriminate imitation may reinforce errors. Appending a low rating is not a negative policy update. |
| Rewards, advantages and old policy probabilities | Use for filtering, weighting, quality analysis or provenance | These values depend on original task and policy. They don't directly become policy-gradient signals in ordinary next-generation pretraining. |
The table proposes transformations. Effectiveness needs controlled experiments on a specific model. A failed record that scheduled a closed attraction on Monday could keep the correction process or inspire a new task with opening-day constraints. Extracting only the final corrected itinerary doesn't establish the model learns to check opening hours.
Across generations, pass on reviewed materials or use an older model to create new ones
One route reuses reviewed, high-quality material directly. Another uses the previous generation's post-trained model to turn task leads into new demonstrations, questions or correction cases, verified with rules, tools or humans before joining candidate corpora. That uses the old model's abilities without copying every production conversation.
flowchart TD
A[经许可的产品经验与任务线索] --> B[高质量示范与纠错材料]
A --> C[上一代模型生成候选材料]
C --> D[验证、去重与质量筛选]
B --> E[按用途建立数据集版本]
D --> E
E --> F[当前模型后训练]
E --> G[下一代预训练或中间训练]
G --> H[下一代基础模型]
H --> I[下一代后训练]
I --> J[评测、部署与新的产品经验]
Figure 9. Cross-stage and cross-generation use of experience and synthetic material, drawn by the author. Every arrow needs independent processing and usage decisions. No material automatically enters training.
Outputs from an old model still need verification. They may repeat errors or make many samples too similar. More generated material does not necessarily add independent knowledge. Long reasoning text doesn't guarantee correct reasoning. Sources, diversity, verification outcomes and duplication should all feature in the recipe.
Keep facts in the data model and express purpose in dataset versions
In my design the raw experience layer retains task conditions, execution, feedback and provenance. Each transformation creates a new version linked to source records. Stage, sampling weights, templates and loss masks belong in datasets or training experiments, without permanently classifying raw records as “SFT only.”
Add transformation versions, generating model and prompt versions, verifier and results, and target training stage. Record usage permission separately from actual use: material permitted for training need not have been used by any run. Several versions derived from one source should be traceable to the experiments each entered.
Independent test isolation must span stages. Even if a test question stayed out of SFT, inclusion in pretraining makes it no longer unseen by that model. Rewriting it into synthetic material can also leak. Check exact duplicates, near variants and common origins together.
This clarifies “prepare for future training from APO onward.” Retain traceable experience and transformation rules, then decide when abilities, cost and validation allow whether to use them for prompts, post-training the current model or developing the next base model. Paths can share provenance without sharing identical training samples.
Prepare reusable data starting with APO
Returning to “start with APO and consider fine-tuning as needed” for the travel product, both approaches need task definitions, evidence of what's wrong and ways to compare changes. Their optimization targets differ. In one representative APO study a model generates textual feedback on errors, rewrites prompts, searches and selects candidates. The paper's “gradient” is natural-language feedback rather than backpropagation through the target model's weights. 59
What I want to share, then, is how tasks and experience are recorded, with different datasets generated as needed. My September 2025 Initial Product Development Roadmap proposed versioned itineraries, retaining planner patches, grouping feedback by business topic and deriving training samples. The data objects below refine that plan in light of published frameworks. They are a proposed logical design, not a database that was already live back then.
Store tasks, executions and evaluations separately
| Data object | Core contents to retain | Contribution to later optimization |
|---|---|---|
Task Task | ID, input, context material versions, constraints, expected result or verification rules, source group | Compare alternatives on the same task |
Configuration version ConfigVersion | Prompts/templates, model ID, sampling settings, harness/tool versions, memory/skill snapshot | Identify the configuration producing each result |
Execution Run | Task/config links, attempt ID, parent run and branches, candidate comparison group, status, termination reason, duration and usage | Distinguish generations, parallel candidates, retries and human takeover |
Step Step | Actual messages received by the model, generation, tool arguments and results, parent/child relationships and order | Reconstruct decision evidence and organize multi-turn trajectories |
Evaluation Evaluation | Target, evaluator and rule versions, component scores, evidence and time | Reevaluate results without collapsing everything into one score |
Annotation Annotation | Source anchor, edited version, patch, rationale, preference comparison, annotator source and whether new information was added | Decide whether an edit can serve as a demonstration or matched preference pair |
Dataset version DatasetVersion | Included tasks, runs and annotations, filtering, splits, intended uses and export-format version | Inspect which data an optimization actually used |
Optimization experiment OptimizationRun | Dataset version, base config/checkpoint, algorithm and parameters, code version, candidates and evaluation results | Trace a prompt, adapter or policy version to the experience producing it |
These are logical objects, not necessarily independent services from the start. At small scale use relational tables and object storage for long content. Preserve relationships, versions and original evidence.
For instance, displayed chat history might omit system prompts, retrieved passages or tool messages. With only UI text, you'll lose what the model actually saw. Keep structured messages and snapshots of actual requests linked to templates. Mark inaccessible provider-internal context unknown. For character fidelity, avoid storing only normalized strings and thus erasing the code-point differences responsible for an error.
Append evaluations instead of overwriting prior scores. Today's rule grade and tomorrow's human review should both be traceable. Store cost, correctness, format and user feedback separately, combining them with versioned reward rules. That makes it possible to inspect whether the model optimized only easy points.
Using the same records for different optimization methods
APO can choose prompts from tasks, candidate configurations, errors and evaluations. SFT needs suitable inputs and target outputs filtered from those records. Not every step of a successful run deserves imitation, and a human revision should retain its link to the original answer. DPO needs clear preference pairs under the same inputs. A high and low score from different tasks cannot simply be paired. 10
PPO and GRPO impose additional sampling requirements. Training may need exact token sequences, training masks, sampling policy or checkpoint version, old policy probabilities and GRPO task sample groups. Distinguish termination from length truncation. Save these as training-run extensions when available, rather than demanding every internal value from an early closed API. 1112
Old logs can reveal errors, prepare tasks and identify demonstrations, but complete logs alone cannot serve as current-policy PPO or GRPO batches. Usually the relevant policy still needs to resample, or you need a method explicitly supporting offline data. 1812
Isolate tests from the APO stage onward. Data repeatedly used to select prompts has already influenced optimization and can't become a wholly unseen final test during fine-tuning. Group by session, task source or template family to reduce leakage of similar samples. Record optimization permissions and necessary de-identification with provenance rather than losing the basis for decisions at export.
Turning one planner correction into different learning material
Suppose the agent schedules a museum visit for a family on Monday and a planner moves it to Tuesday with the note “closed Mondays.” A final itinerary alone leaves a plausible answer. Retaining the original quote, patch and reason lets us ask whether opening hours were in the material visible at the time. Did retrieval miss them, or were they found and ignored?
If the original context already included the closure, the feedback can be an APO failure case, the reviewed revision an SFT demonstration, and original and revision potentially a preference pair. If the planner supplied the closure afterward, retain the new source and reconstruct the training input. Don't treat it as an answer the model should have known from the same original input.
For agent RL this case can help define a task: give dates and traveler constraints, have the current policy search, check and build a route, then verify opening days and scheduling conflicts. The historical patch supplies the task and error type. The corresponding policy should still produce the training trajectory in an appropriate environment.
My September 2025 note to “put internal feedback into the same dataset too” needs a more precise data interpretation: linking feedback to the same task doesn't mean mixing different sources or input conditions into one label type. Keep raw facts faithful and give APO, SFT, DPO and RL their own traceable transformations.
Making business scores reliable optimization targets
My feedback design considered user clicks, conversion, planner ratings and revisions. These all matter but measure different things. An itinerary getting more clicks isn't necessarily more feasible. Conversion can depend on price, channel and human service. No feedback cannot simply be treated as satisfaction.
I'd retain feedback in groups: checkable time, budget and opening-day constraints; planners' professional judgments; explicit user preferences; and behavioral outcomes such as clicks, conversion and subsequent experience. Record observation time and source for each. Versioned rules select the signals an experiment uses. For delayed outcomes, track the delivery and how many human revisions intervened.
In the September 2025 roadmap I used “PASSK” to discuss pass rates and candidate selection. A concrete evaluation must separate first-generation deliverability, the probability at least one of several candidates qualifies, and final pass rate for the planner's chosen candidate. More candidates or human selection can improve the latter two without better single-generation capability. Report candidate count, selection method, human editing effort and total cost together.
An automatic judge can reduce annotation costs. ART's RULER, for instance, evaluates trajectories. 27 In the business setting I'd still calibrate it using human review and deterministic checks. A higher model score only indicates product improvement if the score actually tracks product goals.
Revisiting my travel product architecture through public approaches
Comparing the September 2025 product feedback design and May 2026 Playbook governance proposal with published approaches is most useful at the level of responsibilities. The table is my current analysis of which capabilities could fill gaps in the original plans, without suggesting I had adopted these projects back then.
| Design in my work proposals | Relevant approach or mechanism | What still needs adding |
|---|---|---|
| Quote + Suggest, patches and reasons | APO / GEPA improve prompts using error traces and textual feedback5931 | Original anchors and versions, information newly introduced during editing, feedback quality review |
| Multiple prompt candidates, prompt derivation, workflow branches | GEPA candidate search and EvoAgentX workflow optimization3132 | Fair comparisons, search budgets, independent tests and workflow edit boundaries |
| Prompt → Output → Score and prompt registry | Lightning connects execution records with optimization1329 | Actual inputs per call, parallel call relationships, config snapshots and artifact provenance |
| Knowledge base and experience feedback | LangMem's factual, episodic and procedural memory33 | Distinguish facts, user preferences and behavioral rules. Handle expiration, conflicts and incorrect memories. |
| Warehouse sample layer, eventual fine-tuning and RL + APO | Lightning + Unsloth SFT example and ART multi-turn RL279 | Purpose-specific transformation, trainable models, current-policy sampling and business verifiers |
| Playbooks, run instances and reviews | Execution/training separation, Trinity-RFT exploration, training and data organization133435 | Environment resets, replay boundaries, release evaluation, policy rollback and runtime cost attribution |
Looking back, what I'd keep is treating human edits and user feedback as durable product data before deciding on a training algorithm and versioning both prompts and routes. Then business experience can remain reusable even when the base model or optimization framework changes.
What needs work is the middle layer between “collected feedback” and “valid learning signal.” One score can't explain where an error arose. A revision may have different inputs from the original. A successful delivery may depend on substantial human rescue. Modeling those relationships clearly will save more future rework than choosing PPO or GRPO early.
APO → SFT → RL makes sense as progressively larger investments but shouldn't be mandatory for every product. Update facts in a knowledge base, consider memory for individual preferences, and start with demonstrations and validation for stable formats. For multi-step decisions with verifiable outcomes, evaluate agent RL. Let failure types and evaluations determine where to optimize.
Data preparation also constrains the harness design
Here “harness” means the execution system around the model. It selects context and tools, handles returned results and decides when to retry or stop. The May 2026 Playbook Governance Framework PRD already placed templates, runs, governance and retrospectives in one design. Based on this research I'd also require evaluable decision records and stable interfaces for multiple optimization methods.
First, record proposed actions separately from what tools actually did. Generating a call does not mean it succeeded. Parameter corrections, denials and timeouts need distinct events. Multi-agent and parallel tool calls need parent/child relationships and call IDs rather than all text concatenated chronologically.
Second, make context construction observable. Record selected memory, skills and retrieved material, and where summarization or truncation happened. Otherwise a behavior change is hard to attribute to a prompt improvement versus changed sources, tool behavior or memory versions.
Third, keep independent interfaces for execution, evaluation and optimization. After a run, rules or people can evaluate its trajectory, then APO or a training job can consume the result. Return optimization outputs as prompt versions, skill versions or model checkpoints, used only after evaluation. Agent Lightning's training/execution separation provides a concrete reference. 13
“Continual” needn't mean updating the production model after every request. Accumulating batches, optimizing offline, comparing on fixed evaluations and releasing a new version can also give a continuously improving product. For parametric continual learning, check whether old tasks regress as new ones improve. Increasing current reward alone can't show whether capabilities were forgotten.
Finally, distinguish replay for inspection from resampling. Replaying a request with saved tool results suits diagnosing parsing and context. Actually rerunning the task with a changed policy produces a new interaction path. Historical snapshots can't guarantee perfect replication of external APIs, web pages or databases. Operations with write side effects should not be treated as endlessly retryable reads.
These choices turn evaluation needed for early APO into preparation for SFT, preference optimization or agent RL. They improve traceability and extensibility without promising that future frameworks need no adaptation.
Concretely, draw four boundaries: run a task under a configuration and emit its trajectory; append evaluations to a specified result; generate candidate configurations or models from a dataset; and release a passing candidate to designated traffic. The optimizer needn't rewrite a live instance. Template-version snapshots in my Playbook proposal can also keep a task's configuration consistent throughout its run.
How I'd proceed and what I'd keep watching
I'd first build a bounded feedback loop. Select a frequent task, save actual input, prompt version and human revisions, classify errors and create an independent test set, then compare a few APO candidates. “Did this change reduce human editing, and at what cost?” is easier to verify than the value of integrating every training framework up front.
If the main problem is stable, repeated behavior and we have good demonstrations, run a small SFT or preference optimization comparison. Invest in agent RL only when tasks need multi-step exploration, evaluation is reliable, the environment is repeatable and current solutions still have marked shortcomings. At every stage compare with the current base model and a simple prompt so maintenance costs don't outweigh gains.
Several directions from these approaches remain worth following. They're architecture judgments and research questions, without assuming each is mature.
- Multiple update mechanisms working together. Prompts, memory, skills and weights may handle changes at different frequencies. How should we choose where to update and attribute the gains? Lightning exploring APO and training interfaces together and LangMem handling memory and prompts provide concrete starting points. 29933
- From retaining traces to constructing learning tasks. Beyond collecting logs, generate repeatable tasks, variants and verifiers from real failures. AgentEvolver incorporates task generation and experience-assisted exploration. In practice, check how well these tasks cover real needs. 36
- Finer evaluation and credit assignment. Conversion, completion or passing tests alone cannot identify a contributing step. Combining local constraints, process evidence and final outcomes to avoid rewarding useless steps warrants continued experimentation. 1336
- Measure ongoing improvement together with long-term stability. Observe new-task gains alongside old-task regressions, latency, cost and human intervention. Tasks and tools change, memory expires and training can impair prior abilities. Release mechanisms should detect regression and restore a usable version.
For my product planning, what matters most is being able to answer after models and frameworks change: where did this experience come from, who changed the system because of it, what changed, and is the effect repeatable? Traceable experience and comparable executions let architecture evolve with evidence.
Rethinking anomalous behavior in training
Returning to the previous article's question, we can now specify what to investigate: was an anomalous string already in demonstrations, did the reward miss an error, did the model copy something from context, or did the inference service malfunction? These routes need different evidence.
The DeepSeek-R1 paper offers a close example: reasoning training produced language mixing, and researchers added a language-consistency reward that improved readability with a small reported performance trade-off. 14 Some language behavior that looks unnatural may reflect optimization trade-offs without necessarily implying poisoning. But that's the authors' experiment, not a root-cause explanation for the Claude Code homoglyph incident.
What I gained by following the question into training was the ability to distinguish what SFT demonstrated, what rewards measured, which behaviors PPO or GRPO amplified and how templates trigger those behaviors.
Looking back at “start with APO and keep data for later training” in my 2025 travel product documents, I still think the order suited that team's circumstances. The framework and mechanism research now lets me refine my original patches, versioning and feedback design into relationships among tasks, trajectories, evaluations, optimization experiments and releases.
This gives data modeling and harness design the same direction: each run should retain enough evidence to explain, compare and reuse it later. String fidelity is only a small starting point. What I want to accumulate is tasks and feedback supporting future product iteration, rather than ever-longer chat logs alone.
References
Footnotes
-
猛猿. (2024, December 17). 图解大模型RLHF系列之:人人都能看懂的PPO原理与源码解读 [更新日期]. 知乎. https://zhuanlan.zhihu.com/p/677607581 。 ↩
-
tomsheep. (2025, August 10). Agent Lightning:可以训练「任何」AI 智能体的强化学习框架. 知乎. https://zhuanlan.zhihu.com/p/1937109083623782314 。 ↩
-
Unsloth. (n.d.). Fine-tuning LLMs guide. Retrieved November 14, 2026, from https://unsloth.ai/docs/get-started/fine-tuning-llms-guide 。文档首页。 ↩ ↩2 ↩3
-
Brown, T. B., et al. (2020). Language models are few-shot learners. https://arxiv.org/abs/2005.14165 。预训练、语料混合与上下文少样本学习的代表性研究。 ↩ ↩2
-
Ouyang, L., et al. (2022). Training language models to follow instructions with human feedback. https://arxiv.org/abs/2203.02155 。 ↩ ↩2 ↩3 ↩4
-
Cheng, D., Gu, Y., Huang, S., Bi, J., Huang, M., & Wei, F. (2024). Instruction pre-training: Language models are supervised multitask learners (Version 1). https://arxiv.org/html/2406.14491v1 。原始语料与合成指令—回答对用于从零预训练和领域持续预训练;参见 §2.2 的训练目标与损失范围。 ↩ ↩2 ↩3
-
Abdin, M., et al. (2024). Phi-4 technical report (Version 1). https://arxiv.org/html/2412.08905v1 。特别参见预训练与中间训练合成数据、长上下文中间训练及后训练的分别介绍。 ↩ ↩2 ↩3 ↩4
-
Hu, E. J., et al. (2021). LoRA: Low-rank adaptation of large language models. https://arxiv.org/abs/2106.09685 。 ↩ ↩2 ↩3
-
Microsoft / Agent Lightning. (2025, October). SFT with Unsloth [Version 0.2.0 documentation]. https://microsoft.github.io/agent-lightning/0.2.0/how-to/unsloth-sft/ 。本文引用该版本的轨迹筛选与 SFT 示例,不代表所有后续版本的接口都相同。 ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7
-
Rafailov, R., Sharma, A., Mitchell, E., Ermon, S., Manning, C. D., & Finn, C. (2023). Direct preference optimization: Your language model is secretly a reward model. https://arxiv.org/abs/2305.18290 。 ↩ ↩2 ↩3
-
Microsoft / DeepSpeed Team. (2023). DeepSpeed-Chat PPO trainer [Source code, commit e86d0c6d38d65158836c275e2d7b6a8f8e92f026]. https://github.com/deepspeedai/DeepSpeedExamples/blob/e86d0c6d38d65158836c275e2d7b6a8f8e92f026/applications/DeepSpeed-Chat/dschat/rlhf/ppo_trainer.py 。重点参见
generate_experience、compute_rewards、get_advantages_and_returns与两个 loss 函数。 ↩ ↩2 ↩3 ↩4 ↩5 ↩6 -
Shao, Z., et al. (2024). DeepSeekMath: Pushing the limits of mathematical reasoning in open language models. https://arxiv.org/abs/2402.03300 。 ↩ ↩2 ↩3 ↩4
-
Luo, X., Zhang, Y., He, Z., Wang, Z., Zhao, S., Li, D., Qiu, L. K., & Yang, Y. (2025). Agent Lightning: Train ANY AI agents with reinforcement learning. https://arxiv.org/html/2508.03680v1 。项目仓库。本文架构与图示以该论文版本为准。 ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 ↩11 ↩12
-
DeepSeek-AI, et al. (2025). DeepSeek-R1: Incentivizing reasoning capability in LLMs via reinforcement learning (Version 1). https://arxiv.org/html/2501.12948v1 。特别参见 R1-Zero 与 §2.3.2 的语言一致性奖励。 ↩ ↩2 ↩3
-
Dettmers, T., Pagnoni, A., Holtzman, A., & Zettlemoyer, L. (2023). QLoRA: Efficient finetuning of quantized LLMs. https://arxiv.org/abs/2305.14314 。 ↩ ↩2
-
Qwen Team. (2025). Qwen3 technical report (Version 1). https://arxiv.org/html/2505.09388v1 。参见 §4.3 的思考预算与 §4.5 的强到弱蒸馏。 ↩ ↩2 ↩3
-
Schulman, J., Moritz, P., Levine, S., Jordan, M., & Abbeel, P. (2016). High-dimensional continuous control using generalized advantage estimation. ICLR. https://arxiv.org/abs/1506.02438 。 ↩ ↩2
-
Schulman, J., Wolski, F., Dhariwal, P., Radford, A., & Klimov, O. (2017). Proximal policy optimization algorithms. https://arxiv.org/abs/1707.06347 。 ↩ ↩2
-
OpenAI. (n.d.). Proximal policy optimization. Spinning Up documentation. https://spinningup.openai.com/en/latest/algorithms/ppo.html 。 ↩
-
Turpin, M., Michael, J., Perez, E., & Bowman, S. R. (2023). Language models don't always say what they think: Unfaithful explanations in chain-of-thought prompting. https://arxiv.org/abs/2305.04388 。 ↩
-
Qwen Team. (2025, April 29). Qwen3: Think deeper, act faster. https://qwenlm.github.io/blog/qwen3/ 。 ↩ ↩2
-
Qwen Team. (2025). Qwen3-8B model card and tokenizer configuration. https://huggingface.co/Qwen/Qwen3-8B ; https://huggingface.co/Qwen/Qwen3-8B/blob/main/tokenizer_config.json 。本文的开关示例针对该模型,配置页面于 2026 年 11 月 14 日查阅。 ↩ ↩2
-
DeepSeek. (n.d.). Thinking mode. API documentation. Retrieved November 14, 2026, from https://api-docs.deepseek.com/guides/thinking_mode/ 。 ↩
-
Shinn, N., Cassano, F., Berman, E., Gopinath, A., Narasimhan, K., & Yao, S. (2023). Reflexion: Language agents with verbal reinforcement learning. https://arxiv.org/abs/2303.11366 。 ↩
-
Wang, G., et al. (2023). Voyager: An open-ended embodied agent with large language models. https://arxiv.org/abs/2305.16291 。 ↩
-
Unsloth. (n.d.). Reinforcement learning (RL) guide. Retrieved November 14, 2026, from https://unsloth.ai/docs/get-started/reinforcement-learning-rl-guide 。 ↩
-
Unsloth. (n.d.). Training AI agents with RL. Retrieved November 14, 2026, from https://unsloth.ai/docs/get-started/reinforcement-learning-rl-guide/training-ai-agents-with-rl 。介绍 ART + Unsloth、多轮轨迹和 RULER;不将文档中的效果宣传视为任意业务上的保证。 ↩ ↩2 ↩3 ↩4 ↩5
-
OpenPipe / ART. (n.d.). ART backend. Retrieved November 14, 2026, from https://art.openpipe.ai/fundamentals/art-backend/ 。组件关系以查阅时文档为准;项目仓库。 ↩ ↩2 ↩3
-
Microsoft / Agent Lightning. (2025, October). APO [Version 0.2.0 documentation]. https://microsoft.github.io/agent-lightning/0.2.0/algorithm-zoo/apo/ 。该版本明确限定为单个提示模板优化。 ↩ ↩2 ↩3 ↩4 ↩5
-
Microsoft / Agent Lightning. (2025, October). VERL [Version 0.2.0 documentation]. https://microsoft.github.io/agent-lightning/0.2.0/algorithm-zoo/verl/ 。介绍 Lightning 对 verl 的包装与集成。 ↩ ↩2 ↩3 ↩4
-
Agrawal, L. A., et al. (2025). GEPA: Reflective prompt evolution can outperform reinforcement learning. https://arxiv.org/abs/2507.19457 。首次提交于 2025 年 7 月 25 日;DSPy 官方 GEPA 文档。论文中的比较结果有特定实验条件,本文不将其概括为 APO 普遍优于 RL。 ↩ ↩2 ↩3 ↩4 ↩5
-
Wang, Y., Liu, S., Fang, J., & Meng, Z. (2025). EvoAgentX: An automated framework for evolving agentic workflows. https://arxiv.org/abs/2507.03616 。首次提交于 2025 年 7 月 4 日;项目仓库。 ↩ ↩2 ↩3 ↩4
-
LangChain Team. (2025, February 18). LangMem SDK for agent long-term memory. https://www.langchain.com/blog/langmem-sdk-launch 。官方文档。 ↩ ↩2 ↩3 ↩4 ↩5
-
Pan, X., et al. (2025). Trinity-RFT: A general-purpose and unified framework for reinforcement fine-tuning of large language models. https://arxiv.org/abs/2505.17826 。首次提交于 2025 年 5 月 23 日;项目仓库。 ↩ ↩2 ↩3 ↩4 ↩5
-
AgentScope. (n.d.). AgentScope open-source stack. Retrieved November 14, 2026, from https://agentscope.io/ 。本文据查阅时的生态介绍讨论运行、记忆、评价和训练的职责划分,不据此判断各组件在 2025 年的可用状态。 ↩ ↩2 ↩3
-
Zhai, Y., et al. (2025, November 13). AgentEvolver: Towards efficient self-evolving agent system. https://arxiv.org/abs/2511.10395 。项目仓库。 ↩ ↩2 ↩3 ↩4 ↩5
-
OpenAI. (2025, May 16). Introducing Codex. https://openai.com/index/introducing-codex/ 。本文引用 codex-1 的任务环境与 RL 训练说明,不据此推断用户数据来源。 ↩
-
OpenAI. (n.d.). Research engineer, Codex. Retrieved November 14, 2026, from https://openai.com/careers/research-engineer-codex-san-francisco/ 。该岗位说明用于核实研究团队的公开职责,不作为内部系统实现或训练结果的证据。 ↩
-
OpenAI. (2026, February 5). Introducing GPT-5.3-Codex. https://openai.com/index/introducing-gpt-5-3-codex/ 。特别参见模型辅助自身训练研发、部署与 harness 排障的介绍。 ↩
-
Pasfield, W. / OpenAI. (2026, May 12). Build an agent improvement loop with traces, evals, and Codex. https://developers.openai.com/cookbook/examples/agents_sdk/agent_improvement_loop 。这是开发者示例,不是 OpenAI 内部训练系统的披露。 ↩
-
Anthropic. (2026, January 9). Demystifying evals for AI agents. https://www.anthropic.com/research/demystifying-evals-for-ai-agents 。介绍 Claude Code 从用户反馈到行为评测的迭代,以及任务、轨迹、结果与 harness 的区分。 ↩
-
Anthropic. (n.d.). Transparency Hub: Model reports. Retrieved November 14, 2026, from https://www.anthropic.com/transparency 。不同模型分别列出训练数据与方法;本文不推断各来源在 Claude Code 训练中的占比。 ↩ ↩2
-
OpenAI. (n.d.). How your data is used to improve model performance. Retrieved November 14, 2026, from https://help.openai.com/en/articles/5722486-how-your-data-is-used-to-improve-model-performance 。Data controls in ChatGPT。数据规则按查阅时版本理解。 ↩
-
Anthropic. (n.d.). Data usage. Claude Code documentation. Retrieved November 14, 2026, from https://code.claude.com/docs/en/data-usage 。特别参见训练政策、反馈入口与会话质量调查的不同规则。 ↩ ↩2
-
LangChain. (n.d.). LangGraph overview. Retrieved November 14, 2026, from https://docs.langchain.com/oss/python/langgraph/overview 。有状态 Agent 的编排、持久执行与人工介入能力。 ↩
-
OpenTelemetry. (n.d.). What is OpenTelemetry? Retrieved November 14, 2026, from https://opentelemetry.io/docs/what-is-opentelemetry/ 。遥测生成、采集与导出框架;存储与可视化由其他后端承担。 ↩ ↩2
-
Langfuse. (n.d.). Langfuse overview. Retrieved November 14, 2026, from https://langfuse.com/docs 。包含轨迹、提示词管理与评测等能力;选型时区分开源自托管与商业功能。 ↩ ↩2 ↩3 ↩4
-
Presidio. (n.d.). Presidio documentation. Retrieved November 14, 2026, from https://presidio.dataprivacystack.org/ 。敏感信息检测与去标识处理;原 Microsoft 文档地址已跳转至该站点。 ↩
-
Data-Juicer. (n.d.). Data-Juicer [Project documentation]. Retrieved November 14, 2026, from https://github.com/datajuicer/data-juicer 。包含数据处理、筛选与去重等可组合操作。 ↩ ↩2
-
Argilla. (n.d.). Argilla [Repository and maintenance notice]. Retrieved November 14, 2026, from https://github.com/argilla-io/argilla 。提供人工反馈与数据标注工作流;查阅时仓库说明不再添加新功能,继续处理缺陷修复。 ↩
-
DVC. (n.d.). Get started with DVC. Retrieved November 14, 2026, from https://doc.dvc.org/start 。数据与模型版本、数据处理流水线及实验管理。 ↩ ↩2 ↩3
-
Harbor. (n.d.). Harbor documentation. Retrieved November 14, 2026, from https://docs.harborframework.com/ 。任务、环境、验证器与 Agent 批量执行;此处的 Harbor 是 Agent 评测框架。 ↩ ↩2 ↩3
-
NVIDIA. (n.d.). Megatron Core user guide. Retrieved November 14, 2026, from https://docs.nvidia.com/megatron-core/developer-guide/latest/user-guide/index.html 。大规模模型训练组件、数据准备与并行策略;不等于完整的基础模型数据和训练配方。 ↩
-
Promptfoo. (n.d.). Introduction. Retrieved November 14, 2026, from https://www.promptfoo.dev/docs/intro/ 。开源评测与红队测试工具,可连接自定义模型或应用接口。 ↩
-
MLflow. (n.d.). MLflow model registry. Retrieved November 14, 2026, from https://mlflow.org/docs/latest/ml/model-registry/ 。模型版本、别名、元数据与实验来源关系。 ↩ ↩2
-
vLLM. (n.d.). vLLM documentation. Retrieved November 14, 2026, from https://docs.vllm.ai/en/latest/ 。模型推理与服务组件。 ↩
-
Argo Project. (n.d.). Argo Rollouts. Retrieved November 14, 2026, from https://argoproj.github.io/argo-rollouts/ 。基于 Kubernetes 的渐进发布、指标分析与回退。 ↩ ↩2
-
OpenAI. (n.d.). How ChatGPT and our foundation models are developed. Retrieved November 14, 2026, from https://help.openai.com/en/articles/7842364-how-chatgpt-and-our-foundation-models-are-developed 。介绍数据来源和训练阶段,未逐批披露产品轨迹在各阶段的使用方式。 ↩
-
Pryzant, R., Iter, D., Li, J., Lee, Y. T., Zhu, C., & Zeng, M. (2023). Automatic prompt optimization with “gradient descent” and beam search. https://arxiv.org/abs/2305.03495 。本文以 APO 泛指自动提示词优化,不限定产品当时已选用这篇论文的算法。 ↩ ↩2