AI English Shift · Lessons / F02
Training, inference and adaptation
训练、推理与适应
Open the interactive lesson · 打开互动课程When a model changes its answer after a correction, it can look as though it has learned a permanent new fact.
当模型在收到纠正后改变回答时,看起来可能像是它永久学会了一条新事实。
訂正後にモデルが回答を変えると、新しい事実を永続的に学んだように見えることがあります。
To understand what happened, we need to distinguish changes to the model's parameters from changes to the information supplied to it.
要理解发生了什么,需要区分模型参数的变化与提供给模型的信息的变化。
実際に何が起きたか理解するには、モデルのパラメータの変化と、与えられた情報の変化を区別する必要があります。
Parameters are numerical values used in the model's computations, and training adjusts them using data and an optimization objective.
参数是模型计算中使用的数值,训练会根据数据和优化目标调整这些数值。
パラメータはモデルの計算に使う数値であり、学習ではデータと最適化の目標を用いてその値を調整します。
For a simple language-model training example, the system predicts a next token and compares that prediction with the token in the training sequence.
以一个简单的语言模型训练过程为例,系统预测下一个词元,并将预测与训练序列中实际的词元比较。
単純な言語モデルの学習例では、次のトークンを予測し、その予測を学習用の並びにあるトークンと比較します。
A loss function measures prediction error, and an optimizer uses information about that error to update parameters.
损失函数衡量预测误差,优化器利用有关误差的信息更新参数。
損失関数が予測の誤差を測り、最適化アルゴリズムがその誤差に関する情報を使ってパラメータを更新します。
Repeated updates can produce useful patterns, but reducing training loss does not imply that every generated statement will be true.
反复更新可以形成有用的模式,但训练损失降低,并不意味着生成的每个陈述都会是真实的。
更新を繰り返すと有用なパターンを獲得できますが、学習時の損失が下がっても、生成するすべての文が真実になるわけではありません。
Inference is the use of a trained model to compute outputs; ordinary inference does not update its learned parameters.
推理是使用训练好的模型计算输出;通常的推理过程不会更新已经学到的参数。
推論とは学習済みモデルを使って出力を計算することで、通常の推論では学習済みパラメータを更新しません。
Suppose a fictional company changes its delivery policy from five business days to three.
假设一家虚构公司把配送政策从五个工作日改为三个工作日。
架空の会社が配送規定を5営業日から3営業日に変更したとします。
If a user includes the new policy in the prompt, the model may answer using it because the information is present in the current context.
如果用户在提示词中加入新政策,模型就可能依据它回答,因为这条信息出现在当前上下文中。
利用者が新しい規定をプロンプトに含めると、その情報が現在のコンテキストにあるため、モデルはそれを使って回答できます。
This is an example of adapting behavior through context, rather than evidence that the underlying model has been retrained.
这是通过上下文调整行为的例子,并不能证明底层模型经过了重新训练。
これはコンテキストによる動作の調整であり、基盤のモデルを再学習した証拠ではありません。
An application might also save the policy in an external store and retrieve it during future requests.
应用也可以把政策保存在外部存储中,并在以后的请求中检索它。
アプリは規定を外部の保存先に記録し、今後のリクエストで取得することもできます。
That produces persistent application behavior without requiring the model itself to remember the policy in its parameters.
这样可以让应用持续使用该政策,而无须让模型本身把政策记在参数里。
こうすると、モデルのパラメータ自体に規定を記憶させなくても、アプリとして継続的に利用できます。
Fine-tuning is a separate training process that updates an existing model using selected examples or objectives.
微调是一个独立的训练过程,利用选定的示例或目标来更新现有模型。
ファインチューニングは、選択した事例や目標を使って既存モデルを更新する、別の学習処理です。
It may help with recurring output behavior, but it introduces dataset preparation, evaluation, and maintenance work.
微调可能有助于改善反复需要的输出行为,但也会带来数据集准备、评估和维护工作。
繰り返し必要になる出力動作の改善に役立つ場合がありますが、データ準備、評価、保守の作業が発生します。
Frequently changing policies are often better treated as versioned information to retrieve, although the final design depends on the task.
对于频繁变化的政策,通常更适合把它作为有版本管理、可供检索的信息处理,不过最终设计仍取决于任务。
頻繁に変わる規定は、版を管理して取得する情報として扱う方が適切なことが多いですが、最終的な設計は作業内容によります。
Evaluation examples should be separated from the examples used to train or repeatedly tune the system.
评估用的示例应与训练或反复调整系统所用的示例分开。
評価用の事例は、学習や繰り返しの調整に使う事例から分ける必要があります。
Otherwise, apparent improvement may reflect familiarity with the test rather than an ability to handle new situations.
否则,表面上的进步可能只是反映了系统对测试的熟悉,而不是处理新情境的能力。
そうしないと、改善に見える結果が、新しい状況に対応する能力ではなく、試験への慣れを示すだけかもしれません。
The practical question is therefore where a change lives: in parameters, current context, an external store, or application code.
因此,实际需要弄清的问题是:变化发生在参数、当前上下文、外部存储,还是应用代码中。
実務では、変更がパラメータ、現在のコンテキスト、外部保存先、アプリのコードのどこに存在するかを確認することが重要です。
Key terms
- Parameters: Numerical values learned or adjusted during training and used in a model's computations.
- Training: A process that adjusts model parameters using data and an optimization objective.
- Inference: Using a trained model to compute outputs from supplied inputs.
- In-context learning: Adapting a model's response to patterns or information supplied within its current input.
- Fine-tuning: Additional training that updates an existing model using selected data or objectives.
- Retrieval: Finding and selecting information from a collection for a particular query or task.
- Evaluation: A systematic assessment of a system against specified tasks, criteria and evidence.