{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/byt5-towards-a-token-free-future-with-pre","title":"ByT5: Towards a token-free future with pre-trained byte-to-byte models","arxiv_id":"2105.13626","date":"2021-05-28","proceeding":null,"authors":["Linting Xue","Aditya Barua","Noah Constant","Rami Al-Rfou","Sharan Narang","Mihir Kale","Adam Roberts","Colin Raffel"],"abstract":"Most widely-used pre-trained language models operate on sequences of tokens corresponding to word or subword units. By comparison, token-free models that operate directly on raw text (bytes or characters) have many benefits: they can process text in any language out of the box, they are more robust to noise, and they minimize technical debt by removing complex and error-prone text preprocessing pipelines. Since byte or character sequences are longer than token sequences, past work on token-free models has often introduced new model architectures designed to amortize the cost of operating directly on raw text. In this paper, we show that a standard Transformer architecture can be used with minimal modifications to process byte sequences. We characterize the trade-offs in terms of parameter count, training FLOPs, and inference speed, and show that byte-level models are competitive with their token-level counterparts. We also demonstrate that byte-level models are significantly more robust to noise and perform better on tasks that are sensitive to spelling and pronunciation. As part of our contribution, we release a new set of pre-trained byte-level Transformer models based on the T5 architecture, as well as all code and data used in our experiments.","url_abs":"https://arxiv.org/abs/2105.13626v3","url_pdf":"https://arxiv.org/pdf/2105.13626v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"byt5-towards-a-token-free-future-with-pre","repo_url":"https://github.com/google-research/byt5","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"byt5-towards-a-token-free-future-with-pre","repo_url":"https://github.com/ufal/multilexnorm2021","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"byt5-towards-a-token-free-future-with-pre","repo_url":"https://github.com/2024-MindSpore-1/Code2/tree/main/model-1/byt5","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"byt5-towards-a-token-free-future-with-pre","repo_url":"https://github.com/huggingface/transformers/tree/master/src/transformers/models/byt5","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"jax","reach":null},{"paper_slug":"byt5-towards-a-token-free-future-with-pre","repo_url":"https://github.com/yoreG123/Paddle-ByT5","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"paddle","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"cross-lingual-ner","task_name":"Cross-Lingual NER"},{"task_slug":"cross-lingual-natural-language-inference","task_name":"Cross-Lingual Natural Language Inference"},{"task_slug":"cross-lingual-paraphrase-identification","task_name":"Cross-Lingual Paraphrase Identification"},{"task_slug":"cross-lingual-question-answering","task_name":"Cross-Lingual Question Answering"},{"task_slug":"extreme-summarization","task_name":"Extreme Summarization"},{"task_slug":"question-answering","task_name":"Question Answering"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adafactor","method_name":"Adafactor"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"glu","method_name":"Gated Linear Unit"},{"method_slug":"inverse-square-root-schedule","method_name":"Inverse Square Root Schedule"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"sentencepiece","method_name":"SentencePiece"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"t5","method_name":"T5"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/cross-lingual-ner-on-wikiann-ner","task":"Cross-Lingual NER","dataset":"WikiAnn NER","model":"ByT5 XXL","rank_in_archive_order":1,"of":1,"metrics":{"F1":"67.7"},"uses_additional_data":false},{"leaderboard":"/sota/cross-lingual-natural-language-inference-on-4","task":"Cross-Lingual Natural Language Inference","dataset":"XNLI","model":"ByT5 XXL","rank_in_archive_order":1,"of":5,"metrics":{"Accuracy":"83.7"},"uses_additional_data":false},{"leaderboard":"/sota/cross-lingual-natural-language-inference-on-4","task":"Cross-Lingual Natural Language Inference","dataset":"XNLI","model":"ByT5 Small","rank_in_archive_order":4,"of":5,"metrics":{"Accuracy":"69.1"},"uses_additional_data":false},{"leaderboard":"/sota/cross-lingual-question-answering-on-mlqa","task":"Cross-Lingual Question Answering","dataset":"MLQA","model":"ByT5 XXL","rank_in_archive_order":1,"of":3,"metrics":{"EM":"54.9","F1":"71.6"},"uses_additional_data":false},{"leaderboard":"/sota/cross-lingual-question-answering-on-tydiqa","task":"Cross-Lingual Question Answering","dataset":"TyDiQA-GoldP","model":"ByT5 (fine-tuned)","rank_in_archive_order":1,"of":11,"metrics":{"EM":"81.9"},"uses_additional_data":false},{"leaderboard":"/sota/cross-lingual-question-answering-on-tydiqa","task":"Cross-Lingual Question Answering","dataset":"TyDiQA-GoldP","model":"ByT5 XXL","rank_in_archive_order":5,"of":11,"metrics":{"EM":"60.0","F1":"75.3"},"uses_additional_data":false},{"leaderboard":"/sota/cross-lingual-question-answering-on-xquad","task":"Cross-Lingual Question Answering","dataset":"XQuAD","model":"ByT5 XXL","rank_in_archive_order":1,"of":4,"metrics":{"EM":"63.6","F1":"79.7"},"uses_additional_data":false},{"leaderboard":"/sota/extreme-summarization-on-gem-xsum","task":"Extreme Summarization","dataset":"GEM-XSum","model":"ByT5","rank_in_archive_order":5,"of":6,"metrics":{"BLEU score":"15.3"},"uses_additional_data":false},{"leaderboard":"/sota/extreme-summarization-on-gem-xsum","task":"Extreme Summarization","dataset":"GEM-XSum","model":"mT5","rank_in_archive_order":6,"of":6,"metrics":{"BLEU score":"14.3"},"uses_additional_data":false},{"leaderboard":"/sota/question-answering-on-tweetqa","task":"Question Answering","dataset":"TweetQA","model":"ByT5 (small)","rank_in_archive_order":1,"of":3,"metrics":{"BLEU-1":"72.0"},"uses_additional_data":false},{"leaderboard":"/sota/question-answering-on-tweetqa","task":"Question Answering","dataset":"TweetQA","model":"mT5","rank_in_archive_order":2,"of":3,"metrics":{"BLEU-1":"70.8","ROUGE-L":"74.3"},"uses_additional_data":false},{"leaderboard":"/sota/question-answering-on-tweetqa","task":"Question Answering","dataset":"TweetQA","model":"ByT5","rank_in_archive_order":3,"of":3,"metrics":{"ROUGE-L":"75.7"},"uses_additional_data":false}],"syntology":{"syntology_url":"https://syntology.ai/paper/2105.13626","atlas_url":"https://app.syntology.ai/?focus=2105.13626","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2105.13626"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/2024-MindSpore-1/Code2/tree/main/model-1/byt5","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yoreG123/Paddle-ByT5","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/huggingface/transformers/tree/master/src/transformers/models/byt5","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ufal/multilexnorm2021","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/google-research/byt5","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":1,"unverified":5},"by_repo_kind":{"official":{"samples":4,"ran":0,"repositories":1},"listed":{"samples":2,"ran":1,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"c5e1f47618c8fdaa","entry":"sequence_mask","repo":"yoreG123/Paddle-ByT5","repo_kind":"listed","path":"byt5/paddlenlp/layers/sequence.py","file_url":"https://github.com/yoreG123/Paddle-ByT5/blob/HEAD/byt5/paddlenlp/layers/sequence.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c5e1f47618c8fdaa"}},{"code_sha256_prefix":"fa96fb90180ccd08","entry":"bleu1","repo":"google-research/byt5","repo_kind":"official","path":"byt5/metrics.py","file_url":"https://github.com/google-research/byt5/blob/HEAD/byt5/metrics.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fa96fb90180ccd08"}},{"code_sha256_prefix":"31d155ca87421398","entry":"cer","repo":"google-research/byt5","repo_kind":"official","path":"byt5/metrics.py","file_url":"https://github.com/google-research/byt5/blob/HEAD/byt5/metrics.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"31d155ca87421398"}},{"code_sha256_prefix":"d47efbd10d362210","entry":"get_perc_99_len","repo":"google-research/byt5","repo_kind":"official","path":"byt5/get_length_stats.py","file_url":"https://github.com/google-research/byt5/blob/HEAD/byt5/get_length_stats.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d47efbd10d362210"}},{"code_sha256_prefix":"7667c4274e1b357d","entry":"load_vocabulary","repo":"yoreG123/Paddle-ByT5","repo_kind":"listed","path":"byt5/paddlenlp/experimental/model_utils.py","file_url":"https://github.com/yoreG123/Paddle-ByT5/blob/HEAD/byt5/paddlenlp/experimental/model_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7667c4274e1b357d"}},{"code_sha256_prefix":"cc3b1f39907cd5aa","entry":"metrics_task1_2020","repo":"google-research/byt5","repo_kind":"official","path":"byt5/sigmorphon.py","file_url":"https://github.com/google-research/byt5/blob/HEAD/byt5/sigmorphon.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"cc3b1f39907cd5aa"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}