Safetensors
English
Japanese
llama

Llama 3.1 Swallow v0.5 - Built with Llama

Llama 3.1 Swallow v0.5 is a large language model (8B) that was built by continual pre-training on the Meta Llama 3.1 model. Llama 3.1 Swallow v0.5 enhanced the Japanese language and reasoning(code & math) capabilities of the original Llama 3.1 while retaining the English language capabilities. We use approximately 210 billion tokens that were sampled from a large Japanese web corpus (Swallow Corpus Version 2), Japanese and English Wikipedia articles, and mathematical and coding contents, etc (see the Training Datasets section of the base model) for continual pre-training. The instruction-tuned models (Instruct) were built by supervised fine-tuning (SFT) on the synthetic data specially built for Japanese. See the Swallow Model Index section to find other model variants.

Release History

Swallow Model Index

Model Llama-3.1-Swallow-Instruct v0.5 Llama-3.1-Swallow v0.5 Llama-3.3-Swallow v0.4 Llama-3.3-Swallow-Instruct v0.4 Llama-3.1-Swallow-Instruct v0.3 Llama-3.1-Swallow-Instruct v0.2 Llama-3.1-Swallow v0.2 Llama-3.1-Swallow-Instruct v0.1 Llama-3.1-Swallow v0.1
8B 🤗 HuggingFace 🤗 HuggingFace 🤗 HuggingFace 🤗 HuggingFace 🤗 HuggingFace 🤗 HuggingFace 🤗 HuggingFace
70B 🤗 HuggingFace 🤗 HuggingFace 🤗 HuggingFace 🤗 HuggingFace 🤗 HuggingFace

logo

The website https://swallow-llm.github.io/ provides large language models developed by the Swallow team.

Model Details

  • Model type: Please refer to Llama 3.1 MODEL_CARD for details on the model architecture.
  • Language(s): Japanese English
  • Library: Megatron-LM
  • Tokenizer: Please refer to Llama 3.1 blog for details on the tokenizer.
  • Contact: swallow[at]nlp.c.titech.ac.jp

Model Performance

Japanese tasks

Model JCom. JEMHopQA NIILC JSQuAD XL-Sum MGSM WMT20-en-ja WMT20-ja-en JMMLU JHumanEval Ja Avg
4-shot 4-shot 4-shot 4-shot 1-shot 4-shot 4-shot 4-shot 5-shot 0-shot
EM acc Char-F1 Char-F1 Char-F1 ROUGE-2 EM acc BLEU BLEU EM acc pass@1
Qwen2.5-7B 0.924 0.459 0.426 0.907 0.216 0.616 0.229 0.199 0.634 0.507 0.512
Llama 3.1 8B 0.845 0.461 0.405 0.895 0.179 0.356 0.221 0.210 0.479 0.320 0.437
Qwen3-8B-Base 0.927 0.537 0.475 0.912 0.207 0.716 0.241 0.215 0.689 0.595 0.551
Llama 3.1 Swallow 8B v0.2 0.911 0.510 0.627 0.892 0.198 0.464 0.296 0.233 0.525 0.336 0.499
Llama 3.1 Swallow 8B v0.5 0.952 0.513 0.657 0.910 0.217 0.572 0.294 0.232 0.590 0.491 0.543

English tasks

Model OpenBookQA TriviaQA HellaSWAG SQuAD2.0 XWINO MMLU GSM8K MATH BBH HumanEval En Avg
4-shot 4-shot 4-shot 4-shot 4-shot 5-shot 4-shot 4-shot 3-shot 0-shot
Acc EM acc Acc EM acc Acc Acc EM acc CoT EM Acc CoT EM Acc pass@1
Qwen2.5-7B 0.392 0.601 0.600 0.618 0.888 0.742 0.832 0.510 0.562 0.554 0.630
Qwen3-8B-Base 0.382 0.618 0.594 0.602 0.903 0.765 0.855 0.622 0.655 0.669 0.667
Llama 3.1 8B 0.380 0.702 0.609 0.503 0.907 0.651 0.507 0.214 0.616 0.364 0.545
Llama 3.1 Swallow 8B v0.2 0.382 0.651 0.596 0.513 0.904 0.622 0.521 0.228 0.605 0.366 0.539
Llama 3.1 Swallow 8B v0.5 0.372 0.665 0.597 0.536 0.900 0.666 0.699 0.390 0.589 0.557 0.597

Evaluation Benchmarks

The evaluation script can be found at swallow-llm/swallow-evaluation, tagged as v202411.

Japanese evaluation benchmarks

