princeton-nlp/RMT-2.7b-8k

Model

license: apache-2.0

5

4 commits

2 linked in READMEs

updated Oct 27, 2023

See the code

README

license: apache-2.0

Paper: Adapting Language Models to Compress Contexts

Code: https://github.com/princeton-nlp/AutoCompressors

Models:


RMT-2.7b-8k is a model fine-tuned from facebook/opt-2.7b following the RMT method as described in Recurrent Memory Transformer and Adapting Language Models to Compress Contexts. This model is fine-tuned on 2B tokens from The Pile. The pre-trained OPT-2.7b model is fine-tuned on sequences of 8,192 tokens with 50 summary vectors, summary accumulation, randomized segmenting, and stop-gradients.

To get started, download the AutoCompressor repository and load the model as follows:

from auto_compressor import AutoCompressorModel
model = AutoCompressorModel.from_pretrained("princeton-nlp/RMT-2.7b-8k")

Evaluation

We record the perplexity achieved by our OPT-2.7b models on segments of 2048 tokens, conditioned on different amounts of context. FullAttention-2.7-4k uses full uncompressed contexts whereas AutoCompressor-2.7b-6k and RMT-2.7b-8k compress segments of 2048 tokens into 50 summary vectors.

In-domain Evaluation

Context Tokens0512204840966144
FullAttention-2.7b-4k6.576.155.94--
RMT-2.7b-8k6.346.196.026.026.01
AutoCompressor-2.7b-6k6.316.045.985.945.93

Out-of-domain Evaluation

Context Tokens0512204840966144
FullAttention-2.7b-4k8.948.287.93--
RMT-2.7b-8k8.628.448.218.208.20
AutoCompressor-2.7b-6k8.608.268.178.128.10

See Adapting Language Models to Compress Contexts for more evaluations, including evaluation on 11 in-context learning tasks.

Bibtex

@misc{chevalier2023adapting,
      title={Adapting Language Models to Compress Contexts}, 
      author={Alexis Chevalier and Alexander Wettig and Anirudh Ajith and Danqi Chen},
      year={2023},
      eprint={2305.14788},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}
endpoints_compatible
pytorch
text-generation-inference
transformers

princeton-nlp/RMT-2.7b-8k

Model

license: apache-2.0

5

4 commits

2 linked in READMEs

updated Oct 27, 2023

See the code

README

license: apache-2.0

Paper: Adapting Language Models to Compress Contexts

Code: https://github.com/princeton-nlp/AutoCompressors

Models:


RMT-2.7b-8k is a model fine-tuned from facebook/opt-2.7b following the RMT method as described in Recurrent Memory Transformer and Adapting Language Models to Compress Contexts. This model is fine-tuned on 2B tokens from The Pile. The pre-trained OPT-2.7b model is fine-tuned on sequences of 8,192 tokens with 50 summary vectors, summary accumulation, randomized segmenting, and stop-gradients.

To get started, download the AutoCompressor repository and load the model as follows:

from auto_compressor import AutoCompressorModel
model = AutoCompressorModel.from_pretrained("princeton-nlp/RMT-2.7b-8k")

Evaluation

We record the perplexity achieved by our OPT-2.7b models on segments of 2048 tokens, conditioned on different amounts of context. FullAttention-2.7-4k uses full uncompressed contexts whereas AutoCompressor-2.7b-6k and RMT-2.7b-8k compress segments of 2048 tokens into 50 summary vectors.

In-domain Evaluation

Context Tokens0512204840966144
FullAttention-2.7b-4k6.576.155.94--
RMT-2.7b-8k6.346.196.026.026.01
AutoCompressor-2.7b-6k6.316.045.985.945.93

Out-of-domain Evaluation

Context Tokens0512204840966144
FullAttention-2.7b-4k8.948.287.93--
RMT-2.7b-8k8.628.448.218.208.20
AutoCompressor-2.7b-6k8.608.268.178.128.10

See Adapting Language Models to Compress Contexts for more evaluations, including evaluation on 11 in-context learning tasks.

Bibtex

@misc{chevalier2023adapting,
      title={Adapting Language Models to Compress Contexts}, 
      author={Alexis Chevalier and Alexander Wettig and Anirudh Ajith and Danqi Chen},
      year={2023},
      eprint={2305.14788},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}
endpoints_compatible
pytorch
text-generation-inference
transformers