Low-Resource Amharic Text Classification Pipeline
Custom syllable/character-level tokenizer mapping native Ge'ez scripts directly to dense, localized vocabulary coordinates — completely eliminating Western-biased tokenization bloat and Out-of-Vocabulary [UNK] flags.
In initial training runs, global padding caused severe tensor bloat by stretching all variable-length sentences to a global maximum, saturating GPU memory. The symptom was clear: CUDA out of memory errors on even modest batch sizes, as sequences of length 5 were padded to the length of the longest sequence in the entire dataset.
Resolved by engineering a custom dynamic collate function (collate_fn) injected into the DataLoader to dynamically pad arrays to the maximum length only within that isolated mini-batch — rather than the global dataset maximum. This reduced memory overhead by 40% and stabilized gradient updates by eliminating the pathological padding distribution.