# LLM4Decompile: Decompiling Binary Code with Large Language Models

Hanzhuo Tan, Qi Luo, Jing Li, Yuqun Zhang
Southern University of Science and Technology
The Hong Kong Polytechnic University

###### Abstract

Decompilation aims to restore compiled code to human-readable source code, but
struggles with details like names and structure. Large language models (LLMs)
show promise for programming tasks, motivating their application to
decompilation. However, there does not exist any open-source LLM for
decompilation. Moreover, existing decompilation evaluation systems mainly
consider token-level accuracy and largely ignore code executability, which is
the most important feature of any program. Therefore, we release the first
open-access decompilation LLMs ranging from 1B to 33B pre-trained on 4 billion
tokens of C source code and the corresponding assembly code. The open-source
LLMs can serve as baselines for further development in the field. To ensure
practical program evaluation, we introduce Decompile-Eval, the first dataset
that considers re-compilability and re-executability for decompilation. The
benchmark emphasizes the importance of evaluating the decompilation model from
the perspective of program semantics. Experiments indicate that our
LLM4Decompile has demonstrated the capability to accurately decompile 21% of
the assembly code, which achieves a 50% improvement over GPT-4. Our code,
dataset, and models are released at
https://github.com/albertan017/LLM4Decompile.

LLM4Decompile: Decompiling Binary Code with Large Language Models

Hanzhuo Tan, Qi Luo, Jing Li, Yuqun Zhang Southern University of Science and
Technology The Hong Kong Polytechnic University

##  1 Introduction

Decompilation is the process of converting compiled machine code or bytecode
back into a high-level programming languages. This is often done to analyze
the workings of software when its source code is not accessible Brumley et al.
(2013); Katz et al. (2018); Hosseini and Dolan-Gavitt (2022); Xu et al.
(2023); Armengol-Estapé et al. (2023); Jiang et al. (2023); Wong et al.
(2023). There have been numerous tools developed for decompilation, such as
Ghidra Ghidra (2024) and IDA Pro Hex-Rays (2024). Although these tools have
the capability to revert binary code to source code in specific scenarios,
they often fall short in producing code that is easily readable by humans. The
inherent difficulty of decompilation lies in the inability to fully recreate
the source, especially finer details like variable names Lacomis et al. (2019)
and the primary structure Wei et al. (2007), such as loops and conditional
statements, which are often lost during the compilation process.

Figure 1: Pipeline to evaluate the decompilation.

Recent advances in large language models (LLMs) have led researchers to
approach programming languages as distinct linguistic systems, using pre-
trained code LLMs for various coding tasks Lippincott (2020); Rozière et al.
(2023); Guo et al. (2024). These models have shown impressive performance
improvements over traditional techniques Zeng et al. (2022); Xu et al. (2022),
which leads us to the possibility of applying LLMs to cope with the
decompilation challenge. To illustrate, Transformer-based models such as Slade
Armengol-Estapé et al. (2023) and Nova Jiang et al. (2023) have showcased the
potential of using language models to turn binary code back into source code
that is much closer to the source code in readability and structure. However,
the scope of their models is somewhat constrained at 200M and 1B parameters
for Slade and Nova which could result in a reduced capacity for learning and
generalization, whereas larger models typically exhibit a marked improvement
in these areas by leveraging their extensive parameters to process and
integrate a broader range of information Rozière et al. (2023); OpenAI (2023).
Moreover, their lack of public availability limits their contribution to
promoting further progress in this domain. Furthermore, to the best of our
knowledge, no standardized benchmark dataset exists for evaluating and
comparing decompilation techniques. Researchers tend to employ different
datasets da Silva et al. (2021); Collie et al. (2020); Tan et al. (2017) to
evaluate their results, making direct comparison difficult. Therefore, there
is a strong need to establish a benchmark to evaluate the decompilation
performance, which can significantly facilitate the formulation of coherent
and standard evaluation criteria for the decompilation domain.

Thus, our objective is to create and release the first open-source LLM
dedicated to decompilation, and to assess its capabilities by constructing the
first decompilation benchmark focused on re-compilability and re-
executability. We start by compiling a million C code samples from AnghaBench
da Silva et al. (2021) into assembly code using GCC Stallman et al. (2003)
with different configurations, forming a dataset of assembly-source pairs in 4
billion tokens. We then finetune the DeepSeek-Coder model Guo et al. (2024), a
leading-edge code LLM, using this dataset. Followed by constructing the
evaluation benchmark, Decompile-Eval, based on HumanEval Chen et al. (2021)
questions and test samples. Specifically, we formulate the evaluation from two
perspectives: whether the decompiled code can recompile successfully, and
whether it passes all assertions in the test cases. Figure 1 presents the
steps involved in our decompilation evaluation. First, the source code
(denoted as $src$) is compiled by the GCC compiler with specific parameters,
such as optimization levels, to produce the executable binary. This binary is
then disassembled into assembly language (denoted as $asm$) using the objdump
tool. The assembly instructions are subsequently decompiled to reconstruct the
source code in a format which is readable to humans (denoted as
$src^{\prime}$). To assess the quality of the decompiled code
($src^{\prime}$), it is tested for its ability to be recompiled with the
original GCC compiler (re-compilability) and for its functionality through
test assertions (re-executability).

On Decompile-Eval, the llm4decompile models demonstrated promising results in
their ability to decompile binaries, with an impressive 90% of the decompiled
code being recompilable using the same settings in the GCC compiler,
signifying a solid understanding of code structure and syntax. As for the
ability to execute the code, 21% of the decompiled codes from the 6B version
successfully capture the semantics of a program and pass all the test cases.

In conclusion, our contributions are twofold:

$\bullet$ We provide the first open-source LLM ranging from 1B to 33B tailored
for decompilation, which also facilitates compilation and diverse binary
tasks.

$\bullet$ We construct the first decompilation benchmark which targets re-
compilation and re-execution rate, which indicate syntax recovery and semantic
preservation—both essential for usable and robust decompilation.

##  2 Related Work

###  2.1 Decompilation

The practice of reversing executable binaries to their source code form, known
as decompilation, has been researched for decades. Traditional decompilation
relies on analyzing the control and data flows of program Brumley et al.
(2013), and employing pattern matching, as seen in tools like Hex-Rays Ida pro
Hex-Rays (2024) and Ghidra Ghidra (2024). These systems attempt to identify
patterns within a program’s control-flow graph (CFG) that corresponds to
standard programming constructs such as conditional statements or loops.
However, crafting these rule-based systems can be challenging and prone to
mistakes as the rules are complex to create, often only partially cover the
CFG, and take extensive time to develop Armengol-Estapé et al. (2023); Jiang
et al. (2023). They are particularly weak when facing code that has been
optimized, which is a common practice for commercially compiled software. The
code output from such decompilation processes tends to be a source-code-like
representation of assembly code, including direct translations of variables to
registers, use of gotos, and other low-level operations instead of the
original high-level language constructs. This output, while often functionally
similar to the original code, is difficult to understand and may not be
efficient enough to allow for recompilation Liu and Wang (2020).

Drawing inspiration from neural machine translation, researchers have
reformulated decompilation as a translation exercise, converting machine-level
instructions into readable source code. Initial attempts in this area utilized
recurrent neural networks (RNNs) Katz et al. (2018) for decompilation,
complemented by error-correction techniques to enhance the outcomes.
Nonetheless, these efforts were constrained in their effectiveness.

The latest advancements in natural language processing (NLP) have enabled the
use of pre-trained language models (LMs) for coding-related tasks Rozière et
al. (2023); Lippincott (2020); Guo et al. (2024). These models generally
incorporate the Transformer architecture Vaswani et al. (2017), using self-
attention mechanisms, and are pre-trained on extensive text datasets. This
approach allows LMs to capture contextual nuances and aids in the acquisition
of general language understanding. In the realm of binary decompilation, BTC
Hosseini and Dolan-Gavitt (2022) was one of the first to fine-tune an LM for
this purpose. Following this, Slade Armengol-Estapé et al. (2023) utilized the
BART model and trained an LM-based decompiler with 200 million parameters,
while Nova Jiang et al. (2023) developed a binary LM with 1 billion parameters
starting from the StarCoder checkpoint and fine-tuned it for decompilation.
Although these models show potential in decompilation, they are limited in
size, e.g., the Code Llama model Rozière et al. (2023), launched in 2023, has
at least 7 billion parameters.

###  2.2 Evaluation

There is a notable gap in the field of decompilation: a lack of a unified,
accepted benchmark for measuring the quality of decompilation tools. Various
sources are used for evaluation purposes. BTC Hosseini and Dolan-Gavitt
(2022), for example, leverages web data including interview-style coding
problems and the extensive Debian Linux repository to evaluate decompilation
accuracy. Meanwhile, Slade Armengol-Estapé et al. (2023) is tested using both
Synth, a synthetic code generation framework, and the subset of ExeBench da
Silva et al. (2021); Collie et al. (2020), a benchmark consisting of
executable C programs. Nova Jiang et al. (2023) evaluates its decompilation
capabilities on a synthetic dataset that it created, in addition to the
CodeFlaws Tan et al. (2017) dataset, which is designed to identify common
coding errors.

The metrics employed for these evaluations predominantly focus on N-gram
similarity, with the use of BLEU or Token Accuracy, as well as Edit Similarity
(ES). Slade Armengol-Estapé et al. (2023) goes a step further by incorporating
Input Output (IO) Accuracy Le et al. (2014); Liu and Wang (2020) into its
evaluation framework. This metric assesses semantic equivalence through
behavioral equality, meaning it checks whether the decompiled code and the
original code produce the same outputs when given the same inputs. However, IO
Accuracy relies on external processes to generate input and output samples for
comparison. The generation of input and output samples often involves
randomness, leading to non-deterministic results and making it difficult to
consistently assess the performance of a decompiler.

Consequently, our goal is to develop and make the first open-source large
language model (LLM) tailored for decompilation. We also aim to establish the
first benchmark for re-compilability and re-executability to set a standard
for performance evaluation in the field of decompilation.

