The H-Net paper did not fit scaling laws. It reads curves: the point where H-Net overtakes the BPE Transformer, and how much less data H-Net needs to reach the same loss during the constant phase of training (the paper's answer is 3.6). Implement those readings. All curves are plain Python lists, with xs strictly increasing and positive (bytes seen), and interpolation is linear in (bytes) against loss.
stable_phase(xs, ys, warmup_frac=0.1, decay_frac=0.2)
xs[-1], return (xs2, ys2): the points with .crossover_point(xs, a, b)
a and b are losses on the same grid. Return the bytes from which a stays strictly below b through to the end of the run, as a float:
a[-1] >= b[-1], return None.a is below b at every point, return xs[0] as a float.i with a[i] >= b[i], and interpolate where reaches zero between i and i + 1.data_efficiency(xs_a, ys_a, xs_b, ys_b, n=21)
a needs than curve b to reach the same loss. Return a float.n loss levels evenly spaced between and . Raise ValueError if the ranges do not overlap, that is if the lower end is not strictly below the upper end.xs[0] if that first index is 0).a is not below b handles this for the crossover.