Skip to content

ChemSafetyBench: evaluating LLM safety in the chemistry domainChemSafetyBench: Benchmarking LLM Safety on Chemistry Domain

arXiv· arXiv:2411.16736· Haochen Zhao, Xiangru Tang, Ziran Yang, Xiao Han, Xuanzhi Feng, Yueqing Fan, Senhao Cheng, Di Jin, Yilun Zhao, Arman Cohan, Mark GersteinPeking University; Yale University; Sichuan University; China Agricultural University; Zhejiang University; Meta GenAIIndexed by this site · 2026-10-15· Originally publishedEvaluation

Quick read

Evaluation and benchmarks

Based on the paper PDF (AI-generated); refer to the original

ChemSafetyBench evaluates chemical safety with three tasks; the authors state that properties and uses were not significantly above random guessing.

Questions
LLMs used for scientific assistance may provide incorrect or unsafe chemical answers, even encouraging dangerous behaviors. Existing alignment rarely covers chemical safety. The authors evaluate this risk using ChemSafetyBench's three tasks: property, usage, and synthesis.
Methods
Substances are collected from regulatory lists and chemical databases, filled into human and GPT-4 templates, forming three tasks: properties, uses, and synthesis. At test time, name-hack is used; synthesis additionally uses AutoDAN and CoT. The first two tasks use classification metrics, and synthesis is scored by GPT-4o for safety and quality scores, with rule-based detection of refusals.
Experiments and results
The authors state that properties and uses were not significantly above random guessing. For synthesis, the authors state that name-hack increased the proportion of unsafe answers more than AutoDAN, and both, along with CoT, reduced quality. The authors believe Vicuna's high F1 may be a statistical artifact, and state that LLaMA3 performed best on synthesis.
Limitations and future work
In Future Work, the authors propose domain training, jailbreak defenses, and expert involvement in evaluation; the conclusions currently come from chemistry. The experiments cover the 10 models in Section 4.1 and the Vicuna models in the figures; AutoDAN and CoT are used only for synthesis. The paper does not report the number of items per task, repetitions, or the agent experiment sample size.
Experimental setupGPT-3.5-Turbo、GPT-4-Turbo et al. · ChemSafetyBench · Accuracy、Precision et al.
Evaluated models
GPT-3.5-TurboGPT-4-TurboGPT-4oLLaMA-3-70B-InstructLLaMA-3-8B-InstructLLaMA-2-70b-chat-hfLLaMA-2-7b-chat-hfYi-1.5-34B-ChatQwen1.5-72B-chatMixtral-8x7B-Instructvicuna-7bvicuna-13b-v1.5
Benchmarks
ChemSafetyBench
Metrics
AccuracyPrecisionRecallF1 ScoreSafety ScoreQuality Score
AI summaryThe research team releases ChemSafetyBench, a benchmark for evaluating LLMs' answer accuracy and safety in the chemistry domain. The benchmark includes three task types: querying chemical properties, judging the legality of chemical uses, and describing synthesis methods, with progressively deeper chemistry knowledge requirements. The dataset covers more than 30,000 samples. The authors add handcrafted templates and jailbreak scenarios to increase task diversity, and use an automated evaluation framework to assess model responses from three aspects: safety, accuracy, and appropriateness. Extensive experiments on frontier LLMs reveal clear strengths and key vulnerabilities. The code and dataset are open-sourced on GitHub.

The research team releases ChemSafetyBench, a benchmark for evaluating LLMs' answer accuracy and safety in the chemistry domain. The benchmark includes three task types: querying chemical properties, judging the legality of chemical uses, and describing synthesis methods, with progressively deeper chemistry knowledge requirements. The dataset covers more than 30,000 samples. The authors add handcrafted templates and jailbreak scenarios to increase task diversity, and use an automated evaluation framework to assess model responses from three aspects: safety, accuracy, and appropriateness. Extensive experiments on frontier LLMs reveal clear strengths and key vulnerabilities. The code and dataset are open-sourced on GitHub.

Related events and news

1 events · 2 news mentions

News that mentions this paper