##  3 LLM4Decompile

In this section, we describe the pre-training data, present different model
configurations, and discuss the pre-training objectives involved in pre-
training the LLM.

###  3.1 Pre-training Data

We construct asm-source pairs based on Anghabench da Silva et al. (2021),
which is a public collection of one million compilable C files. Following the
practice of previous works Armengol-Estapé et al. (2023), we first compile the
source code into an binary object file, disassemble the object file into
assembly code, and pair it with the source code, where we only consider the
x86 Linux platform. In the real deployment, programmers will choose different
compiler optimization flags to optimize the execution performance. Compiler
optimization refers to the process of tweaking and transforming source code to
generate faster and more efficient machine code. It involves techniques like
eliminating redundant instructions, better register allocation, loop
transformations, etc. The different optimization levels trade off compile time
against execution time and debugging ability. The key optimization levels are:
O0 (default, No optimization) to O3 (Aggressive optimizations, compilation
time consuming). We compile the source code into all four stages, i.e., O0,
O1, O2, O3, and pair each of them with the source code. To inform the model
with the optimization stage, we use the following prompt: # This is the
assembly code with [optimization state] optimization: [asm code] # What is the
source code?.

###  3.2 Model Configurations

Our LLM4Decompile uses the same architecture as DeepSeek-Coder and we
initialize our model with the corresponding DeepSeek-Coder checkpoints. As a
neural translator, the training objectives can be categorized into two
categories, as shown in Figure 2.

Figure 2: Training objectives

1) Next token prediction (NTP) or language modeling, which is the pre-training
objective of most LLM models targeting predicting the next token given
previous inputs. As depicted in Equation 1, it minimizes the negative log
probability for the ground truth token $x_{i}$:

$\mathcal{L}=-\sum_{i}\log P_{i}(x_{i}|x_{1},x_{2},...,x_{i-1};\theta)$ (1)

where the conditional probability $P$ is modeled using LLM4Decompile model
with parameters $\theta$. These parameters are optimized by applying the
gradient descent algorithms Ruder (2016) with respect to the input sequence
$x_{1},x_{2},...,x_{i-1}$ preceding the given token $x_{i}$.

2) Sequence-to-sequence prediction (S2S), which is the training objective
adopted in most neural machine translation models that aims to predict the
output given the input sequence. As depicted in Equation 2, it minimizes the
negative log probability for the C code tokens $x_{i},...,x_{j}$:

$\mathcal{L}=-\sum_{i}\log P_{i}(x_{i},...,x_{j}|x_{1},...,x_{i-1};\theta)$
(2)

where the loss is calculated only for the output sequence $x_{i}...x_{j}$, or
the C code.

The main difference lies in whether the input sequence or the input assembly
code is included in the training loss or not, whereas in language modeling,
all the inputs are included for loss calculation. We conduct different
ablation studies on these two training objectives to explore their
effectiveness in decompilation.

##  4 Experiment Setups

###  4.1 Decompile-Eval Benchmark

Currently, there appears to be no benchmark for decompilation evaluation that
considers whether code can be recompiled or executed correctly. When assessing
decompilation model performance, researchers rely on metrics that measure
N-gram similarity (such as BLEU or CodeBLEU) or edit similarity (ES). However,
these metrics, commonly used in machine translation and text generation, fail
to adapt to the evaluation of programming languages.

Programming languages are highly structured and logical, insensitive to the
naming of functions and variables, yet very sensitive to the flow of data and
logic. Changing variable or function names does not affect the meaning of a
program, but a single logical error can alter its entire function and purpose.
As illustrated in Figure 3, the use of BLEU and ES in evaluating code
similarity is problematic. For $src_{1}$, the variation from the original
$src$ is confined to type conversion of variable $num$, which leads to high
BLEU and ES scores. However, this alteration completely changes the intent of
the code. Similarly, $src_{2}$ achieves high BLEU and ES scores, yet the
semantics of the function are lost. Conversely, $src_{3}$ undergoes
normalization of function and variable names, causing no semantic shift yet
scoring zero in BLEU against the original code. The example of $src_{4}$ is
more extreme: if the program logic is broken down into multiple lines, the ES
drops to 41.4%, falsely indicating a low similarity. However, during
compilation, names are typically standardized by the compiler, and source code
is often broken down into basic operations depending on optimization. For this
reason, the ability to recompile and execute the code is far more indicative
than N-gram or edit similarity for evaluating decompilation efficacy.

Figure 3: Limitation to use BLEU and Edit Similarity for evaluating
decompilation results.

To address the gap in decompilation assessment, we introduce Decompile-Eval,
the first benchmark to evaluate the re-compilability and re-executability of
decompilation systems. This benchmark is derived from HumanEval Chen et al.
(2021), which is the leading benchmark for code generation assessment and
includes 164 programming challenges with accompanying Python solutions and
assertions. We converted these Python solutions and assertions into C, making
sure that they compile with the GCC compiler using standard C libraries and
pass all the original assertions. In our evaluation process (Figure 1), the C
source code is first compiled into a binary, then disassembled into assembly
code, and finally fed into the decompilation system to be reconstructed back
into C source code. This regenerated C code is compiled with GCC to test re-
compilability and combined with the original assertions to check if it can
successfully execute and pass those assertions. Re-compilability and re-
executability serve as critical indicators in validating the effectiveness of
a decompilation process. When decompiled code can be recompiled, it provides
strong evidence of syntactic integrity. It ensures that the decompiled code is
not just readable, but also adheres to the structural and syntactical
standards expected by the compiler. However, syntax alone does not guarantee
semantic equivalence to the original pre-compiled program. Re-executability
provides this critical measure of semantic correctness. By re-compiling the
decompiled output and running the test cases, we assess if the decompilation
preserved the program logic and behavior. Together, re-compilability and re-
executability indicate syntax recovery and semantic preservation—both
essential for usable and robust decompilation.

In alignment with established evaluation practices, following Slade Armengol-
Estapé et al. (2023), we partition 1000 samples from the AnghaBench into a
test set. We then utilize BLEU and ES as our primary metrics for assessment.

###  4.2 Baselines

To benchmark against SOTA decompilers, we selected two key baselines. First,
GPT-4 represents the most capable LLMs, providing an upper bound on LLM
performance. As one of the largest language models, GPT-4 significantly
surpasses previous LLMs across modalities. Second, DeepSeek-Coder is selected
as the current SOTA open-source Code LLM. It represents the forefront of
publicly available models specifically tailored for coding tasks. While recent
academic works like BTC Hosseini and Dolan-Gavitt (2022) and Slade Armengol-
Estapé et al. (2023) showcase LLMs for decompilation, these models present
significant integration challenges, such as complex pre-processing settings,
non-standardized tokenizer/model loading, and necessitating significant effort
to modify and adapt them. We thus selected GPT-4 and DeepSeek-Coder as
representative cutting-edge and open-source baselines accessible for
evaluation.

Table 1: Evaluation Results on Decompile-Eval

Model Re-compilability Re-executability Opt-level O0 O1 O2 O3 Avg. O0 O1 O2 O3
Avg. GPT4 0.92 0.94 0.88 0.84 0.895 0.1341 0.1890 0.1524 0.0854 0.1402
DeepSeek-Coder-33B 0.0659 0.0866 0.1500 0.1463 0.1122 0.0000 0.0000 0.0000
0.0000 0.0000 LLM4Decompile-1b 0.8780 0.8732 0.8683 0.8378 0.8643 0.1573
0.0768 0.1000 0.0878 0.1055 LLM4Decompile-6b 0.8817 0.8951 0.8671 0.8476
0.8729 0.3000 0.1732 0.1988 0.1841 0.2140 LLM4Decompile-33b 0.8134 0.8195
0.8183 0.8305 0.8204 0.3049 0.1902 0.1817 0.1817 0.2146

Table 2: Evaluation Results on Anghabench.

model BLEU Edit Similarity Opt-level O0 O1 O2 O3 Avg. O0 O1 O2 O3 Avg.
DeepSeek-Coder-33B 0.0362 0.0367 0.0306 0.0313 0.0337 0.1186 0.1196 0.1124
0.1133 0.116 LLM4Decompile-1b 0.5099 0.493 0.487 0.4835 0.4934 0.6223 0.5946
0.5825 0.5822 0.5954 LLM4Decompile-6b 0.8219 0.8246 0.8143 0.8148 0.8189
0.8562 0.8551 0.8422 0.8453 0.8497 LLM4Decompile-33b 0.7724 0.7477 0.7485
0.7514 0.755 0.8252 0.7974 0.7993 0.8056 0.8069

Table 3: Ablation study on training methodology.

Model Re-compilability Re-executability Opt-level O0 O1 O2 O3 Avg. O0 O1 O2 O3
Avg. S2S 0.8817 0.8951 0.8671 0.8476 0.8729 0.3000 0.1732 0.1988 0.1841 0.2140
NTP 0.8329 0.8598 0.8317 0.8329 0.8393 0.2805 0.1390 0.1573 0.1341 0.1777
NTP+S2S 0.8963 0.8598 0.8963 0.8720 0.8811 0.3232 0.1463 0.1951 0.1707 0.2088

###  4.3 Implementation

We use the Python implementation of the DeepSeek-Coder models (1.3B, 6.7B, and
33B) obtained on Hugging Face Wolf et al. (2019). We set a global
$batch\>size=2048$ and $learning\;rate=2e{-}5$ and train the models with the
AdamW optimizer Loshchilov and Hutter (2019) for 2 epochs. During the
evaluation, we set the $max\\_new\\_tokens$ to 512. To ensure fairness in the
analysis of time and space complexity, all experiments are performed on a
cluster equipped with 8 NVIDIA A100-80GB GPUs.

##  5 Experiment Results

###  5.1 Main Results

