This is a custom version of the Meta Llama 3 8B instruction-tuned language model with an extended context length of up to 64,000 tokens. It was created by merging the
meta-llama/Meta-Llama-3-8B-Instruct model with a LoRA adapter finetuned using
PoSE by
Wing Lian to extend Llama's context length from 8k to 64k @ rope_theta: 500000.0.
They used PoSE with continued pretraining on 300M tokens from the RedPajama V1 dataset using data between 6k-8k tokens.
They have further set rope_theta to 2M after continued pre-training to potentially further extend the context past 64k.
This was trained on a subset of the RedPajama v1 dataset with text between 6k-8k context. They trained a rank stabilized LoRA of rank 256.
WandB
This extended context model allows for much longer form inputs and generation compared to the original base model. It maintains the strong instruction-following and safety capabilities of Llama 3 while greatly increasing the applicable use cases.
See the Original Repo by Wing Lian for more details on the adapter training process.
This model can be used just like the base Llama 3 8B model, but with the increased context length enabling much longer prompts and outputs. See the example usage with the Transformers library:
1import transformers
2import torch
3
4model_id = "Azma-AI/Meta-Llama-3-8B-Instruct-64k-PoSE"
5pipeline = transformers.pipeline(
6 "text-generation", model=model_id,
7 model_kwargs={"torch_dtype": torch.bfloat16},
8 device_map="auto"
9)
10
11long_prompt = "..." # Your prompt up to 64k tokens
12output = pipeline(long_prompt)
If you use this model, please cite the original Meta Llama 3 model card and the PoSE adapter paper:
1@article{llama3modelcard,
2 title={Llama 3 Model Card},
3 author={AI@Meta},
4 year={2024},
5 url = {https://github.com/meta-llama/llama3/blob/main/MODEL_CARD.md}
6}