Urgent.News

What's breaking now, across thousands of outlets.

Editions

Tech

We tested "tokenize before you compress" against 452 configurations, and it mostly held up

A few weeks ago my friend @u84u and I ( @ronak-create ) had a simple, slightly annoying question: if LLMs get 30-45% smaller representations of text by tokenizing it into subwords instead of raw bytes, why don't we tokenize text before handing it to a byte-level compressor like LZMA or zstd? It felt like the kind of idea someone must have already tried and quietly dropped. So instead of writing a…

Researchers @u84u and @ronak-create conducted an experiment to test if tokenizing text before compressing it with byte-level compressors like LZMA or zstd would result in smaller compressed output. They built a harness called parmar to test various configurations on a large corpus. The hypothesis was that tokenizing text with BPE would make the token stream roughly 45% smaller than the original text, allowing compressors to cover more source text with their limited dictionary windows.

However, the benefits of pre-tokenization only became apparent once the corpus was larger than the compressor's window. The study found that pre-tokenization only provided a size advantage for compressors with larger windows (like LZMA and zstd), and the advantage plateaued after reaching a certain corpus size. Bzip2 was not a suitable backend for this approach, as tokenization destroyed the byte-level structures the algorithm exploited.

Multithreading interactions also impacted the results, with xz benefiting from threading more than zstd. Overall, the experiment showed that pre-tokenization can be a useful technique for compressors with larger windows, but its benefits are limited by the corpus size and the specific compressor used.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Node.js SEA Just Got Way Simpler — Updating My node-sea Boilerplate for Node 26

A while back I put together node-sea , a small boilerplate showing how to package a TypeScript app into a Single Executable Application (SEA) with Node.js — no runtime install required on the target…

  • Node.js SEAs now simpler with Node 26's --build-sea flag
  • Build process reduced to one command plus platform-specific codesign
  • SEA functional but experimental, will be in Active LTS Oct 2026

What I took back off the shelf

I have a bad habit of writing a little skill file for something, using it twice, then completely forgetting which repo I left it in. Markdown scattered across nine projects like odd socks.

More from Friday 21 August →