The paper's first compute trend comes from learning curves of many model sizes trained at one fixed batch size . For a budget , a model of size can afford steps; scanning the models and keeping the lowest loss gives the frontier. Build it.
Implement compute_frontier(curves, batch_tokens, budgets):
curves: a dict mapping a non-embedding size (int) to a list of (step, loss) pairs, the logged test loss of that model during training. Steps are distinct positive ints, in no particular order.batch_tokens: the fixed batch size in tokens, the same for every model.budgets: a list of compute budgets in PF-days (one PF-day is FLOPs).For each budget , in the given order:
Return a list with one entry per budget: None if no model is available, else a dict {"budget": C, "N": best N, "step": the step used, "loss": its loss rounded to 4 decimals}.