Table 1 presents the primary findings of our study. Initially, the base
version of DeepSeek-Coder was unable to accurately decompile binaries. It
could generate code that seemed correct and was sometimes compilable but
failed to retain the original program semantics. After fine-tuning, the
LLM4Decompile models demonstrated a significant improvement in their ability
to decompile binaries, with an impressive around 90% of the code being
compilable, signifying a solid understanding of code structure and syntax. As
for the ability to execute the code, the 6B version of LLM4Decompile shows a
remarkable advantage over the 1B version, 21% of the decompiled codes from the
6B version successfully capture the semantics of a program and pass all the
test cases, while for the 1B version only 10% can be re-executed. The
improvement highlights the benefits of larger model sizes in capturing the
semantics of a program. Nonetheless, the increase in model size to 33B yields
only a marginal improvement, with an average increase of less than one
percentage point in re-executability. This plateau may be due to the challenge
of tuning the 33B model.

Table 2 summarizes the results on AnghaBench, where LLM4Decompile shows
notably high BLEU and ES scores, e.g., the 6B model achieves 0.82 BLEU scores,
almost identical to the source code. This outstanding performance suggests a
significant data leakage issue within the test set. Decompiled code, with its
variables normalized, should not realistically allow for such high N-gram/ES
scores. This anomaly underscores the importance of establishing an
independent, reliable benchmark for decompilation evaluation, as similarly
high BLEU and ES scores have been reported in prior research.

###  5.2 Ablations

As discussed in Section 3.2, our LLM4Decompile model adopts a sequence-to-
sequence (S2S) forecasting approach, which outperforms other training
techniques for several reasons. In this training methodology, the
input—specifically the assembly code is not included in the calculation of the
loss function. This allows the model to focus solely on generating accurate
output source code, enabling it to better understand the underlying patterns
and structures of the decompiled code. In contrast, integrating the assembly
code into the training process, as in the next token prediction (NTP) task,
encompasses both the input assembly code and the output source code, which can
decrease performance by around 4 points, as shown in Table 3. The complexity
of assembly code is another factor; being inherently complex and low-level, it
is harder for the model to learn meaningful patterns when assembly code is
included in the training process. By excluding the assembly code from the loss
calculation, the S2S approach enables the model to avoid this complexity and
concentrate on high-level source code patterns. Although an alternative
strategy involves an initial training step with both assembly and C code
followed by fine-tuning focused on the translation task (NTP+S2S), this
approach still doesn’t perform as well as the S2S.

##  6 Conclusions

We presented the first open-source decompilation-focused LLM and standardized
re-compilability/re-executability benchmark. Analyses on this diverse compiled
C code dataset revealed promising capabilities—our 6B LLM4Decompile achieved
87% re-compilability, indicating syntactic understanding, and 21% re-
executability, suggesting semantic preservation. As an initial exploration
into data-driven decompilation, our work establishes an open benchmark to
motivate future efforts. The public dataset, model, and analyses represent
encouraging first steps toward enhancing decompilation through novel
techniques.

##  7 Limitations

The scope of this research is limited to the compilation and decompilation of
C language targeting the x86 platform. While we are confident that the
methodologies developed here could be adapted to other programming languages
and platforms with relative ease, these potential extensions have been
reserved for future investigation. Additionally, our current study is
constrained to the decompilation of single functions, without taking into
account factors such as cross-references and external type definitions. This
presents a simplified view of the decompilation process, omitting the
complexities introduced by these elements. Addressing these aspects would
provide a more comprehensive understanding of decompilation across a broader
spectrum of scenarios and is an important avenue for subsequent research.

## References

  * Armengol-Estapé et al. (2023) Jordi Armengol-Estapé, Jackson Woodruff, Chris Cummins, and Michael F. P. O’Boyle. 2023.  Slade: A portable small language model decompiler for optimized assembler.  _CoRR_ , abs/2305.12520.
  * Brumley et al. (2013) David Brumley, JongHyup Lee, Edward J. Schwartz, and Maverick Woo. 2013.  Native x86 decompilation using semantics-preserving structural analysis and iterative control-flow structuring.  In _Proceedings of the 22th USENIX Security Symposium, Washington, DC, USA, August 14-16, 2013_ , pages 353–368. USENIX Association.
  * Chen et al. (2021) Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Pondé de Oliveira Pinto, Jared Kaplan, Harrison Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, Alex Ray, Raul Puri, Gretchen Krueger, Michael Petrov, Heidy Khlaaf, Girish Sastry, Pamela Mishkin, Brooke Chan, Scott Gray, Nick Ryder, Mikhail Pavlov, Alethea Power, Lukasz Kaiser, Mohammad Bavarian, Clemens Winter, Philippe Tillet, Felipe Petroski Such, Dave Cummings, Matthias Plappert, Fotios Chantzis, Elizabeth Barnes, Ariel Herbert-Voss, William Hebgen Guss, Alex Nichol, Alex Paino, Nikolas Tezak, Jie Tang, Igor Babuschkin, Suchir Balaji, Shantanu Jain, William Saunders, Christopher Hesse, Andrew N. Carr, Jan Leike, Joshua Achiam, Vedant Misra, Evan Morikawa, Alec Radford, Matthew Knight, Miles Brundage, Mira Murati, Katie Mayer, Peter Welinder, Bob McGrew, Dario Amodei, Sam McCandlish, Ilya Sutskever, and Wojciech Zaremba. 2021.  Evaluating large language models trained on code.  _CoRR_ , abs/2107.03374.
  * Collie et al. (2020) Bruce Collie, Jackson Woodruff, and Michael F. P. O’Boyle. 2020.  Modeling black-box components with probabilistic synthesis.  In _GPCE ’20: Proceedings of the 19th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences, Virtual Event, USA, November 16-17, 2020_ , pages 1–14. ACM.
  * da Silva et al. (2021) Anderson Faustino da Silva, Bruno Conde Kind, José Wesley de Souza Magalhães, Jerônimo Nunes Rocha, Breno Campos Ferreira Guimarães, and Fernando Magno Quintão Pereira. 2021.  ANGHABENCH: A suite with one million compilable C benchmarks for code-size reduction.  In _IEEE/ACM International Symposium on Code Generation and Optimization, CGO 2021, Seoul, South Korea, February 27 - March 3, 2021_ , pages 378–390. IEEE.
  * Ghidra (2024) Ghidra. 2024.  Ghidra software reverse engineering framework.
  * Guo et al. (2024) Daya Guo, Qihao Zhu, Dejian Yang, Zhenda Xie, Kai Dong, Wentao Zhang, Guanting Chen, Xiao Bi, Y Wu, YK Li, et al. 2024.  Deepseek-coder: When the large language model meets programming–the rise of code intelligence.  _arXiv preprint arXiv:2401.14196_.
  * Hex-Rays (2024) Hex-Rays. 2024.  Ida pro: a cross-platform multi-processor disassembler and debugger.
  * Hosseini and Dolan-Gavitt (2022) Iman Hosseini and Brendan Dolan-Gavitt. 2022.  Beyond the C: retargetable decompilation using neural machine translation.  _CoRR_ , abs/2212.08950.
  * Jiang et al. (2023) Nan Jiang, Chengxiao Wang, Kevin Liu, Xiangzhe Xu, Lin Tan, and Xiangyu Zhang. 2023.  Nova${}^{\mbox{+}}$: Generative language models for binaries.  _CoRR_ , abs/2311.13721.
  * Katz et al. (2018) Deborah S. Katz, Jason Ruchti, and Eric M. Schulte. 2018.  Using recurrent neural networks for decompilation.  In _25th International Conference on Software Analysis, Evolution and Reengineering, SANER 2018, Campobasso, Italy, March 20-23, 2018_ , pages 346–356. IEEE Computer Society.
  * Lacomis et al. (2019) Jeremy Lacomis, Pengcheng Yin, Edward J. Schwartz, Miltiadis Allamanis, Claire Le Goues, Graham Neubig, and Bogdan Vasilescu. 2019.  DIRE: A neural approach to decompiled identifier naming.  In _34th IEEE/ACM International Conference on Automated Software Engineering, ASE 2019, San Diego, CA, USA, November 11-15, 2019_ , pages 628–639. IEEE.
  * Le et al. (2014) Vu Le, Mehrdad Afshari, and Zhendong Su. 2014.  Compiler validation via equivalence modulo inputs.  In _ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’14, Edinburgh, United Kingdom - June 09 - 11, 2014_ , pages 216–226. ACM.
  * Lippincott (2020) Thomas Lippincott. 2020.  Starcoder: A general neural ensemble technique to support traditional scholarship, illustrated with a study of the post-atlantic slave trade.  In _15th Annual International Conference of the Alliance of Digital Humanities Organizations, DH 2020, Ottawa, Canada, July 20-25, 2020, Conference Abstracts_.
  * Liu and Wang (2020) Zhibo Liu and Shuai Wang. 2020.  How far we have come: testing decompilation correctness of C decompilers.  In _ISSTA ’20: 29th ACM SIGSOFT International Symposium on Software Testing and Analysis, Virtual Event, USA, July 18-22, 2020_ , pages 475–487. ACM.
  * Loshchilov and Hutter (2019) Ilya Loshchilov and Frank Hutter. 2019.  Decoupled weight decay regularization.  In _7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019_. OpenReview.net.
  * OpenAI (2023) OpenAI. 2023.  GPT-4 technical report.  _CoRR_ , abs/2303.08774.
  * Rozière et al. (2023) Baptiste Rozière, Jonas Gehring, Fabian Gloeckle, Sten Sootla, Itai Gat, Xiaoqing Ellen Tan, Yossi Adi, Jingyu Liu, Tal Remez, Jérémy Rapin, Artyom Kozhevnikov, Ivan Evtimov, Joanna Bitton, Manish Bhatt, Cristian Canton-Ferrer, Aaron Grattafiori, Wenhan Xiong, Alexandre Défossez, Jade Copet, Faisal Azhar, Hugo Touvron, Louis Martin, Nicolas Usunier, Thomas Scialom, and Gabriel Synnaeve. 2023.  Code llama: Open foundation models for code.  _CoRR_ , abs/2308.12950.
  * Ruder (2016) Sebastian Ruder. 2016.  An overview of gradient descent optimization algorithms.  _arXiv preprint arXiv:1609.04747_.
  * Stallman et al. (2003) Richard M Stallman et al. 2003.  Using the gnu compiler collection.  _Free Software Foundation_ , 4(02).
  * Tan et al. (2017) Shin Hwei Tan, Jooyong Yi, Yulis, Sergey Mechtaev, and Abhik Roychoudhury. 2017.  Codeflaws: a programming competition benchmark for evaluating automated program repair tools.  In _Proceedings of the 39th International Conference on Software Engineering, ICSE 2017, Buenos Aires, Argentina, May 20-28, 2017 - Companion Volume_ , pages 180–182. IEEE Computer Society.
  * Vaswani et al. (2017) Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017.  Attention is all you need.  In _Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA_ , pages 5998–6008.
  * Wei et al. (2007) Tao Wei, Jian Mao, Wei Zou, and Yu Chen. 2007.  A new algorithm for identifying loops in decompilation.  In _Static Analysis, 14th International Symposium, SAS 2007, Kongens Lyngby, Denmark, August 22-24, 2007, Proceedings_ , volume 4634 of _Lecture Notes in Computer Science_ , pages 170–183. Springer.
  * Wolf et al. (2019) Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, and Jamie Brew. 2019.  Huggingface’s transformers: State-of-the-art natural language processing.  _CoRR_ , abs/1910.03771.
  * Wong et al. (2023) Wai Kin Wong, Huaijin Wang, Zongjie Li, Zhibo Liu, Shuai Wang, Qiyi Tang, Sen Nie, and Shi Wu. 2023.  Refining decompiled C code with large language models.  _CoRR_ , abs/2310.06530.
  * Xu et al. (2022) Frank F. Xu, Uri Alon, Graham Neubig, and Vincent Josua Hellendoorn. 2022.  A systematic evaluation of large language models of code.  In _Proceedings of the 6th ACM SIGPLAN International Symposium on Machine Programming_ , MAPS 2022, page 1–10, New York, NY, USA. Association for Computing Machinery.
  * Xu et al. (2023) Xiangzhe Xu, Zhuo Zhang, Shiwei Feng, Yapeng Ye, Zian Su, Nan Jiang, Siyuan Cheng, Lin Tan, and Xiangyu Zhang. 2023.  Lmpa: Improving decompilation by synergy of large language model and program analysis.  _CoRR_ , abs/2306.02546.
  * Zeng et al. (2022) Zhengran Zeng, Hanzhuo Tan, Haotian Zhang, Jing Li, Yuqun Zhang, and Lingming Zhang. 2022.  An extensive study on pre-trained models for program understanding and generation.  In _ISSTA ’22: 31st ACM SIGSOFT International Symposium on Software Testing and Analysis, Virtual Event, South Korea, July 18 - 22, 2022_ , pages 39–51. ACM.


