Scaling Laws
探索人工智能中的神经缩放定律 (neural scaling laws) 和测试时计算 (test-time compute)。了解资源缩放和优化如何指导像全新的 Ultralytics YOLO26 这样的模型。
人工智能中神经缩放的经验观察表明,随着计算能力、数据集大小和参数数量等特定资源的增加,模型的性能会以可预测的方式提升。这些幂律关系最初由 OpenAI 和 Google DeepMind 等组织的研究推广开来,它表明扩展资源可以使交叉熵损失产生数学上可预测的降低。理解这些原则使研究人员和工程师能够有效地分配数百万美元的预算,在启动大规模训练运行之前,精确预测需要多大的神经网络才能达到目标准确率。
Link to this section预训练缩放的演进#
The original formulation of these rules, known as the Kaplan scaling laws introduced in 2020, established that language model performance scales smoothly with increased training compute. This framework was later refined by the Chinchilla Scaling Laws in 2022, which revealed that for optimal training, both model size and training data must be scaled in equal proportions. For instance, if you double a model's parameters, you must also double the number of training tokens. This paradigm successfully guided the development of modern Large Language Models (LLMs) built using frameworks like PyTorch and TensorFlow, ensuring that massive clusters of GPUs are utilized effectively without risking overfitting or wasting computation.
Link to this section范式转移:推理时计算缩放#
正如年度 AI 进展报告中所强调的,在 2024 年至 2025 年间,AI 行业经历了向推理时缩放的巨大转变。随着预训练更大模型开始触及收益递减和数据可用性瓶颈,研究人员发现了如何直接缩放 LLM 推理时计算的方法。通过在推理过程中为模型提供更多的处理能力,它们可以显著提高复杂推理能力。
思维链 (CoT) 和 Best-of-N 采样等技术允许模型在回答之前探索多条路径。这种推理时缩放定律由 OpenAI 的 o1 和 DeepSeek-R1 等先进模型以及其他高级推理模型首创,证明了增加预测阶段的计算量可以让更小、更高效的架构在严格的逻辑基准测试中超越大型传统模型。
Link to this section实际应用#
缩放原则不仅指导文本生成,还极大地决定了现代计算机视觉和目标检测流水线。
- 基础模型资源分配: 开发自动驾驶系统的公司依赖缩放公式来计算需要多少标注图像才能将平均精度均值 (mAP) 错误率降低到安全、可生产的水平。通过利用 Ultralytics Platform 进行协作数据标注和基于云的分布式训练,团队可以在部署前通过数学方式预测其成本。
- 模型大小与边缘部署: 缩放公式直接影响 Ultralytics YOLO26 等现代模型的架构设计。通过提供一个从纳米 (n) 到超大 (x) 进行数学缩放的统一模型系列,开发者可以根据其特定的边缘硬件约束,在严格的准确率要求与推理延迟之间进行可预测的权衡。
Link to this section代码示例:计算机视觉中的推理时缩放#
在计算机视觉中,你可以利用一种称为测试时增强 (TTA) 的实用推理时缩放形式。通过在预测阶段消耗额外计算资源来评估图像的多个增强版本,模型可以可预测地提高其检测置信度,这与在先进 LLM 中看到的推理搜索技术相呼应。
from ultralytics import YOLO
# Load the recommended YOLO26 model (nano version for high speed)
model = YOLO("yolo26n.pt")
# Perform standard inference (faster, lower test-time compute)
results_standard = model("https://ultralytics.com/images/bus.jpg")
# Perform inference-time scaling via Test-Time Augmentation (TTA)
# Predictably improves accuracy by utilizing more compute during prediction
results_tta = model("https://ultralytics.com/images/bus.jpg", augment=True)
print(f"Standard detections: {len(results_standard[0].boxes)}")
print(f"Scaled TTA detections: {len(results_tta[0].boxes)}")Link to this section缩放定律与相关概念#
虽然与硬件能力密切相关,但 AI 缩放规则具体衡量的是相对于该硬件的软件和算法效率。