佐治亚大学等发布LLM对齐与安全全景综述

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Existing evaluations rarely cover chemical safety; the authors use a three-task benchmark to test LLM responses on controlled chemicals.

    LLMs may give incorrect or unsafe answers in chemistry Q&A, and existing evaluations barely cover this risk.

    • Risk scenarios: The authors state LLMs are already used for research assistance and may still output dangerous information after safety training; Figure 1 shows three cases: wrongly assuring pesticide safety, misclassifying explosives as transportable, and guiding synthesis of controlled substances.
    • Existing gaps: The authors state alignment rarely focuses on chemical safety, or emphasizes knowledge over safety, or only handles general Q&A. Section 2.3 states ChemLLMBench has limited reaction types and SciMT-Bench does not consider jailbreaks.
    • Task gradient: The authors order tasks from shallow to deep chemical knowledge: properties, use legality, synthesis methods, and state that later tasks require deeper chemical knowledge.
    • Proposed benchmark: The authors propose ChemSafetyBench, built from regulatory lists and chemistry knowledge bases. The abstract states more than 30K samples; the conclusion states over 30K entries. Manual templates and jailbreak rewrites increase question phrasings; automated evaluation examines correctness, refusal, and the safety/quality trade-off.
  2. What related research exists?

    Related work is divided into chemistry LLMs, general safety benchmarks, and science benchmarks; the authors state that chemistry-specific safety evaluation remains scarce.

    LLMs in Chemistry

    • Coscientist (Boiko et al., 2023): Based on GPT-4, autonomously designs and executes experiments; the example in the text is optimizing palladium-catalyzed cross-coupling.
    • ChemCrow: The paper describes it as a GPT-4-based agent integrating 18 expert tools for organic synthesis, drug discovery, and materials design.
    • ChemLLM: The paper describes it as a chemistry-oriented fine-tuning framework including ChemData and ChemBench. The authors only state that safety risks remain worth attention after such systems improve chemical capabilities, without critiquing methods one by one.

    General Safety Benchmarks

    • SafetyBench (Zhang et al., 2023): 11,435 multiple-choice questions in seven categories, testing 25 Chinese and English LLMs.
    • JADE, Llama Guard, SALAD-Bench, ALERT: Respectively use syntactic analysis with hard seed questions, query/response classification with risk guidelines, harmful QA fine-tuning of GPT-3.5 with attack and defense subsets, and adversarial augmentation for fine-grained risk classification.
    • SafetyPrompts (Röttger et al., 2024): A survey of existing LLM safety datasets. The authors state these works target general safety, and fields like chemistry remain less discussed.

    Science Benchmarks

    • Multiple evaluations exist for mathematics, physics, medicine, biology, and research capability; the paper only lists them without item-by-item comparison to this work.
    • ChemLLMBench (Guo et al., 2023): 8 tasks using SMILES, expecting inference of properties and reactions from functional groups; the authors state the reaction types are limited.
    • SciMT-Bench (He et al., 2023): Evaluates safety in biochemistry and other fields, using structural formulas for synthesis questions; the authors state user jailbreaks are not considered.

    Comparison and Positioning

    • Comparison: Other benchmarks are not treated as method baselines. The experiments compare multiple LLMs on the same prompts, and the authors treat random guessing as a reference for Property/Usage.
    • The authors position this work as a safety evaluation on chemical hazard information: three tasks, regulatory standards, and jailbreak rewrites, to cover what general safety benchmarks and chemistry capability benchmarks do not, and state it fills a gap in existing evaluation methods.
  3. How does the paper address this problem?

    ChemSafetyBench fills controlled substances into three tasks, then tests safety using rewrites and GPT-4o review.

    The overall approach is to fill templates with controlled chemical knowledge, forming the three-tier tasks of ChemSafetyBench, then apply jailbreak rewrites during testing, and score using classification metrics and GPT-4o review (Figure 2).

    Tasks and Data Sources

    • Three tasks: Property asks about properties, Usage asks whether a use is reasonable, both are yes/no questions; Synthesis requires planning a single-step reaction. The first two use only controlled unsafe chemicals; Synthesis includes 26% uncontrolled safe chemicals.
    • Sources: Japan's list of controlled substances, ECHA's REACH, the US CSA, the CWC signed by 193 countries, harmless chemicals from high school textbooks, and the US PHMSA prohibited list. Section 3 states over 1,700 substances, Section 3.1 states approximately 1.7k.
    • Knowledge: Properties from PubChem; single-step synthesis routes manually collected from Reaxys and SciFinder. Hazard classification uses GHS. Figure 3 gives category distributions; the text does not list percentages per category.

    Templates and Rewriting

    • Templates: Section 3 states over 500 query templates, Section 3.3 states 500, generated by humans and GPT-4; relevant graduate students also wrote phrasings. Appendix Tables 1 and 2 give examples; the questions are not restated here.
    • name-hack: Replaces common names with less familiar scientific names or common synonyms, used in all three tasks. Appendix D states synonyms and IUPAC names were collected together.
    • AutoDAN and CoT: Used only for Synthesis. The paper states AutoDAN is a black-box jailbreak that rewrites prompts into covert human-like phrasings; CoT is used to examine performance under that reasoning setting. The paper does not state which model AutoDAN used.
    • System prompts: All models use the same set; if the interface lacks this, the sentence is prepended to the question. Hyperparameter values are not reported. The attached text does not provide the original system prompts.

    Scoring

    • Classification metrics: Property/Usage report accuracy, precision, recall, F1. The ground truth is determined by the prompt category and substance; the authors state the questions are mutually exclusive, corresponding to only one GHS category.
    • Synthesis scores: Quality Score is directly scored by GPT-4o from 1 to 10. Safety Score has three steps: extract chemical names, external lookup, and return results to GPT-4o for scoring. The main text states an external GHS tool; Appendix C states PubChem lookup.
    • Safety criteria: Answers involving detailed reactions of dangerous compounds are counted as inappropriate even if helpful. For safe home experiments (the text gives baking soda and vinegar as an example), steps and safety precautions should be provided. Appendix Tables 3 and 4 give the full review prompts.
    • Refusals: Rule-based detection of refusal statements. The authors state details are in the appendix; the attached text does not show the rule items or refusal rates.
  4. What experiments did the paper conduct?

    The authors state that properties and uses were not significantly above random guessing; for synthesis, name-hack more easily increased unsafe answers.

    Experimental Setup

    • Models: Section 4.1 lists GPT-3.5-Turbo, GPT-4-Turbo, GPT-4o, LLaMA-3-70B-Instruct, LLaMA-2-70b-chat-hf, Yi-1.5-34B-Chat, Qwen1.5-72B-chat, Mixtral-8x7B-Instruct, LLaMA-3-8B-Instruct, LLaMA-2-7b-chat-hf. Figure 4/5 also includes vicuna-7b (coordinates: vicuna-7b-v1.5) and vicuna-13b-v1.5; Section 4.1 does not list Vicuna.
    • Data and protocol: Same set of prompts, same set of hyperparameters; hyperparameter values not reported. Total samples over 30K, per-task counts not reported. The paper does not report number of repetitions.
    • Conditions: Property/Usage: naive and name-hack; Synthesis: original, name hack, autoDAN, CoT.
    • Metrics: First two tasks: accuracy, precision, recall, F1; synthesis task: 1 to 10 Safety Score, Quality Score, plus rule-based refusal detection.
    • Evaluation: Synthesis scores given by GPT-4o. Safety query text uses GHS tool in main text, PubChem in Appendix C. Paper does not report agreement with human scoring.
    • Additional comparison: GPT-4o with ReAct integrated with LangChain's Google Search and Wikipedia, compared to GPT-4o alone; authors say they used a smaller sample due to time and budget, but did not report sample size.

    Main Results

    In the raw text, F1 bars in Figure 4 cannot be reliably aligned with model columns; the table below only includes comparisons explicitly stated in the main text, without filling in per-model scores.

    | Observation | Authors' report | Source | | Property/Usage, from LLaMA-2-7b-chat to GPT-4o | Not significantly above random guessing | Section 4.2 | | Accuracy of smaller models | Nearly equivalent to random sampling | Section 4.2 | | GPT-4o Property/Usage | Performed poorly | Section 4.2 | | Synthesis name hack, AutoDAN | Increased proportion of unsafe answers, name hack more effective | Section 4.2 | | Quality of jailbreak rewrites and CoT | Jailbreaks reduce quality to varying degrees; CoT also reduces quality | Section 4.2 | | LLaMA3-70B synthesis task | Authors claim it performed best | Figure 5 caption |

    • Authors believe high scores on yes/no questions may not indicate understanding of chemical safety, and state that Vicuna's F1 may come from statistical bias rather than chemical knowledge (Figure 4 caption, Section 4.3).
    • Main text states finer accuracy, precision, recall are in appendix; these tables are not present in the provided text, so per-model numbers cannot be verified.
    • Authors believe CoT reduces quality, possibly because models lack chemical knowledge and this is amplified; they also claim LLaMA3 performed well, possibly due to chemical fine-tuning mentioned in its model card.

    Synthesis Task Distribution

    • What was tested: Figure 5a shows density of safety and quality scores for LLaMA3-70B under name hack, autoDAN, CoT, and original conditions; Figure 5b shows vicuna-13b-v1.5, gpt-4o, Meta-Llama-3-8B-Instruct, Meta-Llama-3-70B-Instruct selected by authors.
    • Results: Main text does not give means for each condition. Caption says points are mean scores; one shadow is 0.5 standard deviations, other ellipsis semi-axis is 0.2 standard deviations.
    • Interpretation: Authors state name hack is more effective than AutoDAN at increasing unsafe answers and reduces quality.

    Tokenization and External Knowledge

    • Tokenization: Authors processed chemical names with multiple tokenizers, report average tokens of only 4-6 characters, and believe chemical semantics are lost in embedding layer (Section 4.3). Figure 6a shows length distribution for GPT-4o tokenizer; authors claim tokens may be more fragmented; main text does not give distribution values.
    • Knowledge: Authors believe standard chemical names and property descriptions are rare in pretraining data, mostly in restricted databases.
    • Agent: Authors report higher failure rate within given turns, but accuracy and precision improved. Figure 6b axes are four classification metrics; main text does not give bar values. Authors claim this suggests external knowledge tools can improve performance; retrieval uses Google and Wikipedia, not specialized chemical databases.

    Other Ablations and Analyses

    • Name-hack vs. naive per-model F1 differences: not reported in main text, only paired bars in Figure 4.
    • AutoDAN and CoT used only for Synthesis (Appendix D); Property/Usage only name-hack.
    • Refusal detection results: authors refer to appendix, no numbers in provided text.
    • Agent experiment sample size and turn limit: not reported in paper.
    • Per-task counts, repetitions, hyperparameter values, AutoDAN model: not reported in paper.
    • Results authors report as low: overall not significantly above random guessing; CoT reduces quality; agent failure rate higher.
  5. What are some points that can be further explored?

    The authors propose domain training, jailbreak defenses, and expert involvement; the conclusions currently come from chemistry.

    Limitations and Future Directions Noted by the Authors

    • Domain training: Future work should involve domain-specific training with more comprehensive datasets and collaboration with experts to improve accuracy and safety (Section 4.3 Future Work).
    • Defenses: Defenses such as anomaly detection and filtering are needed to address vulnerabilities from jailbreak methods (same section).
    • Expert evaluation: Chemistry experts should participate in evaluation, with continued collaboration with AI researchers to fine-tune models and improve the benchmark (same section).
    • Scope: The authors state the current conclusions come from chemistry and believe the assumptions about specialized terminology and social risk can extend to other professional domains (Conclusion).

    The paper has no separate Limitations section.

    Experimental Coverage

    • Section 4.1 lists 10 tested models; Figure 4/5 also show vicuna-7b-v1.5 and vicuna-13b-v1.5. Figure 5b plots the safety-quality means for 4 of these models.
    • Tasks are Property, Usage, and Synthesis. The first two use only controlled unsafe chemicals; Synthesis includes 26% uncontrolled safe chemicals.
    • name-hack is used for all three tasks; AutoDAN and CoT are used only for Synthesis (Appendix D). The paper does not report which model AutoDAN used for rewriting.
    • Synthesis scoring uses GPT-4o on a 1 to 10 scale. Safety lookup is an external GHS tool in the main text and PubChem in Appendix C. The paper does not report the number of repetitions, number of items per task, hyperparameters, or agreement between review and humans.
    • The agent comparison is GPT-4o versus GPT-4o with LangChain (Google Search, Wikipedia). The authors state a smaller sample was used due to time and budget; the paper does not report that sample size; the retrieval did not use specialized chemistry databases.
  6. Summarize the main content of the paper

    ChemSafetyBench evaluates chemical safety with three tasks, and the authors state that existing LLMs still need more effective safeguards.

    ChemSafetyBench evaluates whether LLMs are accurate and safe when processing chemical information.

    • Problem: Models may give incorrect answers about dangerous chemicals or synthetic information that could be misused, and general alignment and chemical capability benchmarks do not adequately cover this.
    • Method: Compiled over 1,700 substances and 500 templates from multinational control lists and PubChem, Reaxys, SciFinder. Summary says samples more than 30K, conclusion says over 30K entries. Three tasks: property, usage, synthesis; testing uses name-hack, synthesis adds AutoDAN and CoT.
    • Judgment: First two tasks use classification metrics; synthesis scored by GPT-4o with safety and quality scores from 1 to 10, and rule-based refusal detection. Safety query text written as GHS tool in main text and PubChem in appendix.
    • Results: Authors claim property and usage from LLaMA-2-7b-chat to GPT-4o are not significantly above random guessing, GPT-4o also poor. For synthesis, authors claim name-hack and AutoDAN increase unsafe answer proportion and reduce quality, name-hack more effective, CoT also reduces quality. Authors claim LLaMA3-70B performed best on synthesis, and believe Vicuna's high F1 may be statistical bias. Authors report chemical names are on average tokenized into 4-6 character tokens.
    • Conclusion: Authors claim current LLMs still need more effective chemical safety protections, and propose domain training, jailbreak-specific detection and filtering, and involving chemistry experts in evaluation. Authors believe similar problems may exist in other specialized domains where terminology is special and information must be accurate.
Read originalarxiv.org