princeton-nlp commited on
Commit
904c529
1 Parent(s): c719685

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +53 -0
README.md ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ ---
4
+ license: apache-2.0
5
+ ---
6
+
7
+ **Paper**: [Adapting Language Models to Compress Contexts](https://arxiv.org/abs/2305.14788)
8
+
9
+ **Code**: https://github.com/princeton-nlp/AutoCompressors
10
+
11
+ **Models**:
12
+ - Llama-2-7b fine-tuned models: [AutoCompressor-Llama-2-7b-6k](https://huggingface.co/princeton-nlp/AutoCompressor-Llama-2-7b-6k/), [FullAttention-Llama-2-7b-6k](https://huggingface.co/princeton-nlp/FullAttention-Llama-2-7b-6k)
13
+ - OPT-2.7b fine-tuned models: [AutoCompressor-2.7b-6k](https://huggingface.co/princeton-nlp/AutoCompressor-2.7b-6k), [AutoCompressor-2.7b-30k](https://huggingface.co/princeton-nlp/AutoCompressor-2.7b-30k), [RMT-2.7b-8k](https://huggingface.co/princeton-nlp/RMT-2.7b-8k), [FullAttention-2.7b-4k](https://huggingface.co/princeton-nlp/FullAttention-2.7b-4k)
14
+ - OPT-1.3b fine-tuned models: [AutoCompressor-1.3b-30k](https://huggingface.co/princeton-nlp/AutoCompressor-1.3b-30k), [RMT-1.3b-30k](https://huggingface.co/princeton-nlp/RMT-1.3b-30k)
15
+
16
+ ---
17
+
18
+ RMT-1.3b-30k is a model fine-tuned from [facebook/opt-1.3b](https://huggingface.co/facebook/opt-1.3b) following the RMT method as described in [Recurrent Memory Transformer](https://arxiv.org/abs/2207.06881) and [Adapting Language Models to Compress Contexts](https://arxiv.org/abs/2305.14788).
19
+ This model is fine-tuned on 2B tokens from Books3 in [The Pile](https://pile.eleuther.ai). The pre-trained OPT-1.3b model is fine-tuned on sequences of 30,720 tokens with 50 summary vectors, summary accumulation, randomized segmenting, and stop-gradients.
20
+
21
+ To get started, download the [`AutoCompressor`](https://github.com/princeton-nlp/AutoCompressors) repository and load the model as follows:
22
+
23
+ ```
24
+ from auto_compressor import AutoCompressorModel
25
+
26
+ model = AutoCompressorModel.from_pretrained("princeton-nlp/RMT-1.3b-30k")
27
+ ```
28
+
29
+ **Evaluation**
30
+
31
+ We record the perplexity achieved by our 30k-fine-tuned OPT models on segments of 2,048 tokens sampled from Books3 and ArXiv in The Pile, conditioned on different amounts of context.
32
+
33
+
34
+ | Context Tokens | 0 |14,336 | 28,672 |
35
+ | -----------------------------|------|--------|--------|
36
+ | RMT-1.3b-30k | 13.18|12.50 |12.50 |
37
+ | AutoCompressor-1.3b-30k | 13.21|12.49 |12.47 |
38
+ | AutoCompressor-2.7b-30k | 11.86|11.21 |11.18 |
39
+
40
+
41
+
42
+
43
+ ## Bibtex
44
+ ```
45
+ @misc{chevalier2023adapting,
46
+ title={Adapting Language Models to Compress Contexts},
47
+ author={Alexis Chevalier and Alexander Wettig and Anirudh Ajith and Danqi Chen},
48
+ year={2023},
49
+ eprint={2305.14788},
50
+ archivePrefix={arXiv},
51
+ primaryClass={cs.CL}
52
+ }
53
+ ```