# Quantifying Self-diagnostic Atomic Knowledge in Chinese Medical Foundation
Model: A Computational Analysis

Yaxin Fan1,2,3, Feng Jiang2,3,4, Benyou Wang2,3, Peifeng Li1 Corresponding
author Haizhou Li2,3
1School of Computer Science and Technology, Soochow University, Suzhou, China
2School of Data Science, The Chinese University of Hong Kong, Shenzhen, China
3Shenzhen Research Institute of Big Data, Shenzhen, China
4 University of Science and Technology of China, Hefei, China
<EMAIL_ADDRESS>
<EMAIL_ADDRESS>
<EMAIL_ADDRESS>
###### Abstract

Foundation Models (FMs) have the potential to revolutionize the way users
self-diagnose through search engines by offering direct and efficient
suggestions. Recent studies primarily focused on the quality of FMs evaluated
by GPT-4 or their ability to pass medical exams, no studies have quantified
the extent of self-diagnostic atomic knowledge stored in FMs’ memory, which is
the basis of foundation models to provide factual and reliable suggestions. In
this paper, we first constructed a benchmark of Self-diagnostic Atomic
Knowledge (SdAK), including the most common types of atomic knowledge involved
in self-diagnostic queries, with 17 atomic types and a total of 14, 048 pieces
of atomic knowledge. Then, we evaluated both generic and open-source Chinese
medical FMs on the benchmark. The experimental results showcase that generic
FMs perform better than medical FMs in terms of self-diagnostic atomic
knowledge. Error analysis revealed that both generic and medical FMs are
sycophantic, e.g., always catering to users’ claims when it comes to unknown
knowledge. We further explored different types of data commonly adopted for
fine-tuning medical FMs, i.e., real-world, semi-distilled, and distilled data,
and found that distilled data can benefit FMs most. The code and data are
available at https://github.com/FreedomIntelligence/SDAK.

##  1 Introduction

In the digital age, seeking health-related information on the Internet for
self-diagnosis has become a common practice white2009experiences,
10.1093/jamia/ocz152, farnood2020mixed. The health-related information can
assist users in making necessary medical decisions, such as self-treatment or
going to the hospital for professional treatment. With the development of
generative models ouyang2022training, sun2021ernie, openai2023gpt4, Foundation
Models (FMs) hold the promise of revolutionizing the retrieval paradigm that
seeks health-related suggestions via a search engine because they can provide
more efficient suggestions.

Recently, more and more studies [wang2023huatuo, zhang2023huatuogpt,
zhu2023ChatMed, yang2023zhongjing] attempt to enhance the medical capabilities
of open-source FMs in Chinese by fine-tuning the data in the medical field. To
evaluate the medical abilities of FMs, most of previous work focused on the
quality of FMs evaluate by GPT-4 [zhang2023huatuogpt, yang2023zhongjing] or
the abilities to pass medical exams [umapathi2023medhalt, wang2023cmb].
However, the results evaluated by GPT-4 are not fair and transparent because
GPT-4 has problems with position bias [wang2023large] and limited knowledge in
the medical domain. Besides, passing an exam question requires FMs to
remember, recall, and reason about the knowledge [zheng2023does]. Even if FMs
give a wrong answer, it is unclear which part is responsible for it, making it
difficult to move forward with the development of FMs in medical domain.

Since memory is the basis of recalling and reasoning, some work
[min2023factscore, chern2023factool] pay more attention on the memorization
abilities of FMs and evaluate the factuality of the atomic knowledge contained
in the long-form contexts generated by FMs. Atomic knowledge is a fundamental
unit conveying a single piece of information [min2023factscore] and the
performance of FMs on atomic knowledge reflects their memorization ability.
Nevertheless, there are two drawbacks to applied the approach in the medical
domain. First, the method requires the use of GPT-4 to break a long-form
contents into a series of atomic knowledge, but the limited medical capability
of GPT-4 hinders its application in the medical field. Second, responses to a
same query from different FMs may contain different atomic knowledge, leading
it difficult to fairly compare the extent of self-diagnostic atomic knowledge
in memory across open-source Chinese FMs.

To address above limitations, we construct a benchmark of Self-diagnostic
Atomic Knowledge (SdAK) manually, which not only get rid of the reliance on
GPT-4 but also can fairly compare the memorization abilities of Chinese
medical FMs. The benchmark includes the most common types of atomic knowledge
involved in the self-diagnostic queries of the real world, with 17 atomic
types and a total of 14, 048 pieces of atomic knowledge. Each piece of atomic
knowledge consists of the factual and non-factual claims in the form of
implication and non-implication relation, respectively. FMs are considered to
memory the atomic knowledge only if it both supports the factual claim and
refute the non-factual claim.

Then, we evaluate the generic and Chinese medical FMs on the benchmark to
explore the extent of self-diagnostic atomic knowledge stored in the memory of
FMs. We observed that generic FMs perform better than medical FMs in terms of
atomic knowledge and instruction-following ability. Error analysis showcased
that both generic and medical FMs are sycophantic, e.g., always catering to
user’s claims. Besides, generic FMs show the stronger safety by providing a
more rigorous explanation of atomic knowledge, which can be learned by medical
FMs through distilled data.

In addition, we analyze the performance of FMs on different types of atomic
knowledge and find that generic FMs perform well for atomic types involved in
medical common sense and poor for some more professional atomic types, While
the medical FMs perform poorly than generic FMs in both general and
specialized medical knowledge. This indicates that a lot of attention to open-
source Chinese medical FMs still needs to be paid.

Finally, we further explored the effect of different types of data commonly
adopted for supervised fine-tuning by open-source Chinese medical FMs, i.e.,
real-world, semi-distilled, and distilled data. The experimental results
showcased that the distilled data contributes the most in terms of atomic
knowledge and instruction-following capabilities, while real-world data
contributes the least. This shed light on the direction to enhance the medical
abilities of open-source FMs.

##  2 Related Work

We first introduce the open-source Chinese medical FMs, then introduce the
commonly adopted evaluation method in medical field, and finally introduce the
related work of fact-checking.

###  2.1 Chinese Medical FMs

To enhance the medical capability of open-source FMs [du2022glm,
scao2022bloom, touvron2023llama1, touvron2023llama2, baichuan2023baichuan2],
recent work commonly fine-tune the FMs by adopting the doctor-patient
conversations, which are divided into three types according to the source of
doctor and patient. The first data type is Real-world that both doctor and
patient are from the real world. These work[xiong2023doctorglm,
chen2023bianque1, MedicalGPT, wang2023huatuo, wang2023med] collected the data
from the public resource and fine-tune the various types of FMs. The second
type is Semi-distilled that the doctor is played by the advanced FMs (ChatGPT
or GPT-4) and the patient are from the real world. These work [zhu2023ChatMed,
yang2023zhongjing] collected the queries of patient from the Internet and fed
the queries to advanced FMs to obtain answers. The last is Distilled that both
the doctor and patient are played by ChatGPT or GPT-4. zhang2023huatuogpt
proposed _HuatuoGPT_ by leveraging both distilled and real-world data to fine-
tune Baichuan [baichuan2023baichuan2].

Figure 1: Benchmark construction of self-diagnostic atomic knowledge.

###  2.2 Medical Evaluation Methods

