FederatedBytes: Tokenizer-Free, Byte-Level Small Language Models for Efficient Multimodal Federated Learning
Organizations: Cyber Digital Centre, University of Technology Sydney
Abstract
Federated Learning (FL) is a powerful machine learning framework that allows building a global model from the contributions of multiple, distributed clients, while ensuring the privacy of their local data. However, its heavy computational and communication overheads challenge its use for contemporary AI workloads such as natural language processing (NLP) and multimodal analysis. For this reason, this paper presents a novel small language model that leverages byte-level text and multimodal data processing, enhanced by a linear attention mechanism, to enable manageable Federated Learning of NLP and multimodal analysis tasks. The proposed model, nicknamed FederatedBytes, manages to process text and any other data types, including images, by treating its input as a mere sequence of bytes, while its lean linear attention mechanism allows abating the overall memory and computational footprint. To prove the effectiveness of the proposed model we have carried out an extensive performance evaluation on sentiment analysis tasks in multilingual and multimodal settings over the Multilingual Amazon Reviews and ScienceQA datasets. The experimental results show that FederatedBytes has been able to outperform comparable models such as ByT5 and LSTM, achieving higher accuracy while significantly reducing memory and communication overheads.
Figures & tables
| Model/Framework | Data Granularity | Learning Paradigm | Context Handling | Primary Contribution |
| FedNLP Lin et al. (2021) | Token-Level | Federated | Standard ( ) | Benchmarking FL for token-based NLP. |
| ByT5 ( Xue et al., 2022 ) | Byte-Level | Centralized | Standard ( ) | State-of-the-art among early byte-level text processing. |
| Longformer ( Beltagy et al., 2020 ) | Token-Level | Centralized | Efficient (Linearized) | Efficiently processing long token sequences. |
| BLT ( Pagnoni et al., 2024 ) | Byte-Level | Centralized | Standard ( ) | Scaling byte-level models for large datasets. |
| FederatedBytes (Ours) | Byte-Level | Federated | Efficient (Linearized) | Unified framework for private, efficient, byte-level FL. |
| Model/Method | Key Innovation | Primary Use Case | Suitability for Federated Learning |
| FedAvg McMahan et al. (2017) | Decentralized model aggregation | General-purpose FL | Foundational, but model-agnostic and can be inefficient for large models. |
| ByT5 Xue et al. (2022) | Encoder-decoder Transformer on byte streams | Multilingual NLP in centralized settings | Low. High computational and memory requirements; not optimized for communication efficiency. |
| bGPT Wu et al. (2024) | Decoder-only Transformer on byte streams | Generative modeling on raw bytes | Low. Similar resource constraints to ByT5; large model size poses communication challenges. |
| BLT ( Pagnoni et al., 2024 ) | Scaling byte-level models to very large parameter counts | Foundational research in large byte-level models | Very Low. Designed for large-scale, centralized data centers, making it impractical for on-device FL. |
| FederatedBytes (Ours) | Efficient attention on byte streams within a federated framework | Multilingual and multi-modal NLP on decentralized data | High. Explicitly designed to be resource-efficient, reduce communication, and operate without a central data store. |
| T (84) | h (104) | i (105) | s (115) | ␣(32) | p (112) | r (114) | o (111) |
| d (100) | u (117) | c (99) | t (116) | ␣(32) | i (105) | s (115) | ␣(32) |
| a (97) | m (109) | a (97) | z (122) | i (105) | n (110) | g (103) | ␣(32) |
| a (97) | n (110) | d (100) | ␣(32) | w (119) | o (111) | r (114) | k (107) |
| Byte | ||||
| 84 (T) | 0.12 | -0.08 | 0.33 | 0.44 |
| 104 (h) | -0.21 | 0.15 | 0.05 | -0.36 |
| 105 (i) | 0.19 | -0.11 | 0.29 | 0.07 |
| 115 (s) | 0.03 | 0.48 | -0.22 | -0.15 |
| 32 (space) | 0.00 | 0.00 | 0.00 | 0.00 |
| 112 (p) | 0.44 | -0.05 | 0.19 | 0.09 |
| Patch 1 | Patch 2 | Patch 3 | |
| Patch 1 | 0.60 | 0.25 | 0.15 |
| Patch 2 | 0.20 | 0.65 | 0.15 |
| Patch 3 | 0.10 | 0.30 | 0.60 |
| Data Element | Sample Values for Review ( ) |
| Input Patches ( ) | First patch: (128 integers) |
| Label ( ) |
| Stage of Processing | Data Shape | Sample Value / Representation (first 4 dims shown) |
| 1. Input Patch | ‘(128,)‘ | ‘[84, 104, 105, 115, …]‘ (A single patch of 128 byte integers) |
| 2. Embedding | ‘(128, 768)‘ | (Matrix of 128 embedding vectors) |
| 3. Hierarchical Encoding | ‘(768,)‘ | ‘[0.07, 0.05, 0.08, 0.03, …]‘ (Encoded vector for the patch via Conv1d) |
| 4. Attention | ‘(128, 768)‘ | ‘[0.09, -0.01, 0.15, 0.02, …]‘ (Sequence of 128 contextualized vectors) |
| 5. Global Pooling | ‘(768,)‘ | ‘[0.12, -0.05, 0.07, 0.19, …]‘ (Mean of all 128 patch vectors) |
| 6. Classification | ‘(2,)‘ | ‘[-0.62, 1.45]‘ (Final 2-dim output logits for the sample) |
| Data Element | Sample Values for Review ( ) |
| Input Patches ( ) | First patch: |
| Label ( ) |
| Stage | Sample Value |
| Final Pooled Vector | |
| Generated Logits ( ) | |
| Probabilities | |
| Prediction ( ) | (Positive) |
| Aggregated List | State After Processing Our Sample |
| All Labels ( ) | |
| All Predictions ( ) | |
| All Logits ( ) |
| Property | Multilingual Amazon Reviews | ScienceQA |
| Task | Binarized 5-Class Sentiment Analysis | Multimodal Question Answering |
| Domain | Product Reviews | Scientific Questions |
| Classes | 5 (1-5 Stars) | Multiple Choice (varies) |
| Size | 200k samples per language | 21k samples |
| Languages | English, German, Chinese | English |
| Modality | Text | Text + Image |
| Language | # Train | # Val | # Test | Pos/Neg Ratio |
| English | 200,000 | 5,000 | 5,000 | 40.0% / 60.0% |
| German | 200,000 | 5,000 | 5,000 | 40.0% / 60.0% |
| Chinese | 200,000 | 5,000 | 5,000 | 40.0% / 60.0% |
| Model | Hidden Dim | Param Count |
| ByT5 (small) | 512 | 300M |
| GPT-2 Medium | 768 | 124M |
| LSTM (2-layer) | 512 | 4.3M (approx.) |
| FederatedBytes-Base | 512 | 18.6 (approx.) |
| FederatedBytes-Performer-30M | 512 | 30M (approx.) |
| FederatedBytes-Performer-100M | 512 | 100M (approx.) |
| Language | Model | Model Params | Model Size (GB) | Acc (%) | F1 (%) | AUC (%) | Mem (CPU/GPU) | Time (min) |
| Byte-Level Models | ||||||||
| Amazon (en) | FederatedBytes-Base | 18.6M | 0.07 | 64.00 | 60.26 | 65.78 | 0.00 GB / 1.56 GB | 2.84 |
| FederatedBytes-Performer-30M | 32.5M | 0.12 | 73.60 | 73.76 | 79.68 | 0.00 GB / 0.69 GB | 5.53 | |
| FederatedBytes-Performer-100M | 101.3M | 0.38 | 70.40 | 70.56 | 80.50 | 0.05 GB / 1.96 GB | 7.67 | |
| ByT5 | 300.8M | 1.12 | 59.80 | 44.76 | 58.45 | 0.00 GB / 19.99 GB | 17.31 | |
| LSTM | 4.3M | 0.02 | 59.80 | 44.94 | 50.08 | 0.01 GB / 0.28 GB | 4.21 | |
| Dataset | Model | Clients | Acc (%) | F1 (%) | AUC (%) | Time (min) | CPU (GB) | GPU (GB) | Net (GB) | Size (GB) |
| Amazon (en) | FederatedBytes-Performer-30M | 5 | 59.70 | 44.71 | 76.79 | 2.27 | 0.13 | 0.46 | 2.27 | 0.11 |
| FederatedBytes-Performer-100M | 5 | 59.80 | 44.76 | 74.80 | 7.55 | 0.17 | 0.72 | 7.55 | 0.38 | |
| ByT5 | 5 | 59.80 | 44.75 | 60.61 | 22.32 | 0.28 | 1.71 | 22.32 | 1.12 | |
| FederatedBytes-Performer-30M | 10 | 59.80 | 44.76 | 72.04 | 5.67 | 0.13 | 0.46 | 5.67 | 0.11 | |
| FederatedBytes-Performer-100M | 10 | 59.80 | 44.75 | 72.04 | 18.87 | 0.17 | 0.72 | 11.32 | 0.38 | |
| ByT5 | 10 | 59.80 | 44.76 | 56.54 | 55.81 | 0.27 | 1.71 | 55.81 | 1.12 |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| Parameter | Value |
| General Optimization | |
| Random Seed | 42 |
| Optimizer | AdamW |
| Learning Rate | |
| Weight Decay | 0.01 |
| Dropout | 0.1 |
Byte-Level Language Model
Byte-level language models predict text directly from bytes, avoiding fixed token vocabularies while balancing character-level flexibility against sequence efficiency.
See all 30 papers