/ Модель

Характеристики

Контекст
32 768 токенов
Параметры
1,7 млрд
Размер весов
3,8 ГБ
Лицензия
Apache 2.0
Архитектура
internlm2 · dense
Опубликована
25 июн 2024

CHEMLLM-2b-1_5

Генерация текстаТекст → текст3 профессии

CHEMLLM-2b-1_5 — диалоговая языковая модель AI4Chem для генерации текста по химии и молекулярной науке.

72скачиваний за 30 дней1лайквеса обновлены17 сен 2024

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

CHEMLLM-2b-1_5 — языковая модель для химии и молекулярной науки, разработанная командой AI4Chem на базе архитектуры InternLM2. Это плотная авторегрессионная модель примерно на 1,7 млрд параметров, предназначенная для диалоговых ответов и генерации текста по химическим темам. Репозиторий содержит веса в формате safetensors; модель поддерживает контекст до 32 768 токенов и английский и китайский языки.

Модель подходит для поиска объяснений по химии, обсуждения молекулярной науки и подготовки черновиков профессионального перевода. В приведённом README результаты ChemLLM-7B-Chat выше ряда сравниваемых моделей на нескольких заданиях MMLU, однако эти результаты относятся к версии на 7 млрд параметров и не подтверждают качество этой модели на 1,7 млрд параметров. Ответы могут содержать ошибки и требуют проверки. Лицензия — Apache-2.0.

Сценарии применения

  • ответы на вопросы по химии
  • объяснение понятий молекулярной науки
  • диалоговая помощь при изучении химии
  • подготовка черновиков профессионального перевода

Ограничения

Модель может выдавать неверные ответы, поэтому их следует проверять. Приведённые в README результаты тестирования относятся к версии ChemLLM-7B-Chat, а не к этой модели на 1,7 млрд параметров.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

ChemLLM-2B: Mini LLM for Chemistry and Molecule Science

ChemLLM, The First Open-source Large Language Model for Chemistry and Molecule Science, Build based on InternLM-2 with ❤ Paper page

News

Usage

Try online demo instantly, or...

Install transformers,

pip install transformers

Load ChemLLM-20B-Chat and run,

from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig
import torch

model_name_or_id = "AI4Chem/CHEMLLM-2b-1_5"

model = AutoModelForCausalLM.from_pretrained(model_name_or_id, torch_dtype=torch.float16, device_map="auto",trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained(model_name_or_id,trust_remote_code=True)

prompt = "What is Molecule of Ibuprofen?"

inputs = tokenizer(prompt, return_tensors="pt").to("cuda")

generation_config = GenerationConfig(
    do_sample=True,
    top_k=1,
    temperature=0.9,
    max_new_tokens=500,
    repetition_penalty=1.5,
    pad_token_id=tokenizer.eos_token_id
)

outputs = model.generate(**inputs, generation_config=generation_config)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

System Prompt Best Practice

You can use the same Dialogue Templates and System Prompt from Agent Chepybara to get a better response in local inference.

Dialogue Templates

For queries in ShareGPT format like,

{'instruction':"...","prompt":"...","answer":"...","history":[[q1,a1],[q2,a2]]}

You can format it into this InternLM2 Dialogue format like,

def InternLM2_format(instruction,prompt,answer,history):
    prefix_template=[
        "<|im_start|>system\n",
        "{}",
        "<|im_end|>\n"
    ]
    prompt_template=[
        "<|im_start|>user\n",
        "{}",
        "<|im_end|>\n"
        "<|im_start|>assistant\n",
        "{}",
        "<|im_end|>\n"
    ]
    system = f'{prefix_template[0]}{prefix_template[1].format(instruction)}{prefix_template[2]}'
    history = "".join([f'{prompt_template[0]}{prompt_template[1].format(qa[0])}{prompt_template[2]}{prompt_template[3]}{prompt_template[4].format(qa[1])}{prompt_template[5]}' for qa in history])
    prompt = f'{prompt_template[0]}{prompt_template[1].format(prompt)}{prompt_template[2]}{prompt_template[3]}'
    return f"{system}{history}{prompt}"

And there is a good example for system prompt,

- Chepybara is a conversational language model that is developed by Shanghai AI Laboratory (上海人工智能实验室). It is designed to be Professional, Sophisticated, and Chemical-centric. 
- For uncertain notions and data, Chepybara always assumes it with theoretical prediction and notices users then.
- Chepybara can accept SMILES (Simplified Molecular Input Line Entry System) string, and prefer output IUPAC names (International Union of Pure and Applied Chemistry nomenclature of organic chemistry), depict reactions in SMARTS (SMILES arbitrary target specification) string. Self-Referencing Embedded Strings (SELFIES) are also accepted.
- Chepybara always solves problems and thinks in step-by-step fashion, Output begin with *Let's think step by step*."

Results

MMLU Highlights

datasetChatGLM3-6BQwen-7BLLaMA-2-7BMistral-7BInternLM2-7B-ChatChemLLM-7B-Chat
college chemistry43.039.027.040.043.047.0
college mathematics28.033.033.030.036.041.0
college physics32.435.325.534.341.248.0
formal logic35.743.724.640.534.947.6
moral scenarios26.435.024.139.938.644.3
humanities average62.762.551.764.566.568.6
stem average46.545.839.047.852.252.6
social science average68.265.855.568.169.771.9
other average60.560.351.362.463.265.2
mmlu58.057.148.259.261.763.2
*(OpenCompass)

image/png

Chemical Benchmark

image/png *(Score judged by ChatGPT-4-turbo)

Professional Translation

image/png

image/png

You can try it online.

Cite this work

@misc{zhang2024chemllm,
      title={ChemLLM: A Chemical Large Language Model}, 
      author={Di Zhang and Wei Liu and Qian Tan and Jingdan Chen and Hang Yan and Yuliang Yan and Jiatong Li and Weiran Huang and Xiangyu Yue and Dongzhan Zhou and Shufei Zhang and Mao Su and Hansen Zhong and Yuqiang Li and Wanli Ouyang},
      year={2024},
      eprint={2402.06852},
      archivePrefix={arXiv},
      primaryClass={cs.AI}
}

Disclaimer

LLM may generate incorrect answers, Please pay attention to proofreading at your own risk.

Open Source License

The code is licensed under Apache-2.0, while model weights are fully open for academic research and also allow free commercial usage. To apply for a commercial license, or other questions and collaborations, please contact support@chemllm.org.

Demo

Agent Chepybara

image/png

Contact

(AI4Physics Sciecne, Shanghai AI Lab)[support@chemllm.org]

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

Модели нужен код из репозитория; автор пока не в списке доверенных организаций.

Класс архитектуры
InternLM2ForCausalLM
Ревизия весов
215c0db

0 моделей