4 hidden checks
Implement one round of byte-pair encoding, and temperature scaling. A "sequence" here is a list of string symbols.
most_frequent_pair(seqs): given a list of sequences, return the most frequent adjacent pair as a tuple(a, b). Break ties by choosing the pair that appears first when scanning the sequences in order.merge(seq, pair): return a new list where every non-overlapping occurrence ofpair, scanning left to right, is replaced by the concatenated symbola + b.apply_temperature(logits, T): return the softmax oflogits / T(numerically stable).
- most_frequent_pair counts across sequencesnot run
- ties go to the first pair seennot run
- merge replaces non-overlapping pairs left to rightnot run
- apply_temperaturenot run