Early efforts to evaluate the medical abilities of FMs focus on the case
studies[MedicalGPT, xiong2023doctorglm, chen2023bianque1, zhu2023ChatMed] or
manual analysis[wang2023huatuo]. However, case studies can hardly measure the
medical capability of FMs fairly and manual evaluation faces the problem of
high cost. Then, some work utilized GPT-4 to evaluate medical FMs from
multiple perspectives, such as politeness, professional ability, safety, etc.
Whereas, the limited medical capability of GPT-4 is still a concern. Recently,
some studies[wang2023cmb] have paid attention to the ability of FMs to pass
medical exams. Nevertheless, passing a medical question requires the ability
of FMs to memorize, recall, and reason the knowledge [zheng2023does]. The
opacity of failures to medical questions hinders the development of open-
source FMs in the medical domain. Since memory is the basis of recalling and
reasoning, we construct a benchmark of self-diagnostic atomic knowledge
manually in this paper, which not only get rid of the reliance on GPT-4 but
also can fairly compare the memorization abilities of open-source Chinese
medical FMs.

###  2.3 Fact-checking

The fact-checking task [thorne-etal-2018-fever, 10.1162/tacl_a_00454] aims to
determine whether the claims are supported by the evidence provided, which has
been an active area of research in NLP. Previous work mainly focuses on the
domain of society[thorne-etal-2018-fever], politics[hanselowski2019richly],
online rumors[augenstein-etal-2019-multifc], healthcare[wadden-etal-2020-fact,
saakyan-etal-2021-covid, sarrouti-etal-2021-evidence-based, mohr-
etal-2022-covert], etc. Recently, some researchers [liu-etal-2023-revisiting,
min2023factscore] have paid attention to the factuality evaluation of fine-
grained atomic knowledge that conveys a single piece of information.
min2023factscore introduced FACTSCORE to conduct the atomic evaluation by
breaking a generation into a series of atomic claims. chern2023factool propose
FACTOOL for atomic evaluation. It utilized GPT-4 to evaluate the factuality of
atomic claims based on evidence retrieved by a search engine. In this paper,
we adopted the task form of fact-checking to explore the extent of self-
diagnostic atomic knowledge in FMs’ memory. The difference is that we do not
provide evidence and FMs need to evaluate the factuality of atomic claims
according to the atomic knowledge memorized by them.

##  3 Construction of Self-diagnostic Atomic Knowledge Benchmark

To explore the extent of atomic knowledge for self-diagnosis stored in open-
source Chinese medical FMs, we first constructed a benchmark, which contains
the most common types of atomic knowledge involved in users’ queries for self-
diagnosis. Figure 1 shows the process of benchmark construction. We first
conducted the thematic analysis on self-diagnostic queries to identify the
most common types of atomic knowledge. Then, the factual and non-factual
claims for each atomic type are constructed. Finally, the manual evaluation is
conducted to ensure the reliability of the atomic knowledge.

###  3.1 Types of Atomic Knowledge

Since it is impossible to consider all of the self-diagnostic atomic knowledge
in the world, we mainly focus on the most common types of atomic knowledge
involved in self-diagnostic queries. To obtain the most common atomic types,
we conducted a manual analysis of the KUAKE-QIC [zhang-etal-2022-cblue]
dataset focusing on the intent classification of self-diagnostic queries that
via a search engine, including 10 types of intents. Examples are shown in
Table 6 in Appendix A.

For each intent of the queries, we conducted thematic analysis
[braun2012thematic] of 200 samples randomly selected to identify the types of
atomic knowledge. Thematic analysis[braun2012thematic, zheng2023does] is a
manual method to identify themes within data by inductive-then-deductive
method. We first conduct the induction by initiating the preliminary type of
atomic knowledge for each selected sample, where we mainly focus on medical-
related knowledge, specializing in ’Disease-Symptom’, ’Medicine-Effect’, etc.
Then, we deduce the most common type of atomic knowledge by aggregating the
type into a broader atomic type if more samples fall into this type. Take the
query with _Diagnosis_ intent in Figure 1 as an example. We can see that both
’ _breast pain_ ’ and ’ _breast cancer_ ’ in this query are symptoms and
disease, respectively. Thus, the atomic type involved in this query is
’Disease-Symptom’. Table 1 shows the atomic types and percentages contained in
the queries with various intents. We can find that over 80% of queries of each
intent fall into different atomic types we deduced, indicating that atomic
knowledge is a more fine-grained fundamental unit. Besides, the queries with
different intents tend to involve the same type of atomic knowledge, e.g.,
queries with both ’ _Diagnosis_ ’ and ’ _Cause_ ’ intents involve the same
atomic type of ’Disease-Symptom’, which demonstrates the necessity and
efficiency of evaluating FMs in terms of atomic knowledge.

It is worth noting that we discard the intent type ’ _Price_ ’ because it is
always about the cost of treatment, which is hard to quantify. In addition, we
also dropped the atomic type ’ _Disease-Hospital_ ’ in intent type ’ _Advice_
’, which is always related to the recommended hospitals in different
locations. Consequently, we explored the 17 most common types of atomic
knowledge from real-world self-diagnostic queries, as shown in Table 1.

Intent | Atomic Type | Percentage
---|---|---
Diagnosis | Disease-Symptom | 81%
Disease-Examination | 10%
Cause | Disease-Cause | 64%
Disease-Symptom | 25%
Method | Disease-Medicine | 55%
Disease-Method | 34%
Advice | Disease-Hospital | 80%
Disease-Department | 8%
Disease-Examination | 11%
Metric_explain | Examination-Range | 63%
Metric-Effect | 37%
Disease_express | Disease-Symptom | 62%
Disease-Infectivity | 15%
Diseases-Complication | 15%
Result | Disease-Symptom | 36%
Western Medicine-SideEffect | 14%
Chinese Medicine-SideEffect | 19%
Food-Effect | 17%
Attention | Disease-Food | 59%
Disease-Prevention | 21%
Effect | Western Medicine-Effect | 20%
Chinese Medicine-Effect | 27%
Food-Effect | 44%
| Price
---
Treatment-Price | 97%
Table 1:  Types and percentages of atomic knowledge contained in each intent
of self-diagnostic queries.

###  3.2 Construction of Atomic Claims

After obtaining the most common types of self-diagnostic atomic knowledge, we
construct atomic claims that convey a single piece of atomic knowledge for
each atomic type. While some Chinese medical knowledge graphs, e.g.,
CMeKG[Odmaa2019], are direct sources to access atomic knowledge, data
contamination is a problem that can not be ignored because some Chinese
medical FMs, e.g., BenTsao[wang2023huatuo] and ChatGLM-Med[wang2023med], have
already incorporated the data of knowledge graph to empower the medical
abilities of open-source FMs.

Atomic Type | Example of factual(Non-factual) atomic claim | Number
---|---|---
Metric-Effect |  | Anti-endothelial antibody tests can (not) be used in vasculitis.
---
抗内皮细胞抗体检查（不）可用于血管炎患者。
840
Disease-Infectivity |  | Laryngeal cysts are (not) contagious
---
喉囊肿（不）具有传染性
1000
Disease-Department |  | Common departments for Psoriatic A (do not) include dermatology
---
银屑病甲常挂的科室（不）包括皮肤科
1000
Disease-Method |  | Common treatments for prolactinomas (do not) include radiation therapy
---
催乳素瘤常见治疗方法（不）包括放射治疗
1000
Disease-Cause |  | Possible cause of viral enteritis (do not) include norovirus
---
病毒性肠炎的病因（不）包括诺瓦克病毒
1000
Chinese Medicine-Effect |  | The effect of ginseng antler Guben tablet (do not) includes invigorating qi and nourishing blood
---
参茸固本片（不）具有补气养血的功效
500
Chinese Medicine-SideEffect |  | Adverse reactions to Jianpi pills (do not) include vomiting
---
健脾丸的不良反应（不）包括呕吐
500
Western Medicine-Effect |  | Ergoline can (not) be used to suppress lactation 麦角林（不）可用于抑制乳汁分泌
---
500
Food-Effect |  | Pureed carrots (do not) have antidiarrheal effect
---
胡萝卜泥（不）具有止泻作用
815
Western Medicine-SideEffect |  | Adverse reactions to triethanolamine cream (do not) include allergies
---
三乙醇胺乳膏的不良反应（不）包括过敏
500
Disease-Examination |  | Common medical tests for sweat rash (do not) include fungal blood tests
---
汗疹常做的检查项目（不）包括真菌血检查
1000
Disease-Prevention |  | Preventive methods for malaria infection (do not ) include malaria vaccines
---
预防疟疾感染的方法（不）包括疟疾疫苗
785
Diseases-Complication |  | Complications of acute epiglottitis (do not) include shock
---
急性会厌炎可能引发的疾病（不）包括休克
1000
Disease-Symptom |  | Common symptoms of tail pancreatic cancer (do not) include abdominal pain
---
胰尾癌的常见症状（不）包括腹痛
1000
Examination-Range |  | The normal (abnormal) reference interval of bone marrow granulored ratio is usually 1.5:1 to 3.5:1
---
骨髓粒红比例的正常（异常）参考区间通常是1.5：1～3.5：1
608
Disease-Food |  | Calcium-rich foods are (not) recommended for periodontal atrophy
---
牙周萎缩宜(忌)吃钙质丰富的食物
1000
Disease-Medicine |  | Common medications for stomatitis (do not) include metformin
---
口腔炎的常用药物包括（不包括）甲氰咪胍
1000
Table 2: Example and number of each type of atomic knowledge.

Hence, to quantify the extent of self-diagnostic atomic knowledge stored in
the memory of open-source Chinese medical FMs fairly, we access the structured
medical content from the public medical
websites111https://www.xiaohe.cn/medical 222https://www.120ask.com/disease. On
one hand, the medical content is reliable because it is edited and verified by
professional medical teams. On the other hand, these websites are also the
main source of health-related information for self-diagnostic queries.

