dwzhu commited on
Commit
8dfd363
1 Parent(s): d2c985e

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +4 -1
README.md CHANGED
@@ -7,6 +7,9 @@ license: mit
7
 
8
  **Authors**: Dawei Zhu, Nan Yang, Liang Wang, Yifan Song, Wenhao Wu, Furu Wei, Sujian Li
9
 
 
 
 
10
  ## Abstract
11
 
12
  Large Language Models (LLMs) are trained with a pre-defined context length, restricting their use in scenarios requiring long inputs. Previous efforts for adapting LLMs to a longer length usually requires fine-tuning with this target length (Full-length fine-tuning), suffering intensive training cost. To decouple train length from target length for efficient context window extension, we propose Positional Skip-wisE (PoSE) training that smartly simulates long inputs using a fixed context window. This is achieved by first dividing the original context window into several chunks, then designing distinct skipping bias terms to manipulate the position indices of each chunk. These bias terms and the lengths of each chunk are altered for every training example, allowing the model to adapt to all positions within target length. Experimental results show that PoSE greatly reduces memory and time overhead compared with Full-length fine-tuning, with minimal impact on performance. Leveraging this advantage, we have successfully extended the LLaMA model to 128k tokens using a 2k training context window. Furthermore, we empirically confirm that PoSE is compatible with all RoPE-based LLMs and position interpolation strategies. Notably, our method can potentially support infinite length, limited only by memory usage in inference. With ongoing progress for efficient inference, we believe PoSE can further scale the context window beyond 128k.
@@ -42,7 +45,7 @@ Large Language Models (LLMs) are trained with a pre-defined context length, rest
42
 
43
  ## Notice
44
 
45
- - For YaRN interpolation, we use the revised version of YaRN in our experiments (see `pose_modeling_llama.py`), as supported by the issue [inv_freq seems not calculated right](https://github.com/jquesnelle/yarn/issues/24).
46
  - In the configuration's `max_position_embeddings` parameter, we explicitly assign it to the scaled length. This differs slightly from the usage in the Hugging Face LLaMA document ([huggingface.co](http://huggingface.co/)). We've made this adjustment due to our positional skip-wise training, which utilizes position indices exceeding the input length. However, it's important to note that this modification does not negatively impact model performance.
47
 
48
  ## Citation
 
7
 
8
  **Authors**: Dawei Zhu, Nan Yang, Liang Wang, Yifan Song, Wenhao Wu, Furu Wei, Sujian Li
9
 
10
+ > **Note:** We discovered that the LLaMA2-7B-PoSE-YaRN-16k model uploaded on 2023/10/11 is inconsistent with the `pose_modeling_llama.py` provided in the repository, resulting in suboptimal performance. Therefore, we have re-uploaded the checkpoint of LLaMA2-7B-PoSE-YaRN-16k on 2023/11/27.
11
+
12
+
13
  ## Abstract
14
 
15
  Large Language Models (LLMs) are trained with a pre-defined context length, restricting their use in scenarios requiring long inputs. Previous efforts for adapting LLMs to a longer length usually requires fine-tuning with this target length (Full-length fine-tuning), suffering intensive training cost. To decouple train length from target length for efficient context window extension, we propose Positional Skip-wisE (PoSE) training that smartly simulates long inputs using a fixed context window. This is achieved by first dividing the original context window into several chunks, then designing distinct skipping bias terms to manipulate the position indices of each chunk. These bias terms and the lengths of each chunk are altered for every training example, allowing the model to adapt to all positions within target length. Experimental results show that PoSE greatly reduces memory and time overhead compared with Full-length fine-tuning, with minimal impact on performance. Leveraging this advantage, we have successfully extended the LLaMA model to 128k tokens using a 2k training context window. Furthermore, we empirically confirm that PoSE is compatible with all RoPE-based LLMs and position interpolation strategies. Notably, our method can potentially support infinite length, limited only by memory usage in inference. With ongoing progress for efficient inference, we believe PoSE can further scale the context window beyond 128k.
 
45
 
46
  ## Notice
47
 
48
+ - For YaRN interpolation, we use the revised version of YaRN in our experiments (see `pose_modeling_llama.py`), as supported by the issue [inv_freq seems not calculated right](https://github.com/jquesnelle/yarn/issues/24).
49
  - In the configuration's `max_position_embeddings` parameter, we explicitly assign it to the scaled length. This differs slightly from the usage in the Hugging Face LLaMA document ([huggingface.co](http://huggingface.co/)). We've made this adjustment due to our positional skip-wise training, which utilizes position indices exceeding the input length. However, it's important to note that this modification does not negatively impact model performance.
50
 
51
  ## Citation