The paper's summary of compute-efficient training gives, for a budget in PF-days, the model size, batch size, steps and data to use, and it prices the cost of picking a model times the efficient size . Implement the plan.
allocation(C_min) ( in PF-days) returns a dict of floats, each rounded to 4 significant figures (float(f"{x:.4g}")):
"N" non-embedding parameters;"B" tokens per batch (the critical batch size);"S_min" steps;"D" tokens (a single epoch);"D_over_N": D / N from the unrounded values.size_penalty(k, alpha_N=0.076, alpha_S=0.76): for a model times the efficient size, reaching the same loss, with :
Return the tuple (compute_ratio, step_ratio), each rounded to 4 decimals, or None if (the model is too small to ever reach that loss).
size_window(extra=0.2, alpha_N=0.076, alpha_S=0.76): the compute ratio equals 1 at , falls toward 1 from both sides and grows away from it. Return (k_low, k_high) with where the compute ratio equals extra, each rounded to 3 decimals. Find them to within (for example by bisection).
extra > 0.