USTC-KnowledgeComputingLab/Llama3-KALE-LM-Chem-8B

Model

Llama3-KALE-LM-Chem-8B

6

12 commits

2 linked in READMEs

updated Apr 7, 2025

See the code

README

Llama3-KALE-LM-Chem-8B

Introduction

We are thrilled to present Llama3-KALE-LM-Chem 8B, our first open-source KALE-LM, which specializes in chemistry.

Training Details

We have continually pre-trained the model with a large amount of data and post-trained it through supervised fine-tuning.

Benchmarks

Open Benchmarks

ModelsChemBenchMMLUMMLU-ChemSciQIE(Acc)IE(LS)
GPT-3.547.1569.7553.3289.652.9868.28
GPT-453.7278.6763.7094.1054.2069.74
Llama3-8B-Instruct46.0268.351.1093.3045.8361.22
LlaSMol28.4754.4733.2472.302.163.23
ChemDFM44.4458.1145.6086.707.6111.49
ChemLLM-7B-Chat34.1661.7948.3994.0029.6639.17
ChemLLM-7B-Chat-1.5-SFT42.7563.5649.6395.1014.9619.61
Llama3-KALE-LM-Chem-8B52.4068.7453.8391.5062.8976.21

ChemBench Details (Evaluated By OpenCompass)

ModelsNCPPM2CC2MPPRSYPTPSPAverage
GPT-3.546.9356.9885.2838.2543.6742.3330.3342.573847.15
GPT-454.8265.0292.6452.8862.6752.6742.3324.7535.6753.72
Llama3-8B-Instruct51.3127.7990.3040.8834.0030.0045.3360.8933.6746.02
LlaSMol27.7829.3431.4423.3825.6724.0037.3334.6522.6728.47
ChemDFM36.9255.5783.9542.0040.0037.3339.0033.1732.0044.44
ChemLLM-7B-Chat41.0529.7685.2826.1226.0024.0020.0024.2631.0034.16
ChemLLM-7B-Chat-1.5-SFT50.0649.5185.2838.7538.0026.6728.3331.6833.6742.44
Llama3-KALE-LM-Chem-8B63.5858.3992.9844.5048.6738.3346.3344.5534.3352.41

Quick Start

from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda" # the device to load the model onto

model = AutoModelForCausalLM.from_pretrained(
    "USTC-KnowledgeComputingLab/Llama3-KALE-LM-Chem-8B",
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("USTC-KnowledgeComputingLab/Llama3-KALE-LM-Chem-8B")

prompt = "Give me a short introduction to large language model."
messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(device)

generated_ids = model.generate(
    model_inputs.input_ids,
    max_new_tokens=2048
)
generated_ids = [
    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]

response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]

Cite This Work

@article{dai2024kale,
  title={KALE-LM: Unleash The Power Of AI For Science Via Knowledge And Logic Enhanced Large Model},
  author={Dai, Weichen and Chen, Yezeng and Dai, Zijie and Huang, Zhijie and Liu, Yubo and Pan, Yixuan and Song, Baiyang and Zhong, Chengli and Li, Xinhe and Wang, Zeyu and others},
  journal={arXiv preprint arXiv:2409.18695},
  year={2024}
}
chemistry
conversational
KALE-LM
llama
pytorch
science
text-generation

USTC-KnowledgeComputingLab/Llama3-KALE-LM-Chem-8B

Model

Llama3-KALE-LM-Chem-8B

6

12 commits

2 linked in READMEs

updated Apr 7, 2025

See the code

README

Llama3-KALE-LM-Chem-8B

Introduction

We are thrilled to present Llama3-KALE-LM-Chem 8B, our first open-source KALE-LM, which specializes in chemistry.

Training Details

We have continually pre-trained the model with a large amount of data and post-trained it through supervised fine-tuning.

Benchmarks

Open Benchmarks

ModelsChemBenchMMLUMMLU-ChemSciQIE(Acc)IE(LS)
GPT-3.547.1569.7553.3289.652.9868.28
GPT-453.7278.6763.7094.1054.2069.74
Llama3-8B-Instruct46.0268.351.1093.3045.8361.22
LlaSMol28.4754.4733.2472.302.163.23
ChemDFM44.4458.1145.6086.707.6111.49
ChemLLM-7B-Chat34.1661.7948.3994.0029.6639.17
ChemLLM-7B-Chat-1.5-SFT42.7563.5649.6395.1014.9619.61
Llama3-KALE-LM-Chem-8B52.4068.7453.8391.5062.8976.21

ChemBench Details (Evaluated By OpenCompass)

ModelsNCPPM2CC2MPPRSYPTPSPAverage
GPT-3.546.9356.9885.2838.2543.6742.3330.3342.573847.15
GPT-454.8265.0292.6452.8862.6752.6742.3324.7535.6753.72
Llama3-8B-Instruct51.3127.7990.3040.8834.0030.0045.3360.8933.6746.02
LlaSMol27.7829.3431.4423.3825.6724.0037.3334.6522.6728.47
ChemDFM36.9255.5783.9542.0040.0037.3339.0033.1732.0044.44
ChemLLM-7B-Chat41.0529.7685.2826.1226.0024.0020.0024.2631.0034.16
ChemLLM-7B-Chat-1.5-SFT50.0649.5185.2838.7538.0026.6728.3331.6833.6742.44
Llama3-KALE-LM-Chem-8B63.5858.3992.9844.5048.6738.3346.3344.5534.3352.41

Quick Start

from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda" # the device to load the model onto

model = AutoModelForCausalLM.from_pretrained(
    "USTC-KnowledgeComputingLab/Llama3-KALE-LM-Chem-8B",
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("USTC-KnowledgeComputingLab/Llama3-KALE-LM-Chem-8B")

prompt = "Give me a short introduction to large language model."
messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(device)

generated_ids = model.generate(
    model_inputs.input_ids,
    max_new_tokens=2048
)
generated_ids = [
    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]

response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]

Cite This Work

@article{dai2024kale,
  title={KALE-LM: Unleash The Power Of AI For Science Via Knowledge And Logic Enhanced Large Model},
  author={Dai, Weichen and Chen, Yezeng and Dai, Zijie and Huang, Zhijie and Liu, Yubo and Pan, Yixuan and Song, Baiyang and Zhong, Chengli and Li, Xinhe and Wang, Zeyu and others},
  journal={arXiv preprint arXiv:2409.18695},
  year={2024}
}
chemistry
conversational
KALE-LM
llama
pytorch
science
text-generation