Nothing in next-byte prediction tells a router how many chunks to draw: it could keep every byte and waste the compute, or keep almost none. The auxiliary ratio loss targets a downsampling factor :
ratio_loss(p, b, N, mask=None)
p float tensor and b bool tensor of the same shape, any number of dimensions. N a number greater than 1 (it may be fractional, such as 2.5). Raise ValueError if N <= 1.mask is an optional bool tensor of that shape: if given, F and G are means over the True entries only. Otherwise they are means over all entries.F must not carry gradient; G must carry gradient to p.total_loss(ar_loss, stages, alpha=0.03)
ar_loss is a scalar tensor, the autoregressive prediction loss. stages is a list of tuples (p, b, N), one per chunking stage.ar_loss.