But how is the length of autoregression be determined?
current_token = <prompt>
while current_token == true:
next_token = statistically[current_token][choose_random_from(common_order)]
current_token = next_token
s = inf
for i in common_order:
p = 1
x = i
while true:
x = statistically[x][common_order[x]]
if x == false:
break
p *= x
if p < s:
s = p
shortest_to_end_start_token = i s = - inf
...
if p > s:
s = p
longest_to_end_start_token = i
And then maybe you could sort all tokens by their length (if you wanted to find a length of sub-x). x = statistically[x][common_order[x][-1]] # least probable