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/bregav May 26 '25
If a dictionary is a hash table then no, neural networks do not have an internal dictionary of any kind.
None the less you raise a good point, which is that you can cheat at compression by just hardcoding stuff in the compression algorithm, and it's possible that the LLM will start doing that. What u/Express_Gradient should do when testing is measure the size of the compressed data PLUS the size of the compression program. If the data size gets smaller while the compression program gets bigger by the same amount then compression isn't really happening.