We used llm-jp-eval(v1.3.0), JP Language Model Evaluation Harness(commit #9b42d41) and Code Generation LM Evaluation Harness(commit #0261c52). The details are as follows:

  • Multiple-choice question answering (JCommonsenseQA [Kurihara et al., 2022])
  • Open-ended question answering (JEMHopQA [Ishii et al., 2024])
  • Open-ended question answering (NIILC [関根, 2003])
  • Machine reading comprehension (JSQuAD [Kurihara et al., 2022])
  • Automatic summarization (XL-Sum [Hasan et al., 2021])
  • Machine translation (WMT2020 ja-en [Barrault et al., 2020])
  • Machine translation (WMT2020 en-ja [Barrault et al., 2020])
  • Mathematical reasoning (MGSM [Shi et al., 2023])
  • Academic exams (JMMLU [尹ら, 2024])
  • Code generation (JHumanEval [佐藤ら, 2024])

English evaluation benchmarks

We used the Language Model Evaluation Harness(v.0.4.2) and Code Generation LM Evaluation Harness(commit #0261c52). The details are as follows:

  • Multiple-choice question answering (OpenBookQA [Mihaylov et al., 2018])
  • Open-ended question answering (TriviaQA [Joshi et al., 2017])
  • Machine reading comprehension (SQuAD2 [Rajpurkar et al., 2018])
  • Commonsense reasoning (XWINO [Tikhonov and Ryabinin, 2021])
  • Natural language inference (HellaSwag [Zellers et al., 2019])
  • Mathematical reasoning (GSM8K [Cobbe et al., 2021])
  • Mathematical reasoning (MATH [Hendrycks et al., 2022][Lightman et al., 2024])
  • Reasoning (BBH (BIG-Bench-Hard) [Suzgun et al., 2023])
  • Academic exams (MMLU [Hendrycks et al., 2021])
  • Code generation (HumanEval [Chen et al., 2021])

Training Datasets

Continual Pre-Training

The following datasets were used for continual pre-training.

Swallow Corpus Version 2

We built the Swallow Corpus by extracting high-quality Japanese texts from Common Crawl. In Version 2, we expanded the scope of the Common Crawl collection and modified the pipeline sequence to enable more flexible quality filtering. For Llama 3.1 Swallow v0.2, we further refined our quality filtering and data sampling strategies, resulting in an even higher-quality selection of Japanese texts for pre-training. For Llama 3.3 Swallow 70B v0.4, we generated synthetic QA-format text by using Gemma 2 27B IT to paraphrase educational web documents from our corpus.

Swallow Code & Swallow Math

Swallow Code and Swallow Math are high-quality, open-source datasets developed and publicly released by our team at the Institute of Science Tokyo, in collaboration with the Artificial Intelligence Research Center, AIST, Japan. These datasets are specifically designed to enhance the code and mathematical reasoning capabilities of large language models, with a focus on improving performance in Japanese and English tasks.

As demonstrated in our paper, "Rewriting Pre-Training Data Boosts LLM Performance in Math and Code", Swallow Code and Swallow Math outperform other datasets such as Stack-Edu and finemath-4+ in terms of quality and effectiveness.

Risks and Limitations

The models released here are still in the early stages of our research and development and have not been tuned to ensure outputs align with human intent and safety considerations.

Acknowledgements

We thank Meta Research for releasing Llama 3.3 under a generous open license.

We would like to thank Amazon Web Services (AWS) for providing access to SageMaker HyperPod, which enabled the training of the Llama 3.1 Swallow project.

We received various supports including:

  • AIST project: "Research and Development of Foundation Models for Generative AI in the Physical Domain"
  • NEDO project: "Development of Artificial Intelligence Application Technology to Support Judgment in Design Risk Assessment Work Based on the Perspective of Skilled Persons" (JPNP18002) of "Development of Integration Technology as the Core of Next Generation Artificial Intelligence and Robotics"
  • MEXT project: "Formation of R&D center to ensure transparency and reliability of generative AI models"
  • AIST program: Large Generative AI Development Support Program

License

META LLAMA 3.3 COMMUNITY LICENSE and Gemma Terms of Use

Authors

Here are the team members:

How to cite

If you find our work helpful, please feel free to cite these papers.

@inproceedings{Fujii:COLM2024,
   title={Continual Pre-Training for Cross-Lingual LLM Adaptation:
Enhancing Japanese Language Capabilities},
   author={Kazuki Fujii and Taishi Nakamura and Mengsay Loem and Hiroki
Iida and Masanari Ohi and Kakeru Hattori and Hirai Shota and Sakae
Mizuki and Rio Yokota and Naoaki Okazaki},
   booktitle="Proceedings of the First Conference on Language Modeling",
   series={COLM},
   pages="(to appear)",
   year="2024",
   month=oct,
   address={University of Pennsylvania, USA},
}
@inproceedings{Okazaki:COLM2024,
   title={Building a Large Japanese Web Corpus for Large Language Models},
   author={Naoaki Okazaki and Kakeru Hattori and Hirai Shota and Hiroki
Iida and Masanari Ohi and Kazuki Fujii and Taishi Nakamura and Mengsay
Loem and Rio Yokota and Sakae Mizuki},
   booktitle="Proceedings of the First Conference on Language Modeling",
   series={COLM},
   pages="(to appear)",
   year="2024",
   month=oct,
   address={University of Pennsylvania, USA},
}
@misc{fujii2025rewritingpretrainingdataboosts,
      title={Rewriting Pre-Training Data Boosts LLM Performance in Math and Code}, 
      author={Kazuki Fujii and Yukito Tajima and Sakae Mizuki and Hinari Shimada and Taihei Shiotani and Koshiro Saito and Masanari Ohi and Masaki Kawamura and Taishi Nakamura and Takumi Okamoto and Shigeki Ishida and Kakeru Hattori and Youmi Ma and Hiroya Takamura and Rio Yokota and Naoaki Okazaki},
      year={2025},
      eprint={2505.02881},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2505.02881}, 
}

References

@misc{dubey2024llama3herdmodels,
      title={The Llama 3 Herd of Models}, 
      author={Abhimanyu Dubey and Abhinav Jauhri and Abhinav Pandey and Abhishek Kadian and Ahmad Al-Dahle and Aiesha Letman and Akhil Mathur and Alan Schelten and Amy Yang and Angela Fan et al.},
      year={2024},
      eprint={2407.21783},
      archivePrefix={arXiv},
      primaryClass={cs.AI},
      url={https://arxiv.org/abs/2407.21783}, 
}
Downloads last month
275
Safetensors
Model size
8.03B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for tokyotech-llm/Llama-3.1-Swallow-8B-v0.5

Finetuned
(1512)
this model
Finetunes
1 model
Quantizations
1 model

Datasets used to train tokyotech-llm/Llama-3.1-Swallow-8B-v0.5

Collection including tokyotech-llm/Llama-3.1-Swallow-8B-v0.5