                                    Hierarchical Graph Tokenization for Molecule-Language Alignment







                                     No, the hydroxide group                                              Yes, the hydroxide group

                                     consists of -OH, but…

                                                           🤖                                              is present in the molecule

                                                                                                                                       🤖



                  Large Language Model                                                  Large Language Model







        O    N     H      …     C      O    …    "Is there a hydroxide        O     N    H      …    =O    -OH     …   "Is there a hydroxide

                                                 in this molecule?"                                                    in this molecule?"

                  Node Tokens                                                     Node Tokens       Motif Tokens



                       (a) Node-centric tokenization.                                           (b) HIGHT tokenization.

Figure 2. Illustration of hallucination caused by node-centric tokenization. With only node-level tokens, LLMs have to relate the nodes

within a specific functional group to align useful molecular structures with the corresponding language descriptions. Yet, due to the

arbitrary order of atoms and position biases in LLMs, it is hard to recognize each functional group, leading to severe hallucinations.





several self-supervised learning tasks. The reconstructed                    To this end, we propose HiPubChem, which augments

attributes in Eq. 4 include atom types at the atom-level and                 the molecular instruction tuning dataset with captions of

the number of atoms at the motif-level (Zang et al., 2023).                  the functional groups. We consider both the positive and

                                                                             negative appearances of motifs: For the positive case, we

Merely feeding the motif tokens with node tokens to LLMs

                                                                             directly append the caption of all functional groups detected

still can not help distinguish the motifs from atoms properly,

                                                                             with RDKit. We also include a brief introduction of the

hence we propose to further attach positional encodings p

                                                                             functional groups to provide fine-grained information for

to all of the tokens. We choose to use Laplacian positional

                                                                             molecule-language alignment. For the negative case, we

embeddings (Dwivedi et al., 2020) while one could also

                                                                             randomly sample kneg motifs not appeared in the molecule

adopt other variants (Ying et al., 2021). Since different

                                                                             to explicitly instruct LGLMs on the absence of the mo-

types of tokens contain distinct semantics, we adopt separate

                                                                             tifs. Despite the simple augmentation strategy, we find that

adapters for different types of tokens. Denoting the motif

             (i)                                                             HiPubChem significantly reduces the hallucination issue

tokens as hm for motif M(i) , generation with HIGHT is:                      and improves the alignment performance.

                        Yla

   pθ (a|q, h, hm ) =         pθ (ai |q, fn (h1 ), ..., fn (hn ),

                            i=1                                              4.3. Hierarchical Graph Instruction Tuning

                         fm (h(1)            (k+1)

                              m ), ..., fg (hm     ), a<i ),

                                                                             We use a two-stage instruction tuning (Cao et al., 2023).

                                                      (7)

where fm (·) and fg (·) are the adapters for BRICS motifs                    Stage 1 Alignment Pretraining. We curate a new molecule-

and the original molecules, respectively.                                    text paired dataset from PubChem following the pipeline

                                                                             of Liu et al. (2023b). We set the cutoff date by Jan. 2024,

4.2. Hierarchical Graph Instruction Tuning Dataset                           and filter out unmatched pairs and low-quality data, which

                                                                             results in 295k molecule-text pairs. Furthermore, we con-

Although HIGHT tokenizer properly extracts the hierarchi-                    struct the HiPubChem-295k dataset. The first stage mainly

cal information from the input graph modality, it remains                    warms up the adapter to properly project the graph tokens

challenging to properly align the language to the correspond-                with the LLM embedding space. To avoid feature distortion,

ing molecular information, without the appearance of the                     both the LLM and the GNN encoder are frozen.

respective captions in the texts. For example, if the caption

does not contain any information about the water solubility                  Stage 2 Task-specific Instruction Tunning. With a prop-

of the hydroxide functional group (“-OH”), LGLMs will                        erly trained adapter, we further leverage the task-specific

never know that “-OH” motif corresponds to the water solu-                   instruction tuning datasets from MoleculeNet (Wu

bility of the molecule, despite that HIGHT tokenizer extracts                et al., 2017), ChEBI-20 (Mendez et al., 2019), and

the “-OH” token. In fact, the commonly used molecular in-                    Mol-Instructions (Fang et al., 2024). More details

struction tuning curated from PubChem (Kim et al., 2022)                     are given in Appendix C. In Stage 2, we still keep the GNN

in existing LGLMs (Liu et al., 2023c; Cao et al., 2023; Li                   encoder frozen, while tuning both the adapter and the LLM

et al., 2024), contains surprisingly little information about                (with low-rank adaptation, i.e., LoRA (Hu et al., 2022)).

motifs. Some samples are given in Appendix C.2.



                                                                         5

