LLMLingua-style compression drops the tokens a small language model finds predictable. A token's self-information is : high means surprising and informative, low means you can probably infer it.
Implement compress(tokens, logprobs, budget, protected=()):
protected (for example the user's question).Also implement compression_ratio(original_len, kept_len): original_len / kept_len.