princeton-nlp/AutoCompressor-Llama-2-7b-6k

Model

license: apache-2.0

2

12 commits

6 repos using this model

2 linked in READMEs

updated Nov 22, 2023

See the code

README

license: apache-2.0

Paper: Adapting Language Models to Compress Contexts

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

Models:


AutoCompressor-Llama-2-7b-6k is a model fine-tuned from meta-llama/Llama-2-7b-hf following the AutoCompressor method in Adapting Language Models to Compress Contexts. This model is fine-tuned on 15B tokens from RedPajama dataset. The pre-trained Llama-2 model is fine-tuned on sequences of 6,144 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_llama import LlamaAutoCompressorModel

model = LlamaAutoCompressorModel.from_pretrained("princeton-nlp/AutoCompressor-Llama-2-7b-6k")

Evaluation

We record the perplexity achieved by our Llama-2-7B models on segments of 2048 tokens, conditioned on different amounts of context. FullAttention-Llama-2-7b-6k uses full uncompressed contexts whereas AutoCompressor-Llama-2-7b-6k compresses segments of 2048 tokens into 50 summary vectors.

Context Tokens0512204840966144
Pre-trained Llama-2-7b5.525.154.98--
FullAttention-Llama-2-7b-6k5.405.064.884.804.76
AutoCompressor-Llama-2-7b-6k5.405.165.115.085.07

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
llama
pytorch
text-generation-inference
transformers

princeton-nlp/AutoCompressor-Llama-2-7b-6k

Model

license: apache-2.0

2

12 commits

6 repos using this model

2 linked in READMEs

updated Nov 22, 2023

See the code

README

license: apache-2.0

Paper: Adapting Language Models to Compress Contexts

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

Models:


AutoCompressor-Llama-2-7b-6k is a model fine-tuned from meta-llama/Llama-2-7b-hf following the AutoCompressor method in Adapting Language Models to Compress Contexts. This model is fine-tuned on 15B tokens from RedPajama dataset. The pre-trained Llama-2 model is fine-tuned on sequences of 6,144 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_llama import LlamaAutoCompressorModel

model = LlamaAutoCompressorModel.from_pretrained("princeton-nlp/AutoCompressor-Llama-2-7b-6k")

Evaluation

We record the perplexity achieved by our Llama-2-7B models on segments of 2048 tokens, conditioned on different amounts of context. FullAttention-Llama-2-7b-6k uses full uncompressed contexts whereas AutoCompressor-Llama-2-7b-6k compresses segments of 2048 tokens into 50 summary vectors.

Context Tokens0512204840966144
Pre-trained Llama-2-7b5.525.154.98--
FullAttention-Llama-2-7b-6k5.405.064.884.804.76
AutoCompressor-Llama-2-7b-6k5.405.165.115.085.07

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
llama
pytorch
text-generation-inference
transformers