The dechunking layer has one vector per chunk and needs one vector per byte. Each byte receives the output of the most recent chunk at or before it, and the router's confidence in the decision at that byte is recorded next to it:
The subscript is 1-indexed in the paper; with 0-indexed tensors it becomes the running boundary count minus one.
causal_upsample(zbar, b)
zbar float (B, M, D), chunk vectors (possibly padded at the end of each row).b bool (B, L), boundaries for the original resolution; b[:, 0] is always True.z_tilde (B, L, D). Do not use a Python loop over B or L. Gradients must flow back to zbar.confidence(p, b)
p float (B, L), b bool (B, L). Return c float (B, L) as above. Gradients must flow to p.