Skip to content

rajansagarwal/compression

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLMs can learn their own compression

TL;DR: I co-trained a summarizer and a generator to learn a compression scheme for text in the same token space as the base model, so it can continue with almost the same quality using an order of magnitude fewer context tokens. Along the way the model discovers its own compression tricks: aggressive pruning, dense punctuation (lots of semicolons), and even occasionally switching into Mandarin to pack more information per token.

You can read the full blog post here.

Run the Code

It's super simple.

  1. Set your TINKER_API_KEY and WANDB_API_KEY in .env file.
  2. Run uv sync
  3. Run uv run run_train.py

About

llms can learn their own context compression via RL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages