Real-Time Text Transmission via LLM-Based Entropy Coding over Fixed-Rate Channels
For real-time text transmission systems, this work provides a practical analysis of the tradeoff between compression efficiency and delay, showing that Huffman is optimal for over-provisioned channels while larger models shift the optimum.
This paper analyzes the compression-delay tradeoff in real-time text transmission using LLM-based entropy coding over fixed-rate channels, comparing Huffman, arithmetic coding, rANS, and gzip. With GPT-2 (124M) and Llama 3.2 (3B), scaling yields a 38% reduction in bits per character, changing the optimal coder.
Learning, prediction, and compression are intimately connected: a model that accurately predicts the next symbol in a sequence can be coupled with a source coder to compress that sequence near its information-theoretic limit. When tokenized characters arriving at a fixed reading pace are encoded into variable-length codewords and streamed over a fixed-rate channel, a queue forms whose per-token delay depends on the mean and variance of the bit lengths and on the coder's algorithmic latency. This paper investigates the compression--delay tradeoff that arises when a causal language model serves as the sequential predictor within a predict-then-code architecture for real-time text transmission. Several coding schemes are compared: Shannon (ideal), Huffman, arithmetic coding, rANS at various block sizes, and gzip. The analysis separates algorithmic delay, inherent to the coder, from computational delay, which shrinks as hardware improves. Huffman is the practical choice for over-provisioned channels, with zero algorithmic delay and modest compression overhead. Arithmetic coding achieves near-optimal compression at the cost of decodability delay. Findings are validated across two scales: GPT-2 (124M) and Llama~3.2 (3B), a twenty-five-fold parameter range. This scaling yields an approximately 38\% reduction in bits per character, effectively over-provisioning the channel and thereby changing which coder is optimal.