
How do byte-level language models work?
I've recently been trying to pre-train my own small language model on the tiny-series datasets on huggingface: https://huggingface.co/collections/nampdn-ai/tiny-series-6503910fd491144159519c70. I also wanted to use a model similar to MEGABYTE: https://arxiv.org/pdf/2305.07185.pdf, but I don't understand how using bytes would work. The only implementation I could find: https://github.com/lucidrains/MEGABYTE-pytorch used str(chr(max(32, token))) to decode any token (byte) to a character and put the embedding size as 256. Firstly, why 256 and not 256-32 as any values below 32 are ignored? Also, many byte-level models including this and ByteT5 mention that they can process any text sequence even in a multilingual setting, however how would that be true if we are only using one byte, would we have to move to 2 bytes or use an UNK token, and if we did use 2 bytes that would make our embedding size around 65000 which defeats sort of the point as one of the advantages mentioned is that we are able to use a small embedding matrix? Furthermore, most language models add special tokens like bos, eos, unk and even for llama they use beginning of instruction, end of instruction, and more for system instructions, response, context... Should I use something like this as my dataset has some structures where there is a context, instruction and response, and if i did how would I add these if I'm using byte-level encodings? Final questions: Firstly, for the datasets mentioned including code,stories,webtext,... would I tokenise all of these datasets then concatenate them to then randomly sample from, or should i train seperately on each as some like code and webtext are much larger than the others? Finally, for the webtext part of the dataset, there is a passage of text then a passage analysing the text (main ideas,purpose,...), how should I encode this, should I use an extra ANALYSE token or just concatenate?
Thank you for reading this far, I am sort of a beginner so if I said something stupid please point it out. Also, if there were unclear parts in my question I'm sorry as I struggled how to word these questions. Any help would be appreciated!
Vibe Score

0
Sentiment

1
Rate this Resource
Join the VibeBuilders.ai Newsletter
The newsletter helps digital entrepreneurs how to harness AI to build your own assets for your funnel & ecosystem without bloating your subscription costs.
Start the free 5-day AI Captain's Command Line Bootcamp when you sign up: