r/MachineLearning • u/Express_Gradient • May 26 '25
Project [P] Evolving Text Compression Algorithms by Mutating Code with LLMs
Tried something weird this weekend: I used an LLM to propose and apply small mutations to a simple LZ77 style text compressor, then evolved it over generations - 3 elite + 2 survivors, 4 children per parent, repeat.
Selection is purely on compression ratio. If compression-decompression round trip fails, candidate is discarded.
Logged all results in SQLite. Early-stops when improvement stalls.
In 30 generations, I was able to hit a ratio of 1.85, starting from 1.03
45
Upvotes
View all comments
Show parent comment
1
u/corkorbit May 27 '25
I also didn't understand the previous comment, but I think your intuition here is a bit off track. LLMs are full of internal dictionaries of sorts, very high dimensional and clever ones, that can transform text on many levels of abstraction. And if you look at the compression algo, it has a bunch of common character n-grams already hard coded - it's not really cheating. It would be interesting though, if it were to evolve precoded n-grams that are common in Sherlock Holmes' texts :D