训练是从数据中教授 ML 模型的过程(学习模式、调整参数),而推理是使用已训练的模型对新数据进行预测。它们是具有不同特征和成本的不同阶段。
训练与推理
text
TRAINING → teaching the model (the LEARNING phase):
→ feed lots of DATA → the model adjusts its parameters to learn patterns
→ computationally EXPENSIVE (lots of data, compute, time — e.g. training an LLM costs
huge resources); done once (or periodically to update)
→ produces a trained MODEL
INFERENCE → using the trained model (the PREDICTION phase):
→ give the trained model NEW input → it produces an output (prediction/generation)
→ much CHEAPER/faster than training (a single forward pass); done MANY times (every
time you use the model)
→ train once (expensive), infer many times (cheaper, in production)
