With unlimited data, the paper fits the loss of a model with non-embedding parameters after steps (steps converted to a large batch) as with , , , . It uses this to predict later loss from the early part of a curve and to bound when early stopping happens on a finite dataset. Implement three functions.
fit_learning_curve(N, points, alpha_N=0.077, N_c=6.5e13): points is a list of (S_min, loss) pairs logged after warmup. Subtract the converged loss from each loss, keep only points whose remainder is positive, and fit by ordinary least squares of on ( is minus the slope, ). Return {"alpha_S": rounded to 4 decimals, "S_c": float rounded to 4 significant figures, "used": number of points kept}. Raise ValueError if fewer than two distinct steps are kept.
predict_loss(N, S_min, alpha_N=0.077, N_c=6.5e13, alpha_S=0.76, S_c=2.1e3): rounded to 4 decimals.
early_stop_bound(L_ND, L_N_inf, alpha_S=0.76, S_c=2.1e3): the paper's lower bound on the early-stopping step,
as a float rounded to 4 significant figures, or None if .