As shown in Figure 1, we extract the atomic knowledge for each disease-related
atomic type from the structured disease content. For example, we extract the
disease _Pancreatic tail cancer (胰尾癌)_ and symptom _abdominal pain (腹痛)_ for
the ’Disease-Symptom’ atomic type. Then, we heuristically at most 1000 factual
claims for each atomic type in the form of implication relation, each claim
conveys a single piece of atomic knowledge, as shown in Table 2. Similarly, we
adopted the same method to construct the factual claims for
examination/medicine-related atomic types.

Given that FMs may exhibit a sycophantic bias [wei2023simple, du2023calla],
e.g., it always supports the user’s claims, it is not reliable for FMs to
judge whether factual claims are correct. To avoid this bias, we construct a
non-factual atomic claim for each factual atomic claim by converting the
’implication’ into a ’non-implication’ relation, as shown in Table 2. It is
worth noting that FMs are considered to possess one piece of atomic knowledge
only if they both support the factual claim and refute the non-factual claim.

Atomic Type | Number
---|---
Support | Neural | Refute
Metric-Effect | 43 | 6 | 1
Disease-Infectivity | 42 | 5 | 3
Disease-Department | 48 | 0 | 2
Disease-Method | 45 | 5 | 0
Disease-Cause | 46 | 4 | 0
Chinese Medicine-Effect | 48 | 1 | 1
Chinese Medicine-SideEffect | 46 | 1 | 3
Western Medicine-Effect | 50 | 0 | 0
Western Medicine-SideEffect | 44 | 3 | 3
Food-Effect | 43 | 5 | 2
Disease-Examination | 45 | 0 | 5
Disease-Prevention | 33 | 11 | 6
Diseases-Complication | 42 | 7 | 1
Disease-Symptom | 48 | 2 | 0
Examination-Range | 32 | 12 | 6
Disease-Food | 47 | 3 | 0
Disease-Medicine | 46 | 1 | 3
Total | 748 | 66 | 36
Percentage | 88.00% | 7.76% | 4.24%
Table 3: Human evaluation of atomic claims.

###  3.3 Human Evaluation of Atomic Claim

To verify the reliability of the atomic claims, we conducted a manual
evaluation based on the evidence retrieved through a search engine. We first
randomly selected 50 factual claims for each atomic type. Then, we follow the
previous work [chern2023factool] and retrieve evidence by feeding factual
claims into a search engine333The search engine we adopted is Baidu, which is
the most popular Chinese search engine.. Finally, We keep the top 10 items
retrieved by a search engine as evidence and manually judge whether the
evidence supports the factual claims.

Table 3 shows the results of human evaluation, where _Support_ , _Neural_ ,
and _Refute_ indicate that evidence supports claims, insufficient evidence,
and evidence refutes claims, respectively. We can observe that 88% of claims
can be fully supported by the evidence and only 4% are refuted, which shows
the reliability of the atomic claims we constructed. In addition, the
reliability of about 8% of factual claims can not verified due to insufficient
evidence. We attribute it to the fact that these pieces of atomic knowledge
are relatively low-frequency, leading to search engines failing to retrieve
the related evidence. Overall, the atomic claims we constructed are reliable
in quantifying the extent of self-diagnostic atomic knowledge in the memory of
open-source Chinese medical FMs.

##  4 Experiments

In this section, we first introduce the foundation models for evaluation, and
then provide the details of experimental settings, including the prompt,
hyper-parameters, and metrics. Finally, we present the experimental results.

Figure 2:  Process of evaluation.

###  4.1 Foundation Models for Evaluation

There are two types of FMs used for evaluation: generic FMs and open-source
Chinese medical FMs. The generic FMs mainly include closed-source models,
i.e., ChatGPT and GPT-4 [openai2023gpt4] and open-source Chinese FMs, i.e.,
ChatGLM-2 [du2022glm], Baichuan2-7/13b-Chat [baichuan2023baichuan2], and
Qwen-7/14b-Chat [bai2023qwen]. The open-source Chinese medical FMs are
categorized by the type of data used for fine-tuning, i.e., Real-world:
BenTsao [wang2023huatuo], ChatGLM-Med [wang2023med], DoctorGLM
[xiong2023doctorglm], MedicalGPT[MedicalGPT], and Bianque [chen2023bianque1],
Semi-distilled: Chatmed-Consult [zhu2023ChatMed], Semi-distilled & Real-world:
Zhongjing [yang2023zhongjing], and Distilled & Real-world: HuatuoGPT
[zhang2023huatuogpt].

###  4.2 Experimental Settings

####  4.2.1 Evaluation Prompt

To evaluate the performance of FMs on the self-diagnostic atomic knowledge
benchmark, we designed an appropriate prompt to instruct FMs to output as we
specified. Since our goal is to explore the extent of self-diagnostic atomic
knowledge stored in FMs’ memory, we do not explore the prompt engineering in
depth but designed a prompt that is easy to understand for FMs. The prompt is
as follows: If the following claim is correct, please reply ”correct” first,
and then give the reason. If no, please reply ”incorrect” first, then give the
reason. (下列说法是否正确，如果正确，请先回复”正确”，然后给出原因。如果错误，请先回复“错误”，然后给出原因。) The prompt
specifies two parts of the output: the answer and the reason. The answer
directly gives whether the claim is supported or not and the reason provides
the evidence of answers given by FMs. We concatenated the prompt and atomic
claims and fed them into FMs for experiments. In our preliminary study, we
explored the performance of ChatGPT with different prompts and the results
showed no significant difference. The details are shown in Appendix B. Hence,
we used the prompt we designed above for all experiments.

Domain | Data Type | FMs | FR(%) | Acc(%) | AnsR(%)
---|---|---|---|---|---
Generic | - | GPT-4 | 99.96(0.00) | 65.42(0.60) | 100
Qwen-14b-Chat | 100(0.00) | 57.29(0.03) | 98
ChatGPT | 99.97 (0.00) | 51.72(0.40) | 97
Qwen-7b-Chat | 100 (0.00) | 43.68(0.10) | 98
Baichuan2-13b-Chat | 99.71(0.00) | 42.01(0.05) | 96
ChatGLM2 | 99.84(0.01) | 37.90(0.04) | 97
Baichuan2-7b-Chat | 99.89(0.01) | 16.14(0.09) | 95
Specialized | Semi-distilled&Real | Zhongjing | 90.22(0.17) | 24.78(0.10) | 97
Semi-distilled | Chatmed-Consult | 85.10(0.14) | 24.50(0.34) | 98
Distilled&Real | HuatuoGPT | 99.73(0.00) | 16.15(0.01) | 98
Real | MedicalGPT | 76.04(0.50) | 7.86(0.50) | 100
ChatGLM-Med | 94.91(0.07) | 7.46(0.15) | 75
BentSao | 84.43(0.06) | 3.35(0.07) | 70
Bianque | 0 | - | -
DoctorGLM | 0 | - | -
Table 4: Performance of generic and specialized FMs on self-diagnostic atomic
knowledge. No more statistics were conducted for Bianque and DoctorGLM because
they can hardly follow instructions (FR=0).

####  4.2.2 Evaluation Metrics

To evaluate the performance of FMs on self-diagnostic atomic knowledge, we
adopted three cascaded metrics, including the Following Rate (FR), Accuracy
(Acc), and Answer Reliability (AccR). The evaluation process is shown in
Figure 2.

Following Rate (FR) evaluates the abilities of FMs to follow instructions. For
a piece of atomic knowledge, FMs are considered to follow the instruction if
FMs can give the answers (correct or incorrect) to factual and non-factual
atomic claims at the beginning of the response. Accuracy (Acc) measures the
abilities of FMs on self-diagnostic atomic knowledge. FMs are considered to
have a piece of atomic knowledge if it gives the answer _’correct’_ to the
factual claim and _’incorrect’_ to the non-factual claim. Answer Reliability
(AnsR) assesses the reliability of FMs’ answers. Specifically, we randomly
selected 100 pieces of atomic knowledge possessed by FMs according to their
answers for manual analysis. If the reason given by FMs can support the answer
’ _correct_ ’ to a factual claim, and the answer ’ _incorrect_ ’ to a non-
factual claim, we believe that the answers given by FMs are reliable.

####  4.2.3 Hyper-parameters

For ChatGPT and GPT-4, we adopted the _GPT-3.5-turbo-0301_ and _GPT-4-0314_
version, respectively, and the generation settings are set by default. For
other open-source generic FMs and medical FMs, we adopted the same generation
settings as Baichuan2 [baichuan2023baichuan2] for a fair comparison. The
temperature, top_k, top_p, and repetition_penalty are set to 0.3, 5, 0.85, and
1.05, respectively, and other parameters are set by default. All experiments
for each LLM are conducted two times, and we report the mean and standard
deviation values.

###  4.3 Experimental Results

Table 4 showcased the performance of various FMs on SdAK benchmark and we have
several findings.

Firstly, generic FMs perform better than specialized LLMs on the capability of
instruction following. We can observe that the _following rate_ of generic FMs
is almost close to 100%, while the performance of specialized FMs varies, some
FMs, e.g., Bianque, DoctorGLM, can hardly follow instructions. This reveals
that open-source Chinese medical FMs still have a lot of room for improvement
in terms of instruction following.

Secondly, almost all generic FMs outperform specialized FMs in terms of atomic
knowledge. Among them, GPT-4 unsurprisingly achieved the best performance of
65.42% in the _accuracy_ metric. Among the open-source Chinese generic FMs,
Qwen-14b-Chat performs the best performance of 57.29%, even surpassing ChatGPT
by 5.57%. Besides, as the model size increases, more knowledge can be
memorized by foundation models. We can find that the performance of Qwen on
the SdAK benchmark increases $57.29-43.68=13.61\%$ in the Accuracy metric when
the model size increases from 7 billion to 14 billion. The same phenomenon can
be found in Baichuan. This suggests that increasing the model size is still an
optional solution to empower the medical capability of FMs. However, the best
performance of open-source Chinese medical FMs in the Accuracy metric only
reaches about 25%. This suggests that the open-source Chinese medical FMs do
not well memorize self-diagnostic atomic knowledge and more effort still needs
to be invested.

