← Questions

Pack fine-tuning samples into fixed-length sequences

0
MicrosoftCodingLast asked Apr 2026

For supervised fine-tuning, pack many tokenized samples of different lengths into sequences of a fixed maximum length so little space is wasted. Return the packed sequences with the boundaries and attention or position information needed so samples do not attend to one another. Discuss the packing heuristic and samples longer than the limit. Only the title of this report was public.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding