SuperAPI AI Directory

open_llama_3b

OpenLLaMA 3B is one of the open-source reproductions of Meta AI's LLaMA large language model, developed by Berkeley AI Research and released under the Apache 2.0 license. The model is trained on the RedPajama dataset (over 1.2 trillion tokens), follows the preprocessing steps and training hyperparameters of the original LLaMA, and is available in both PyTorch and JAX weight formats for text generation tasks. The model performs comparably to the original LLaMA and GPT-J on most evaluation tasks, and better on some tasks. Users can load and use it via Hugging Face Transformers or the EasyLM framework, but should note to avoid using the fast tokenizer to ensure correct tokenization.

Open website

About this tool

OpenLLaMA is an open-source reproduction project of Meta AI's LLaMA large language model, released under the permissive Apache 2.0 license. This repository provides the 3B parameter version, which was trained on 1 trillion tokens; the project has also released a 7B model and a preview version of a 13B model (trained on 600 billion tokens). OpenLLaMA provides PyTorch and JAX weights of the pretrained models, as well as evaluation results and comparisons with the original LLaMA models.

In terms of main capabilities, OpenLLaMA 3B is a text generation model that can be used for various natural language generation tasks. According to the project description, on a wide range of evaluation tasks, OpenLLaMA performs comparably to the original LLaMA and GPT-J (6B parameters, trained on the Pile dataset), and outperforms them on some tasks. Evaluation was performed using lm-evaluation-harness, with the CB and WSC tasks removed because the model performed unusually well on these two tasks, raising suspicion of benchmark data contamination.

In terms of usage, users can load the weights directly through the Hugging Face Transformers library. The project recommends avoiding Hugging Face's fast tokenizer, because the automatically converted fast tokenizer sometimes produces incorrect tokenization. This can be avoided by using the LlamaTokenizer class directly, or by passing the use_fast=False option in AutoTokenizer. For more advanced usage, refer to the LLaMA documentation of transformers. In addition, the weights can also be loaded using the EasyLM framework, but note that OpenLLaMA's tokenizer and weights are trained completely from scratch, so there is no longer any need to obtain the original LLaMA's tokenizer and weights. The BOS (beginning of sentence) token (id=1) was used during training, so it is best to prepend this token during few-shot evaluation for optimal performance. The model can also be evaluated using lm-eval-harness, again passing use_fast=False to avoid tokenization issues.

In terms of dataset and training, the model was trained on the RedPajama dataset released by Together, which is a reproduction of the LLaMA training dataset,containing over 1.2 trillion tokens. Training follows the preprocessing steps and hyperparameters of the original LLaMA paper, including model architecture, context length, training steps, learning rate schedule, and optimizer, with the only difference being the use of the RedPajama dataset. Training was conducted on cloud TPU-v4 using the JAX-based EasyLM framework, combining data parallelism and fully sharded data parallelism (ZeRO stage 3), with the 7B model achieving a throughput of over 2200 tokens per second per TPU-v4 chip.

Applicable scenarios include text generation, few-shot evaluation, research use, and so on. In terms of limitations, the project does not explicitly state the model's specific context length, generation quality details, or hardware requirements; this information is not yet provided. Users should note the usage limitations of the tokenizer and comply with the Apache 2.0 license.