Quokka: An Open-source Large Language Model ChatBot for Material Science

Xianjun Yang, Stephen D. Wilson, Linda R. PetzoldarXiv 2024 · DOI

Abstract

Large Language Models (LLMs) have demonstrated remarkable capabilities in general tasks but often lack the specialized "intuition" required for deep scientific domains. We present Quokka, a family of open-source LLMs specifically optimized for the materials science community. Quokka is developed through a two-stage process: continued pre-training on a corpus of over one million domain-specific academic articles followed by targeted instruction tuning. Our results show that this "knowledge-first" approach, combined with safety-conscious fine-tuning, produces a chatbot capable of assisting with complex materials queries while maintaining general reasoning and ethical guardrails.

Introduction

While general-purpose LLMs like ChatGPT and Gemini have revolutionized daily productivity, they remain "black boxes" that are neither open-sourced nor specifically optimized for deep scientific domains. In specialized fields like materials science, general models often lack the nuanced understanding found in the vast corpus of domain literature. Previous attempts to bridge this gap often relied on parameter-efficient fine-tuning, which only modifies a small fraction of the model's behavior. The authors of Quokka argue that to truly empower a model with professional materials knowledge, one must perform continued pre-training—essentially allowing the model to "read" the library of materials science before teaching it how to interact with users.

Methodology

The development of Quokka followed a rigorous two-stage pipeline designed to balance specialized knowledge acquisition with conversational utility.

The two-stage training pipeline for Quokka, involving pre-training on scientific articles followed by instruction tuning.
  1. Continued Pre-training: The team started with the Llama-2 (7B and 13B) base models. They performed full-parameter updates using a massive corpus of materials science papers. To prevent "catastrophic forgetting"—where a model becomes so specialized it loses basic reasoning skills—they mixed the domain data with a 10% sample of general-purpose text from the RedPajama dataset.
  2. Instruction Tuning: After the model gained domain knowledge, it underwent instruction tuning to learn how to follow human intents. This involved training on a mix of general instructions (LIMA) and specific materials science instructions (HoneyBee), plus custom instructions regarding the model's identity as an assistant built by the UCSB Quantum Foundry.

The technical stack utilized high-performance tools including DeepSpeed Zero-stage 3, Flash-Attention, and Fully Sharded Data Parallel (FSDP) to manage the heavy computational load on an 8x A100 GPU cluster.

Datasets

  • S2ORC (Semantic Scholar Open Research Corpus): The primary source for pre-training, specifically 1,101,065 materials science articles, processed into over 2.2 million text pieces.
  • RedPajama-Data-1T-Sample: Used as a 10% "anchor" dataset to maintain general knowledge.
  • LIMA & HoneyBee: For instruction tuning, the authors combined 1,030 instructions from the LIMA set (general) and 2,307 instructions from the HoneyBee set (materials-specific).

Key Results and Discussion

The models demonstrated high efficiency during training, with the 7B model requiring 25 hours and the 13B model requiring 56 hours. A critical finding was the impact of model scaling on domain performance.

Training loss and final perplexity (PPL) for the Quokka-7B and Quokka-13B models during the pre-training phase.

As shown in the training metrics, the 13B parameter model consistently outperformed the 7B version, achieving a final perplexity of 4.25 compared to 5.18. This suggests that the complexity of materials science literature benefits significantly from larger model architectures.

In case studies, Quokka demonstrated strong Zero-Shot Capability, answering specific property questions (e.g., the band gap of Silicon is .12 eV) and summarizing complex research papers within specific constraints. Furthermore, despite being trained on technical data that could potentially be misused, the instruction tuning successfully implemented safety guardrails. The model is designed to refuse requests for unethical or illegal tasks, such as instructions for building weapons.

Limitations and Future Work

The authors identify two main avenues for improvement:

  1. Instruction Granularity: Collecting more fine-grained instructions to help the model follow complex, multi-step scientific protocols more accurately.
  2. Multimodality: Materials science is a visual field involving crystal structures and microscopy images. Future iterations of Quokka aim to incorporate vision capabilities to allow the model to interpret scientific imagery directly.

Availability: The researchers have released four checkpoints (7B and 13B, in both base and chat versions) for free on GitHub: https://github.com/Xianjun-Yang/Quokka

Summary updated

BibTeX
@misc{yang2024quokka,
  author = {Xianjun Yang and Stephen D. Wilson and Linda R. Petzold},
  title = {{Quokka: An Open-source Large Language Model ChatBot for Material Science}},
  year = {2024},
  eprint = {2401.01089},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.01089},
}
Figure