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 of pair, scanning left to right, is replaced by the concatenated symbol a + b.
  • apply_temperature(logits, T): return the softmax of logits / T (numerically stable).
checks
  • 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
python sleeps until you press run

Press Run & check. Your code runs first, then the hidden checks on the left.