Fig. 6

The multi-component prompt template used to guide the KGLM model.The template consists of four parts: (a) System role: Assigns the model the identity of an expert to focus its output. (b) Define triples: Provides few-shot examples of the desired triplet structure. (c) Output format requirements: Specifies strict rules, such as using JSON format, to ensure machine-readability. (d) Output rules: Includes a Chain-of-Thought (CoT) instruction (“let’s think step by step”) to help the model process complex and nested relationships.