Thirdly, specialized FMs that adopted distilled or semi-distilled data for
fine-tuning generally perform better on the SdAK benchmark than that used
real-world data in the Accuracy metric. This indicates that open-source FMs
can learn the medical capabilities from advanced generic FMs, e.g., GPT-4 and
ChatGPT, by distilled/semi-distilled data, which is an option worth
considering to enhance the medical capabilities of open-source Chinese FMs.

Domain | FMs | Error Type
---|---|---
NotFollow | Sycophancy | Safety | Misinterpretation
Generic | GPT4 | 0 | 68 | 26 | 6
Qwen-14b-Chat | 0 | 68 | 24 | 8
ChatGPT | 0 | 79 | 17 | 4
Qwen-7b-Chat | 0 | 74 | 20 | 6
Baichuan2-13b-Chat | 0 | 72 | 24 | 4
| ChatGLM2-6b | 0 | 70 | 25 | 5
| Baichuan2-7b-Chat | 0 | 74 | 21 | 5
Specialized | Chatmed-Consult | 20 | 48 | 18 | 14
Zhongjing | 8 | 62 | 18 | 12
HuatuoGPT | 0 | 64 | 22 | 14
MedicalGPT | 23 | 62 | 2 | 13
ChatGLM-med | 5 | 54 | 1 | 40
BenTsao | 5 | 90 | 5 | 0
Table 5: Error analysis of FMs on atomic knowledge.

Finally, the answers given by most FMs to factual and non-factual claims are
reliable. Since the very small standard deviation of the two experiments, we
conducted a manual analysis of the first experimental results. We can observe
that almost all FMs achieve a performance of more than 95% in _answer
reliability_ metric, demonstrating the reliability of the answers given by
FMs. This also reveals the reliability of _accuracy_ metric.

##  5 Analysis

In this section, we first conduct the error analysis of FMs on atomic
knowledge. Then, we explore the performance of FMs on various types of atomic
knowledge. Finally, we study the impact of different types of data for
supervised fine-tuning on FMs.

###  5.1 Error Analysis of FMs on Atomic Knowledge

To analyze the error types of FMs on SdAK, we first randomly select 100 pieces
of atomic knowledge not memorized by FMs from the first experimental results.
Then, we conducted a thematic analysis of the responses to the factual and
non-factual claims. The errors can be divided into four types: NotFollow: FMs
do not directly provided the answer(’correct’ or ’incorrect’) to the claims.
Sycophancy: FMs support both factual and non-factual claims. Safety: FMs argue
that claims are not strictly expressed and provide a more rigorous
explanation. Misinterpretation: FMs misinterpret a non-factual claim as a
factual claim. Appendix C shows the examples of each type.

Table 5 shows the results of manual analysis. We can see that generic FMs do
not make _NotFollow_ errors due to the strong ability of instruction-
following. While most specialized FMs make _NotFollow_ errors because of the
degradation in instruction-following ability. In addition, the most common
type of error is Sycophancy for both generic and specialized FMs. This
suggests that FMs tend to support the users’ claims when in the face of
unknown self-diagnostic atomic knowledge, showing their characteristic of
friendliness. Furthermore, generic FMs always exhibit stronger safety than
specialized FMs by providing a more rigorous explanation of atomic claims.
Notably, the FMs adopting semi-distilled/distilled data, i.e., Chatmed-
Consult, Zhongjing, HuatuoGPT, also show better safety than FMs using real-
world doctor-patient conversations, i.e., MedicalGPT, ChatGLM-med, BenTsao,
indicating that the safety of advanced FMs can be learned by the type of
distilled data. Finally, the specialized FMs make more _Misinterpretation_
errors than the generic FMs, indicating that the understanding ability of the
specialized FMs still needs to be further improved.

###  5.2 Performance of FMs on Various Types of Atomic Knowledge

To explore the performance of different FMs on various types of atomic
knowledge, we plotted the radar map, as shown in Figure 3. We can observe that
GPT-4 performs well for some atomic types involved in medical common sense
(right half part in Figure 3), achieving about 90% in the Accuracy metric.
However, the performance of some more professional atomic types (upper left
part in Figure 3), such as treatment of disease, traditional Chinese medicine
diet, etc., is poor, which indicates that GPT-4 is still insufficient in
medical professionalism. In addition, specialized FMs perform variably and are
poorer than GPT-4 in each atomic type. It is worth noting that the specialized
FMs in the figure are fine-tuned using distilled data from advanced FMs, e.g.,
ChatGPT or GPT-4, which makes it difficult for specialized FMs to surpass the
advanced FMs in each atomic type.

Figure 3:  Performance of FMs on various types of atomic knowledge.

###  5.3 Effect of Different Types of Data on Specialized FMs

To further explore the effect of different types of data on the atomic
knowledge of specialized FMs, we fine-tune the distilled, simi-distilled and
real-world data on the same backbone Baichuan-7b-base. Specifically, The real-
world and distilled data are from HuatuoGPTzhang2023huatuogpt, with 69768 and
61400 single-turn conversations, respectively. The semi-distilled data are
from Chatmed-Consult [zhu2023ChatMed], with 549326 single-turn conversations.
Following the previous work of zhang2023huatuogpt, we add 48818 general
single-turn conversations for each experiment to prevent knowledge forgetting.
We adopt the ZeRO strategy to distribute the model across 4 A100 GPUs for
training. The epoch, learning rate, batch_size, and maximum context length are
set to 2, $5e-5$, 128, 64, and 2048, respectively. The model saved in the
second epoch is used for inference.

Figure LABEL:different_accuracy shows the performance of the FMs with
different types and amounts of data. We can observed that without the
introduction of medical data, the instruction-following performance of FMs is
98.94%, indicating that the generic data can empower FMs with well
instruction-following abilities.

As the amount of data increases, all three types of data affect the
instruction-following ability of FMs, and the real-world data has the most
negative effect. This may be due to the fact that dialogue in the real world
is an equal dialogue between people, and it is rare for one party to give
instructions to the other. Therefore, the learned instruction-following
ability of the model from this type of data is not as high as for human-
machine dialogue.

Besides, real-world data contributes the least to the atomic knowledge of FMs.
This may be due to the fact that there is less medical knowledge in real-world
doctor-patient conversations, as the doctor’s are more concerned with
diagnosis rather than introduce medical knowledge to patients. Thus, how to
leverage the real-world data is a problem worth pondering.

In addition, semi-distilled data with 20k contributes the most to the LLM with
a performance of 39.29%, even surpassing the Chatmed-Consult with 549k data
(Table 4) by 39.29-24.50=14.79%. However, more semi-distilled data could lead
to performance degradation. This may be due to the introduction of more low-
quality queries in semi-supervised data.

Furthermore, distilled data contributes the most to FMs on self-diagnostic
atomic knowledge. With the amount of distilled data increases, the performance
of FMs on atomic knowledge continue to benefit. This is because both doctors
and patients of distilled data are played by advance FMs, which is able to
have a conversation involving rich medical knowledge, thus better stimulating
the atomic knowledge of FMs. Therefore, it is expected to continue to improve
the atomic knowledge of FMs with more introduction of distilled data.

##  6 Conclusion

In this paper, we designed a Self-Diagnostic Atomic Knowledge (SDAK) benchmark
to quantitatively explore the extent of atomic knowledge stored in the memory
of open-source Chinese Medical foundation models. The benchmark contains 17
atomic types and a total of 14048 pieces of atomic knowledge. we evaluated
both generic and specialized FMs and observed that generic FMs perform better
than specialized FMs in terms of atomic knowledge and instruction-following
ability. In-depth analysis revealed that both generic and specialized FMs are
sycophantic and generic FMs showed stronger safety that can be learned by
specialized FMs through distilled data. Finally, we explored different types
of data commonly adopted by specialized FMs, e.g. distilled, semi-distilled,
and real-world data. The experimental result showcased that distilled data can
benefit specialized FMs most and real data contributes the least. We hope that
the benchmark we constructed and some of our findings will contribute to the
development of Chinese medical FMs.

## Acknowledgements

##  Appendix A Examples of Different Types of Query

Table 6 show the queries with various intents.

Intent | Query | Atomic Type
---|---|---
Diagnosis |  | Is breast pain a symptom of breast cancer?
---
乳房疼痛是不是乳腺癌？
Disease-Symptom
| Is the high neutrophil of blood image classification cell bacterial
infection？
---
血象分类细胞的中性白细胞偏高是细菌感染吗？
Disease-Examination
Cause |  | What is the cause of pancreatic cancer?
---
胰腺癌的原因是什么？
Disease-Cause
Method |  | What is the best medicine for high blood pressure?
---
高血压吃什么药好？
Disease-Medicine
| What is the treatment for osteochondritis dissecans of the knee?
---
膝盖骨膜炎的治疗办法是什么？
Disease-Method
Advice |  | Where is the best hospital of treating rectal cancer in Anhui Province?
---
安徽最好的治直肠癌医院在哪里？
Disease-Hospital
| What section does mouth herpes hang?
---
口腔疱疹挂什么科？
Disease-Department
Metric_explain |  | How much H. pylori is considered excessive?
---
幽门螺杆菌多少算超标？
Examination-Range
| What does a urine test for red blood cells mean?
---
尿检红细胞是什么意思？
Metric-Effect
Diseases_express |  | Is hemorrhagic fever contagious?
---
出血热传染吗？
Disease-Infectivity
| Can cervical infection with hpv virus cause low fever?
---
宫颈感染hpv病毒能引起低热吗？
Disease-Complication
Result |  | Does taking tenofovir cause high blood pressure?
---
服用替诺福韦会引起高血压吗？
Western Medicine-SideEffect
| Does taking Jinkui kidney Qi pill have adverse reaction?
---
服用金匮肾气丸有不良反应吗？
Chinese Medicine-SideEffect
| What is the effect of glutinous rice balls with wine lees?
---
酒糟汤圆的功效是什么？
Food-Effect
Attention |  | Can I eat lotus root if I have hyponatremia?
---
低钠血症患者能吃莲藕吗？
Disease-Food
| How to prevent psoriasis?
---
怎么预防牛皮癣？
Disease-Prevention
Effect |  | What do furosemide tablets do?
---
呋塞米片的作用是什么？
Western Medicine-Effect
| What are the effects of Angong Niuhuang Pills?
---
安宫牛黄丸的功效与作用是什么？
Chinese Medicine-Effect
Price |  | How much is the hernia surgery?
---
疝气手术多少钱?
Disease-Price
| How much is hysteroscopy examination?
---
宫腔镜检查多少钱？
Examination-Price
Table 6: Self-diagnostic queries with different intents.

