This model extends LLama-3 8B's context length from 8k to over 1m tokens.

8b 70b

92K 7 months ago

Readme

This model extends LLama-3 8B’s context length from 8k to > 1040K, developed by Gradient, sponsored by compute from Crusoe Energy. It demonstrates that SOTA LLMs can learn to operate on long context with minimal training by appropriately adjusting RoPE theta. We trained on 830M tokens for this stage, and 1.4B tokens total for all stages, which is < 0.01% of Llama-3’s original pre-training data.

Large Context Window

Note: using a 256k context window requires at least 64GB of memory. Using a 1M+ context window requires significantly more (100GB+).

To extend the context window (to 256k for example) use:

API

curl http://localhost:11434/api/generate -d '{
  "model": "llama3-gradient",
  "prompt": "Why is the sky blue?",
  "options": {
    "num_ctx": 256000
  }
}'

CLI

ollama run llama3-gradient
>>> /set parameter num_ctx 256000

References

Website

Hugging Face