I just read [this trick](https://gist.github.com/VictorTaelin/d293328f75291b23e203e9d9db9bd136) for text compression, in order to save tokens in subbsequent interactions during a long conversation, or in a subsequent long text to summarize. ## SHORT VERSION: It's useful to give a mapping between common words (or phrases) in a given long text that one intends to pass later. Then pass that long text to gpt-4 but encoded with such mapping. The idea is that the encoded version contains less tokens than the original text. There are several algorithms to identify frequent words or phrases inside a given text, such as NER, TF-IDF, etc. ## LONG VERSION: I learned this by asking gpt-4 the logic behind it. Compress the following text in a way such that you (GPT-4) can reconstruct it as close as possible to the original. This is for yourself. Do not make it human readable. Aggressively compress it, while still keeping ALL the information to fully reconstruct it. Also use the fewest token possible, your text should be way smaller than the one I give you. ## Text to compress: Lambda calculus may be untyped or typed. In typed lambda calculus, functions can be applied only if they are capable of accepting the given input's "type" of data. Typed lambda calculi are weaker than the untyped lambda calculus, which is the primary subject of this article, in the sense that typed lambda calculi can express less than the untyped calculus can. On the other hand, typed lambda calculi allow more things to be proven. For example, in the simply typed lambda calculus it is a theorem that every evaluation strategy terminates for every simply typed lambda-term, whereas evaluation of untyped lambda- terms need not terminate. One reason there are many different typed lambda calculi has been the desire to do more (of what the untyped calculus can do) without giving up on being able to prove strong theorems about the calculus. > lmbC_untyped/typed,typed_functype,weaker,primSubj,lessExpr,moreProof,simplyTypedLC,evalStratTerm,untypedNTerm,manyTypedLC,strongThrmDesire I asked you to compress a long text using your own abbreviations. You replied with: lmbC_untyped/typed,typed_functype,weaker,primSubj,lessExpr,moreProof,simplyTypedLC,evalStratTerm,untypedNTerm,manyTypedLC,strongThrmDesire Reconstruct the original text. > Lambda calculus may be untyped or typed. In typed lambda calculus, functions can be applied only if they are capable of accepting the given input's "type" of data. Typed lambda calculi are weaker than the untyped lambda calculus, which is the primary subject of this article, in the sense that typed lambda calculi can express less than the untyped calculus can. On the other hand, typed lambda calculi allow more things to be proven. For example, in the simply typed lambda calculus it is a theorem that every evaluation strategy terminates for every simply typed lambda-term, whereas evaluation of untyped lambda- terms need not terminate. One reason there are many different typed lambda calculi has been the desire to do more (of what the untyped calculus can do) without giving up on being able to prove strong theorems about the calculus.