##  Appendix B Performance of ChatGPT with Different Prompts

Although we did not conduct prompt engineering in depth, we did study the
effect of simple prompts that provide the same instruction on ChatGPT’s
performance of self-diagnostic atomic knowledge, as shown in Figure 5. The
detail of prompt1 is shown in Section 4.2.1 and the prompt2 is as follows: If
the following statements about medical knowledge are correct, please first
output ”correct” or ”incorrect” and then give the corresponding reasons on a
separate line.(_下列关于医学知识的说法是否正确，请先输出“正确”或“错误”，然后另起一行给出相应的原因。_). From Figure 5,
we can see that there is no significant performance difference between prompt1
and prompt2 on various types of atomic knowledge. This indicates that FMs are
not sensitive to simple prompts that provide the same instruction.

Figure 5:  Accuracy of ChatGPT on various types of atomic knowledge with
different prompts.

##  Appendix C Error Types of FMs on Atomic Knowledge

Examples of each error type are shown in Table 8\- 7. Table 7 shows the
example of the NotFollow error type in that FMs do not follow the instructions
we specify to give the correct or incorrect answer at the beginning of the
response. For the type of Sycophancy, the responses provided by FMs always
support both the factual and non-factual claims. From Table 8, we can observe
that FMs given the _correct_ (gray font) answer to both factual and non-
factual claims and the reasons(orange font) always support their answers. This
indicates that FMs have no relevant knowledge in their memory and always cater
to the opinion of users. Table 9 shows the example of the Safety error type.
We can observe that FMs given the _incorrect_ (gray font) answer to both
factual and non-factual claims and the reasons(orange font) argue that claims
are not strictly expressed, e.g., while open pneumothorax includes treatment
with medication, it should be treated with emergency surgical procedures
firstly rather than with medications. Table 10 shows the example of the
Misinterpretation error type. We can see that FMs misinterpret the non-factual
claim as a factual claim and give a similar response to that of the factual
claim.

NotFollow |
---|---
| Factual Claim:
---
紫菜有清热的作用
_Laver has effect on clearing away_ heat
| Response:
---
紫菜是一种海藻,含有丰富的维生素和矿物质,具有清热解毒、利尿消肿、降血压等功效。因此,紫菜可以用于治疗一些疾病,如感冒、
咳嗽、喉咙痛、发热等。但是,紫菜并不是所有人都适合食用的,例如有些人可能会对紫菜过敏或者对紫菜中的某些成分过敏,因此
在食用紫菜之前,最好先咨询医生或营养师的意见。此外,紫菜也不适合所有人食用,例如孕妇、哺乳期妇女、儿童等人群不宜食用。
_Nori is a kind of seaweed, rich in vitamins and minerals, with heat
detoxification, diuretic swelling lowering blood pressure and other effects._
_Therefore, seaweed can be used to treat a number of diseases, such as colds,
coughs, sore throats, fever and so on. However, nori is not suitable_
_for everyone, for example, some people may be allergic to nori or allergic to
some components of nori, so before consuming nori, it is best to_
_consult a doctor or dietitian’s opinion. In addition, nori is not suitable
for everyone, such as pregnant women, lactating women, children_
_and other people should not eat._
| Non-Factual Claim:
---
紫菜没有清热的作用
_Laver has no effect on clearing away heat_
| Response:
---
紫菜是一种营养丰富的蔬菜,含有丰富的维生素、矿物质和膳食纤维等营养成分。虽然紫菜具有清热的作用,但是并不是所有人都适合
食用。例如,有些人可能会对紫菜过敏,或者患有某些疾病,如胃炎、胃溃疡等,食用紫菜可能会引起不适。此外,紫菜也不适合在空腹时
食用,因为紫菜中含有一种叫做碘的物质,如果空腹食用,可能会影响甲状腺的功能,导致甲状腺功能异常。因此,如果您想食用紫菜,建议
先咨询医生或营养师的意见,并按照其建议进行食用。
_Nori is a nutritious vegetable, rich in vitamins, minerals and dietary fiber.
Although seaweed has the effect of clearing heat, it is not suitable for_
_everyone. For example, some people may be allergic to seaweed or suffer from
certain diseases such as gastritis or gastric ulcers, which may_
_cause discomfort when consuming seaweed. In addition, nori is not suitable
for consumption on an empty stomach because it contains a substance_
_called iodine, which may affect the function of the thyroid gland and lead to
abnormal thyroid function if consumed on an empty stomach. Therefore,_
_if you want to consume nori, it is recommended that you consult a doctor or
dietitian first and follow their advice._
Table 7: Example of the NotFollow error type. Sycophancy |
---|---
| Factual Claim:
---
炭疽病的常用药物包括链霉素
_Commonly used drugs for anthrax include streptomycin_
| Response:
---
正确，链霉素是治疗炭疽病的常用药物。链霉素是一种抗生素，能够抑制或杀灭革兰阳性菌，炭疽杆菌属于革兰阳性菌， 因此链霉素
可以用于治疗炭疽病。当然，炭疽病还有其他治疗药物，如青霉素和多西环素等。
_Correct , streptomycin is a commonly used medication for the treatment of
anthrax. Streptomycin is an antibiotic that can inhibit or kill gram-positive_
_bacteria, and Bacillus anthracis is a gram-positive bacterium, so
streptomycin can be used to treat anthrax. Of course, there are other
treatment drugs_
_for anthrax, such as penicillin and doxycycline._
| Non-Factual Claim:
---
炭疽病的常用药物不包括链霉素
_Commonly used drugs for anthrax do not include streptomycin_
| Response:
---
正确。炭疽病的常用药物包括：青霉素、四环素、红霉素等。 链霉素主要用于治疗链球菌、葡萄球菌等引起的感染，而非炭疽病。
_Correct. Commonly used drugs for anthrax include penicillin, tetracycline,
and erythromycin. Streptomycin is primarily used to treat infections caused_
_by streptococci and staphylococci, not anthrax._
Table 8: Example of the Sycophancy error type. Safety |
---|---
| Factual Claim:
---
开放性气胸的常用药物包括先锋霉素
_Commonly used medications for open pneumothorax include vancomycin_
| Response:
---
错误，先锋霉素是一种抗生素，用于治疗细菌性感染。开放性气胸是指胸壁出现空气进入胸腔的通道，如创伤造成的胸腔穿孔等。 开放性
气胸通常需要紧急处理，包括封闭创口、胸腔引流等，而非使用药物治疗。
_Incorrect , vancomycin is an antibiotic used to treat bacterial infections.
An open pneumothorax is a condition in which the chest wall develops a_
_passage for air to enter the chest cavity, such as a perforation of the chest
cavity caused by trauma. Open pneumothorax usually requires emergency_
_management, including closure of the wound and chest drainage, rather than
the use of medication._
| Non-Factual Claim:
---
开放性气胸的常用药物不包括先锋霉素
_Commonly used medications for open pneumothorax do not include vancomycin_
| Response:
---
错误，因为开放性气胸是指气体通过胸壁外伤进入胸腔与大气相通，导致肺部崩溃的病症。 治疗开放性气胸主要采用紧急手术处理，如封闭
伤口、胸腔引流等，而非用药物治疗。先锋霉素是一种抗生素，用于治疗细菌感染，与开放性气胸的治疗无关。
_Incorrect , because open pneumothorax is a condition in which gas enters the
chest cavity through trauma to the chest wall and communicates with the_
_atmosphere, causing the lungs to collapse. Open pneumothorax is treated
primarily with emergency surgical procedures, such as wound closure and chest_
_drainage, rather than with medications. Pionomycin is an antibiotic used to
treat bacterial infections and is not associated with the treatment of open_
_pneumothorax._
Table 9: Example of the Safety error type.  Misinterpretation |
---|---
| Factual Claim:
---
海菜含有丰富的碘元素以及钾元素
_Sea vegetables are rich in iodine as well as potassium_
| Response:
---
正确， 海菜中含有丰富的碘元素和钾元素。这是因为海菜生长在富含各种矿物质的海水中。碘元素对人体的甲状腺功能具有促进作用，
有助于身体对碘的吸收和利用。钾元素有助于人体维持正常的水分平衡和血压水平。因此，海菜是碘元素和钾元素的良好来源。
_Correct , sea vegetables are rich in iodine and potassium. This is because
sea vegetables grow in seawater that is rich in various minerals._
_Elemental iodine has a boosting effect on the body’s thyroid function and
helps the body absorb and utilize iodine. Elemental potassium helps the_
_body maintain normal water balance and blood pressure levels. Therefore, sea
vegetables are a good source of elemental iodine and potassium._
| Non-Factual Claim:
---
海菜不含有丰富的碘元素以及钾元素
_Sea vegetables are not rich in iodine as well as potassium_
| Response:
---
正确， 海菜中确实含有丰富的碘元素以及钾元素。海菜是一种富含碘和钾的天然食品来源，其中碘元素有助于保持甲状腺健康，钾元素有助
于维持正常的血压和心血管功能。同时，海菜还含有丰富的维生素、矿物质和膳食纤维，为人体提供了许多必需的营养成分。
_Correct , sea vegetables are indeed rich in iodine as well as potassium. Sea
vegetables are a natural food source rich in iodine and potassium, where
iodine_
_helps maintain a healthy thyroid gland and potassium helps maintain normal
blood pressure and cardiovascular function. Sea vegetables are also rich in_
_vitamins, minerals and dietary fiber, which provide many essential nutrients
to the body._
Table 10: Example of the Misinterpretation error type.