KARMA: Knowledge graph-based Automated Reasoning Materialization and Alignment

Jinkyeong Choi, Chaebin Jeong, Donghyeon Park 1
Sejong University
Seoul, South Korea
{jjinchoi, chaibin2000}@sju.ac.kr, parkdh@sejong.ac.kr


Abstract

Template-based contrastive synthesis is scalable, but its candidates often differ only in a few entity-slots while sequence-level optimization spreads supervision over mostly shared templates. We formalize this as the Resolution Mismatch Problem and propose KARMA, which enumerates schema-constrained paths over domain knowledge graphs and verbalizes them into slot-aligned contrastive candidates. Slot-Parallel Alignment (SPA) then applies a decoupled slot-level objective to route preference supervision to discriminative entity-slots, with slot-aware masked attention serving as an optional packed-evaluation implementation. Across biomedical, computer-science, and chemistry benchmarks, KARMA outperforms base LLM and same-data SFT baselines, and compares favorably with sequence- and token-level preference methods.

1 Introduction↩︎

Recent progress in LLM reasoning has increased the demand for reasoning supervision [1][3]. However, scaling such supervision remains bottlenecked by trade-offs among reliability, diversity, and cost [4], [5].

Prior approaches address this trade-off in three ways. (1) Human expert annotation yields reliable reasoning chains but is prohibitively expensive at the process level [4][6]. (2) Synthetic data from teacher models improves scalability [7], [8], but inherits and propagates latent reasoning errors [9], [10]. (3) Rule- or template-based generation reduces cost through programmatic construction, but narrow templates restrict factual coverage [11]. Despite these differences in how reasoning data is generated, a structural limitation emerges once it is used for contrastive supervision: candidate differences are often concentrated in a few entity-slots, while supervision is applied at the full-sequence level.

Figure 1: The Resolution Mismatch Problem in preference optimization. (a) DPO compares a single chosen-rejected pair at the sequence level. (b) Multi-DPO extends this to multiple rejected candidates, still at the sequence level. (c) Our Slot-Parallel Alignment (SPA) compares candidates sharing the same template and aligns preference at the resolution of discriminative entity-slots.

We formalize this gap as the Resolution Mismatch Problem (Fig. 1): preference is often determined by a few discriminative entity-slots, while optimization is applied to the full sequence. The bottleneck is not how many candidates we compare, but at what resolution we compare them. Standard DPO [12] (Fig. 1-a) and its multi-candidate extensions (Fig. 1-b) widen the comparison set but retain sequence-level granularity, which dilutes the signal on informative entity-slots [13][15].

Knowledge graphs provide a natural way to address this mismatch: under fixed schemas, alternative paths yield candidates that share the same template, with differences localized to entity-slots [16][18]. We instantiate this idea in KARMA (Knowledge graph-based Automated Reasoning Materialization and Alignment), a unified framework whose synthesis pipeline produces such candidates and whose learning component, Slot-Parallel Alignment (SPA), operates directly on them (Fig. 1-c).

The synthesis pipeline verbalizes KG paths under a shared template [19][21] and uses recurrence-based support as a structural prior for preference assignment. This exposes explicit discriminative entity-slots while expanding factual coverage beyond hand-written templates.

On the learning side, SPA applies a decoupled slot-level objective that supervises construction-exposed entity slots while retaining the shared template as a language-modeling signal. For efficient packed evaluation, SPA can optionally use slot-aware masked attention to approximate per-candidate log-likelihoods in a single forward pass without changing the slot-level supervision signal. Unlike prior token-level methods [22][25] that learn or estimate which tokens matter, SPA targets entity-slots that are explicitly exposed by construction in KARMA-synthesized data.

When data and optimization share the same slot-level resolution, preference learning can focus on discriminative evidence while preserving shared templates. We evaluate KARMA across biomedical, chemistry, and computer-science benchmarks, where it yields consistent gains over base LLM and SFT baselines.

Our contributions are:

  • Aligned contrastive synthesis from KGs: We propose a KG-grounded synthesis pipeline that constructs chosen-rejected candidates sharing a verbalization template by design, localizing preference differences to entity-slots and using KG path recurrence as a structural prior for preference assignment.

  • Slot-Parallel Alignment (SPA): We introduce a preference optimization method whose resolution matches the data: a decoupled slot-level objective applies preference and anchor losses to construction-exposed entity slots while preserving shared templates as a language-modeling signal. We further provide an optional slot-aware masked attention implementation that reduces redundant candidate evaluation without estimating token importance.

2 Related Work↩︎

2.0.0.1 Trade-offs in Reasoning Supervision

Reasoning supervision faces a cost-coverage trade-off: human process supervision yields reliable step-level signals but is prohibitively expensive [4][6], teacher-distilled data scales better but degrades under recursive use [7], [9], [10], [26], and template-based generation lowers cost but restricts factual coverage and collapses contrastive differences onto a few entity-slots [11], [27]. KARMA turns this collapse into a resource: by grounding candidate construction in KG paths, it expands factual coverage while keeping discriminative variation localized to entity-slots by construction.

2.0.0.2 Fine-grained Preference Alignment

Sequence-level preference optimization [12], [28][30] dilutes supervision on the few discriminative positions when candidates share most tokens [14], [25]. Token-level methods address this by estimating which tokens matter via importance scoring, learned masks, or oracle selection [22][24], [31], [32], but require additional learning or external signals to identify them. SPA instead exploits a structural prior from KARMA-synthesized data: discriminative entity-slots are known by construction, so supervision routes to them directly without estimation.

2.0.0.3 Knowledge Graph Verbalization

Knowledge graphs ground language models by verbalizing structured facts into natural language [19][21], [33], with reasoning-on-graph approaches further leveraging KG paths as faithful intermediate traces [16][18]. Both lines treat each verbalized path as a single positive instance, leaving the structural property that alternative paths share endpoints and schema unused. KARMA exploits exactly this property to expose slot-level discriminative structure for SPA.

3 Methodology↩︎

3.1 Overview↩︎

We propose KARMA, a knowledge graph (KG)-grounded contrastive synthesis pipeline, and SPA, a slot-level preference optimization method co-designed for KARMA-synthesized data. KARMA enumerates alternative KG paths between fixed source-target entities under a fixed relational schema and verbalizes them into structurally aligned contrastive candidates that share a template scaffold while differing only at discriminative entity-slots. SPA then aligns preference optimization with this entity-slot-level structure through two core learning mechanisms: (i) slot-parallel organization of candidate variants under shared context, and (ii) a decoupled hybrid objective that applies preference supervision to entity slots while preserving the shared template. Slot-aware masked attention is an optional packed-evaluation mechanism that reduces redundant forward passes by approximating per-candidate log-likelihoods in a single forward pass. Together, KARMA and SPA realize a single principle: align the granularity of supervision with the structural granularity of the data.

Figure 2: Overview of KARMA and SPA. KARMA synthesizes structurally aligned contrastive candidates from knowledge-graph paths via path enumeration, support-based top-K selection, and template verbalization. Because candidate differences are localized to sparse entity-slots, sequence-level preference optimization suffers from signal dilution. SPA addresses this mismatch with a decoupled slot-level objective that aligns learning with entity-slot-level supervision. Slot-aware masked attention, when enabled, serves as an optional packed-evaluation implementation that reduces redundant candidate evaluation while leaving the slot-level supervision signal unchanged.

3.2 KARMA Data Synthesis: KG-Grounded Contrastive Candidate Construction↩︎

KARMA constructs slot-aligned contrastive candidates from a domain knowledge graph in three steps: it enumerates schema-constrained paths between source-target entity pairs, selects top-\(K\) alternatives per candidate pool by balancing support and structural diversity, and verbalizes the selected paths with a schema-specific template shared within the pool. The resulting candidates share the same source and target entities and relation schema, differing only at their intermediate entity slots. This slot-localized variation is the interface to SPA: it confines contrastive information to entity slots, exposing preference signal at the same granularity as the data variation.

3.2.1 Path Enumeration↩︎

KARMA first constructs candidate pools by enumerating schema-constrained multi-hop paths from a domain knowledge graph (KG) \(\mathcal{G}=(\mathcal{N},\mathcal{E})\), where \(\mathcal{N}\) is the set of entities and \(\mathcal{E}\subseteq \mathcal{N}\times\mathcal{R}\times\mathcal{N}\) is the set of typed edges over relation types \(\mathcal{R}\). A relation schema specifies an ordered pattern of typed edges that candidate paths must instantiate. KARMA uses such schemas to collect alternative paths that share the same schema and source and target entities while differing only in their intermediate entities (Fig. 2A).

For a given source entity \(e_s\), target entity \(e_t\), and relation schema, KARMA enumerates a schema-constrained candidate pool \(\mathcal{P}\), a source-to-target subgraph of \(\mathcal{G}\), whose elements take the form \[{ p^{m} = \left( e_s, e_1^{(m)}, e_2^{(m)}, \ldots, e_{n-1}^{(m)}, e_t \right) },\] where \(m=1,\dots,M\) indexes paths within the pool, \(n\) denotes the number of hops in the relation schema, \(e^{(m)}_j\) denotes the entity at the \(j\)-th intermediate position of path \(p^m\) for \(j=1,\dots,n-1\), and \(e_s,e_t\) denote the source and target entities.

Each such pool corresponds to one source-target pair and serves as the candidate set for one training instance. Paths in the same pool share the same relation schema and source and target entities, but may differ in their intermediate entities. Equivalently, each intermediate slot \(j\) induces a set of distinct slot entities \(\mathcal{S}_j=\{e_{j,1},\dots,e_{j,d_j}\}\), from which each path selects one entity, so \(e_j^{(m)}\in\mathcal{S}_j\). This property allows KARMA to construct contrastive alternatives whose differences are localized to intermediate entity slots.

3.2.2 Top-\(K\) Candidate Selection↩︎

Given a candidate pool \(\mathcal{P}\) of size \(M\), written \(\mathcal{P}=\{p^1,\dots,p^M\}\), KARMA selects \(K\) paths by balancing path support and structural diversity. We measure the support of each path by the cumulative recurrence of its intermediate entities within the pool: each intermediate entity contributes its occurrence count across \(\mathcal{P}\), and the path’s support is the sum of these contributions. Paths whose intermediate entities frequently recur thus receive higher support, reflecting structural connections that are commonly shared under the same source-target pair.

KARMA then greedily admits paths in descending order of support, subject to an overlap budget \(\delta\) that limits the number of intermediate entities shared with previously admitted paths (Fig. 2B). This budget enforces structural diversity by preventing near-duplicate candidates. The procedure stops when \(K\) paths have been admitted; pools with fewer than \(K\) admissible paths are discarded.

We denote the admitted paths by \(p^{\star}_k\) (\(k=1,\dots,K\)), indexed in admission order, with intermediate entities written as \(e_j^{(k)}\) for slot \(j\) of the \(k\)-th selected path. The ordered selected path sequence \[\mathcal{P}^{\star}=(p^{\star}_1,\dots,p^{\star}_K)\] preserves this ordering through verbalization and provides the preference ordering used by SPA: \(p^{\star}_1\) corresponds to the chosen candidate and \(p^{\star}_{2:K}\) to the rejected candidates. We empirically validate this chosen-rejected partition with a GPT-4 judge study in Appendix 11, and report end-to-end ablations against random path selection in Section 4.3.

3.2.3 Template Verbalization↩︎

Each selected path \(p^{\star}_k\in\mathcal{P}^{\star}\) is verbalized into a natural-language sequence \(y^{k}\) by populating a schema-specific template with the entities along the path. The template provides a fixed scaffold of textual fragments and entity slots determined by the relation schema, while the entities of \(p^{\star}_k\) are realized as multi-token spans following a domain-specific rule. Within a candidate pool, all selected paths share the same source and target entities and the same relation schema, so they are verbalized under an identical template scaffold. Consequently, the resulting ordered candidate sequence \(\mathcal{Y}=(y^{1},\dots,y^{K})\) differs only at the intermediate entity slots, while all template fragments and endpoint entities remain shared (Fig. 2C). This slot-localized variation is precisely the structural property SPA exploits in the next section.

Repeating this procedure over all retained source-target pairs yields the training corpus \[\mathcal{D}=\{(x_i,\mathcal{Y}_i)\}_{i=1}^{N}, \qquad \mathcal{Y}_i=(y_i^{1},\dots,y_i^{K}),\] where \(x_i\) is a prompt constructed from the source and target entities of the \(i\)-th instance, and \(\mathcal{Y}_i\) is the ordered verbalized candidate set inheriting the chosen/rejected ordering from the corresponding selected path sequence.

3.3 Slot-Parallel Alignment for Slot-Level Preference Learning↩︎

SPA realigns preference optimization from sequence-level to slot-level resolution, matching the granularity at which KARMA candidates actually differ. It concentrates supervision on discriminative entity slots through a decoupled hybrid objective: slot-level preference and anchor losses supervise entity tokens, while a template LM loss preserves the shared scaffold. Slot-parallel packing evaluates variants under shared context, and slot-aware masked attention optionally obtains per-candidate log-likelihoods in one forward pass instead of \(K{+}1\), at a small accuracy cost.

3.3.1 Slot-Parallel Packing with Shared Context↩︎

For a single training instance, we drop the corpus index \(i\) and write \(\mathcal{Y}=(y^{1},\dots,y^{K})\). Following the path notation in Section 3.2.2, the candidates in \(\mathcal{Y}\) differ only at the intermediate slots \(j=1,\dots,n-1\), where slot \(j\) holds the entity \(e_j^{(k)}\) in candidate \(y^{k}\). Let \(t_0,\dots,t_{n-1}\) be the shared template fragments, and let \(e_j^{(1)}\) denote the chosen entity at slot \(j\), which we refer to as the anchor. SPA constructs the packed sequence \[\mathbf{s} = \bigl[ x;\; t_0,\; e_1^{(1{:}K)},\; t_1,\; \dots,\; e_{n-1}^{(1{:}K)},\; t_{n-1} \bigr],\] where \(e_j^{(1{:}K)}\) denotes the ordered concatenation of slot-\(j\) entity variants \(e_j^{(1)},\dots,e_j^{(K)}\). As illustrated in Fig. 2E, SPA groups the variants of each intermediate slot into a local slot bundle while sharing the surrounding template fragments. We shuffle the intra-slot variant order during training to prevent positional shortcuts.

Figure 3: Slot-aware masked attention for packed candidate evaluation. Green cells denote allowed attention, red cells denote blocked attention, and dark cells denote future tokens. Compared with a plain causal mask, the SPA mask lets each variant attend to the shared template scaffold and its own slot state, while restricting previous slots to the anchored prefix so that each candidate’s log-likelihood within the packed sequence approximates its standalone value under K{+}1 independent forward passes.

3.3.2 Slot-Aware Masked Attention↩︎

Since candidates in \(\mathbf{s}\) share all template fragments and differ only at the intermediate entity slots, \(K{+}1\) standalone forward passes would redundantly recompute identical template representations. SPA replaces the causal attention mask with a slot-aware mask so that all per-candidate log-likelihoods are obtained from a single forward pass while approximating their standalone values.

We organize the mask by what each query token is allowed to attend to within the causal prefix. Template tokens at fragment \(t_j\) attend only to the preceding template fragments and to the anchor entity of each past slot. An entity token \(e_j^{(k)}\) at slot \(j\) in candidate \(k\) attends to the preceding template fragments, to the past anchors \(e_1^{(1)},\dots,e_{j-1}^{(1)}\), and to itself. Consequently, each candidate’s log-likelihood within the packed sequence is computed along its own anchored path, approximating the value it would have under an independent forward pass.

Fig. 3 (left) illustrates the resulting mask for a packed sequence with two intermediate slots and three variants per slot. With a plain causal mask (top right), later tokens can attend to multiple variants from previous slots, so a candidate’s log-likelihood within the packed sequence diverges from its standalone value. The SPA mask (bottom right) restricts each candidate to its own anchored path while keeping the template representation shared, so one forward pass over \(\mathbf{s}\) approximates \(K{+}1\) independent passes while encoding the template scaffold only once.

3.3.3 Decoupled Hybrid Objective↩︎

Given per-candidate log-likelihoods obtained from the packed sequence, applying a sequence-level preference objective to \(\mathbf{s}\) would still spread supervision over many template tokens that are identical across candidates. Since KARMA candidates differ only at intermediate entity slots, SPA decouples the objective according to this structure: a slot-level preference loss supervises entity choices, an anchor loss stabilizes the chosen entities, and a template language modeling loss preserves the shared scaffold (Fig. 2F).

3.3.3.1 Slot-level preference.

For each slot \(j\), the anchor entity \(e_j^{(1)}\) should be preferred to the rejected entities \(e_j^{(k)}\) from candidates \(k=2,\dots,K\). Let \(\pi_\theta\) denote the policy model and \(\pi_{\mathrm{ref}}\) a fixed reference model. For an entity span \(e_j^{(k)}\), we write \(\ell_\theta(e_j^{(k)}\mid\mathbf{s})\) and \(\ell_{\mathrm{ref}}(e_j^{(k)}\mid\mathbf{s})\) for its length-normalized log-likelihood under \(\pi_\theta\) and \(\pi_{\mathrm{ref}}\), computed under the slot-aware mask. We define the reference-normalized score \[r_\theta(e_j^{(k)}) = \ell_\theta(e_j^{(k)} \mid \mathbf{s}) - \ell_{\mathrm{ref}}(e_j^{(k)} \mid \mathbf{s}).\] This score is the policy’s log-likelihood gain over the reference on the entity span \(e_j^{(k)}\). SPA applies a squared margin loss between the anchor and each rejected entity at the same slot: \[\label{eq:pref} \begin{align} \mathcal{L}_{\mathrm{pref}} &= \frac{1}{(n-1)(K-1)} \\ &\quad \times \sum_{j=1}^{n-1} \sum_{k=2}^{K} \left( r_\theta(e_j^{(1)}) - r_\theta(e_j^{(k)}) - \frac{1}{2\beta} \right)^2, \end{align}\tag{1}\] where \(\beta\) controls the target margin. Here, \(k\) follows the original top-\(K\) candidate order: \(k=1\) is the chosen candidate and \(k=2,\dots,K\) are rejected candidates. This term provides the discriminative signal at the slots where candidates differ, rather than spreading preference supervision over the shared template.

3.3.3.2 Anchor confidence.

The preference term in Eq. 1 constrains relative scores, but it does not directly ensure that the chosen entity has high likelihood. SPA therefore adds an anchor confidence term: \[\label{eq:anchor} \mathcal{L}_{\mathrm{anchor}} = -\frac{1}{n-1} \sum_{j=1}^{n-1} \ell_\theta(e_j^{(1)} \mid \mathbf{s}).\tag{2}\] This term stabilizes the likelihood of the selected path entities, complementing the relative comparison imposed by \(\mathcal{L}_{\mathrm{pref}}\).

3.3.3.3 Template language modeling.

The template fragments encode the relation scaffold shared by all candidates, but they are not discriminative for the slot-level preference comparison. Let \(\mathcal{T}\) denote the set of shared template token positions in \(\mathbf{s}\), and let \(s_u\) denote the \(u\)-th token of \(\mathbf{s}\). SPA preserves the scaffold with a standard causal language modeling loss: \[\label{eq:template} \mathcal{L}_{\mathrm{template}} = -\frac{1}{|\mathcal{T}|} \sum_{u\in\mathcal{T}} \log \pi_\theta(s_u \mid s_{<u}).\tag{3}\] This term maintains the fluency and logical structure of the verbalization while leaving entity discrimination to the slot-level losses.

3.3.3.4 Full objective.

The final SPA objective combines the slot-level preference term with the two auxiliary losses: \[\label{eq:spa95full95objective} \mathcal{L}_{\mathrm{SPA}} = \mathcal{L}_{\mathrm{pref}} + \lambda_{\mathrm{anchor}}\mathcal{L}_{\mathrm{anchor}} + \lambda_{\mathrm{template}}\mathcal{L}_{\mathrm{template}},\tag{4}\] where \(\lambda_{\mathrm{anchor}}\) and \(\lambda_{\mathrm{template}}\) are scalar loss weights. We average \(\mathcal{L}_{\mathrm{SPA}}\) over training instances.

Table 1: Main performance comparison between the baseline, simple SFT variants, and our proposed method (KARMA). Results are reported in accuracy (Acc). For KARMA, the optimal configuration is reported in Appendix. [sec:app:hyperparameter95sensitivity]. The best and second-best results per row are highlighted.
Domain Metric Baseline Simple SFT Ours (KARMA)
4-5 (Base LLM) (1) Open-Data (2) KARMA-Data
Biomedical MedQA (Acc) 0.362 0.434 0.273 0.541
PubMedQA (Acc) 0.511 0.512 0.229 0.522
MMLU-Bio (Acc) 0.505 0.571 0.381 0.702
MMLU-Pro-Bio (Acc) 0.230 0.324 0.292 0.532
GPQA-Bio (Acc) 0.700 0.533 0.333 0.667
Computer Science MMLU-CS (Acc) 0.651 0.655 0.451 0.701
MMLU-Pro-CS (Acc) 0.195 0.243 0.180 0.256
CSBench (Acc) 0.345 0.506 0.372 0.495
Chemistry MMLU-Chem (Acc) 0.500 0.495 0.373 0.630
MMLU-Pro-Chem (Acc) 0.148 0.178 0.126 0.195
GPQA-Chem (Acc) 0.161 0.172 0.172 0.204

4 Experiments↩︎

We evaluate KARMA across three knowledge-intensive domains to answer three research questions: (RQ1) Does the co-design of KARMA-synthesized contrastive candidates and SPA’s slot-level objective outperform both conventional SFT and sequence-level preference optimization on the same data? (RQ2) How important is graph-guided path selection for synthetic reasoning supervision? (RQ3) Does aligning the preference objective’s resolution with the entity-slot structure of the data yield consistent gains over sequence-level and token-level alternatives?

4.1 Experimental Setup↩︎

We evaluate on three domains: Biomedical, CS, and Chemistry, using 11 benchmarks that mix MMLU subsets [34], MMLU-Pro subsets [35], and reasoning-heavy benchmarks (MedQA [36], PubMedQA [37], GPQA [38], CSBench [39]). The base model is Qwen2.5-7B-Instruct with LoRA fine-tuning, and all evaluations use zero-shot chain-of-thought prompting. Full benchmark lists (9.1), dataset sources (7), and implementation details (8) are provided in Appendix.

4.2 Main Results↩︎

As shown in Tab. 1, KARMA yields consistent gains over the baseline across the majority of benchmarks, with the largest improvements on reasoning-heavy ones. KARMA also outperforms Open-Data SFT on the majority of benchmarks, indicating that the gains do not merely reflect additional in-domain text but the structural properties of KARMA-synthesized supervision.

The contrast between KARMA-Data SFT and KARMA further isolates the role of the training objective. KARMA-Data SFT uses identical KARMA-synthesized chosen candidates but optimizes them with a flat sequence-level SFT objective, and fails to consistently improve over the baseline. This reflects an inherent incompatibility between KARMA’s data structure and sequence-level supervision: chosen candidates from the same source-target pair share almost all tokens except at the intermediate entity-slots, so SFT on these candidates assigns equal weight to all positions and the model is dominantly supervised on the shared template tokens, which form a small set of patterns repeated across many examples. This concentrates SFT updates on a low-diversity distribution, causing the model to collapse toward the template phrasing while losing pretraining-acquired knowledge in the long tail [40], [41]. We view this as a data-side analog of the Resolution Mismatch Problem, where the mismatch arises not between preference signal and optimization granularity, but between data structure and supervision granularity. SPA resolves this by decoupling slot-level preference supervision from template language modeling, converting the same data into the strongest signal in the comparison. This confirms that the gains of KARMA arise from the co-design of structurally aligned data and slot-level supervision, not from data scale or content alone. This answers RQ1: KG-grounded contrastive synthesis improves domain reasoning beyond conventional SFT, but only when the training objective operates at the entity-slot-level resolution at which the candidates actually differ.

4.3 Ablation Study↩︎

4.3.0.1 Ablation of Graph-Guided Path Selection.

Table 2: Ablation on path selection strategy in the biomedical domain. Random samples paths from the KG; KARMA uses our support-based selection.
Metric Random KARMA \(\Delta\)
MedQA (Acc) 0.381 0.541 +0.160
PubMedQA (Acc) 0.465 0.522 +0.057
MMLU-Bio (Acc) 0.555 0.702 +0.147
MMLU-Pro-Bio (Acc) 0.338 0.532 +0.194
GPQA-Bio (Acc) 0.400 0.667 +0.267
Average 0.428 0.593 +0.165

Tab. 1 shows that the full KARMA framework outperforms baselines, but does not isolate which component drives the gain. RQ2 asks whether KARMA’s support-based path selection itself contributes, or whether any sampling from the same KG would suffice. We replace support-based selection with uniform random sampling, holding all other components fixed (KG, source-target pairs, schema, template, SPA objective, hyperparameters). Tab. 2 shows that KARMA outperforms random sampling on every Biomedical benchmark, with an average gain of +16.5 points.

The gain pattern is itself informative. Improvements are largest on benchmarks that require chaining multiple facts, such as GPQA-Bio (+26.7), MMLU-Pro-Bio (+19.4), and MedQA (+16.0), and remain substantial on knowledge-heavy multiple-choice reasoning (MMLU-Bio +14.7), while PubMedQA, which often admits surface-level factual lookup, shows only a marginal gain. This selectivity is consistent with the view of KG paths as a structural analogue of reasoning chains: support-based selection acts as a simple evidence prior, where intermediate entities that recur across the pool reflect connections corroborated by multiple traversals in the graph, yielding chosen-rejected contrasts that are informative for reasoning rather than mere surface distractors. That such a lightweight, training-free heuristic, relying only on entity recurrence statistics already implicit in the KG, suffices to produce these gains answers RQ2: KARMA’s advantage comes from how paths are selected, and the KG itself already carries much of the structure needed to make that selection effective.

4.3.0.2 Ablation on Preference Objective Resolution.

Table 3: Ablation comparing preference optimization objectives at different resolutions. SPA achieves the best or tied-best performance across benchmarks.
Domain Benchmark
[12] MDPO
[14] KARMA
Computer Science MMLU-CS 0.651 0.683 0.689 0.701
MMLUPro-CS 0.197 0.249 0.256 0.256
CSBench 0.356 0.446 0.475 0.495
Chemistry MMLU-Chem 0.607 0.570 0.616 0.630
MMLUPro-Chem 0.188 0.189 0.194 0.195
GPQA-Chem 0.172 0.172 0.182 0.204

Tab. 3 compares SPA with representative preference optimization baselines operating at different resolutions. The goal is to isolate the effect of preference objective resolution: whether the preference signal is applied at the sequence, token, or slot level. All methods are trained on the same KARMA-synthesized candidates and share the same training pipeline and hyperparameters; only the preference objective differs.

We consider three baselines. DPO (\(K=1\)) performs preference optimization using pairwise chosen-rejected comparisons. MDPO (\(K=4\)) extends this formulation to multiple rejected candidates while still operating at the sequence level. TDPO (\(K=1\)) introduces token-level KL regularization, providing a finer-grained signal than sequence-level objectives but without explicitly targeting the entity-slots where KARMA (\(K=4\)) candidates differ. In contrast, SPA applies supervision directly at the slot level, aligning the optimization objective with the structural units of KARMA-synthesized data.

The results show that SPA achieves the best or tied-best performance across all benchmarks, improving over the strongest baseline (TDPO) on reasoning-heavy ones such as CSBench (+2.0) and GPQA-Chem (+2.2). Sequence-level objectives assign supervision to the entire candidate, token-level regularization makes the signal more fine-grained, and SPA further aligns it with the entity-slot structure where the actual candidate differences arise. This answers RQ3: aligning the preference objective’s resolution with the data’s entity-slot structure yields consistent gains over both sequence-level (DPO, MDPO) and token-level (TDPO) alternatives, indicating that resolution alignment, beyond granularity alone, accounts for the improvement.

4.3.0.3 Ablation of Slot-Aware Masked Attention.

Table 4: Ablation of SPA’s slot-aware masked attention on task performance and per-step training efficiency. Bold marks the w/ Mask column.
Domain Benchmark w/o Mask w/ Mask
CS MMLU-CS 0.711 0.701
MMLUPro-CS 0.258 0.256
CSBench 0.495 0.495
Chemistry MMLU-Chem 0.640 0.630
MMLUPro-Chem 0.198 0.195
GPQA-Chem 0.182 0.204
Efficiency (per training step)
Step time (s) 15.58 11.32
Peak memory (GiB) 32.83 55.39
Reserved memory (GiB) 61.96 59.02
Forward passes \(2(K{+}1)\) 2

Tab. 4 characterizes the accuracy-efficiency trade-off of slot-aware masked attention, which we use as the default packed-evaluation implementation in SPA. The default w/ Mask variant packs all candidates into one sequence and approximates their log-likelihoods in a single forward pass, whereas w/o Mask evaluates candidates independently with \(K{+}1\) forward passes per step. Both variants share identical objectives, data, and hyperparameters; only the attention masking and packing differ. Efficiency is measured on Qwen2.5-7B-Instruct with \(K{=}4\) rejected candidates.

The two variants exhibit a clear trade-off between accuracy and training cost. On the accuracy side, disabling the mask matches or slightly improves performance on five of the six benchmarks, while the w/ Mask configuration remains within one accuracy point of the independent-evaluation variant on those benchmarks and outperforms it on GPQA-Chem. On the efficiency side, the default packed evaluation under the slot-aware mask reduces the number of forward passes per step from \(2(K{+}1)\) to \(2\), yielding a 1.38\(\times\) wall-clock speedup. The cost is marginally higher peak GPU memory, since the packed sequence concentrates all candidates into a single forward and materializes the slot-aware mask, while reserved memory remains comparable. Thus, slot-aware masked attention is the default efficiency-oriented implementation, not the source of SPA’s slot-level supervision. Users can trade wall-clock speed for peak accuracy by enabling or disabling the mask, while the preference, anchor, and template losses remain unchanged.

5 Conclusion↩︎

We propose KARMA, a KG-based pipeline that synthesizes structurally aligned contrastive candidates with explicit entity-slot-level differences. By leveraging KG paths, KARMA provides broad factual coverage while preserving structural alignment across candidates. We further introduce SPA, a slot-level preference optimization method designed for KARMA-style data. SPA addresses the resolution mismatch of sequence and token-level objectives by aligning supervision with the entity slots where candidates differ, enabling more precise preference attribution and improved reasoning performance. Together, KARMA achieves substantial gains on most knowledge-intensive reasoning benchmarks, while our analysis highlights the importance of KG path selection strategies.

6 Limitations↩︎

KARMA shares two limitations with prior KG-grounded LLM research [16][19]. First, the synthesis pipeline relies on a domain knowledge graph with sufficient coverage and connectivity to support multi-hop path sampling, so domains without such a KG would require automatic KG construction or hybrid retrieval-based grounding. Second, KARMA assumes that the target capability is expressible through an explicit schema and verbalization template, which restricts the framework to capabilities decomposable into discrete entity-slot structures and leaves open-ended generation outside its current scope.

Beyond these, slot-aware masked attention is an efficiency-oriented implementation choice rather than the source of SPA’s supervision signal: the default masked setting reduces per-step forward passes from \(2(K{+}1)\) to \(2\) and yields a 1.38\(\times\) wall-clock speedup, while disabling it recovers independent candidate evaluation at higher training cost. Users can choose either setting based on whether wall-clock time or peak accuracy is the binding constraint. Finally, all experiments use Qwen2.5-7B-Instruct with LoRA fine-tuning, and generality across other model families and scales remains to be verified.

Appendix↩︎

7 Dataset Construction Details↩︎

7.1 Knowledge Graph Sources↩︎

KARMA constructs training data from domain-specific knowledge graphs from GRBench [42], summarized in Table 5. Each graph is represented as a typed node-edge structure, where nodes contain textual attributes and outgoing typed neighbors. The biomedical graph uses heterogeneous node types such as diseases, symptoms, compounds, genes, anatomy, side effects, pharmacologic classes, biological processes, molecular functions, cellular components, and pathways. The academic graph uses paper nodes with citation edges, where each paper contains title, abstract, and keyword fields.

Table 5: Summary of domain knowledge graphs used for KARMA synthesis.
Domain Graph nodes Edge types Node attributes
Biomedical Typed biomedical entities Typed biomedical relations Name
Computer Science Papers reference, cited_by Title, abstract, keywords
Chemistry Papers reference, cited_by Title, abstract, keywords

7.2 Relation Schemas↩︎

A relation schema defines the edge-type pattern used to enumerate paths from a source entity to a target entity. In the academic graph, schemas are metapaths over citation edges. We use four-hop schemas by default, generated from all combinations of reference and cited_by. In the biomedical graph, schemas are typed metapaths over biomedical node and relation types.

7.3 Path Enumeration and Filtering↩︎

For each schema, KARMA enumerates paths that follow the prescribed edge-type sequence, as described in Algorithm 4. Each path connects a source entity \(e_s\) to a target entity \(e_t\) through a sequence of intermediate entities. For a fixed source-target pair, all paths satisfying the same schema form a candidate pool. Candidate pools with fewer than \(K\) valid paths are discarded. We remove loops in intermediate positions and apply intermediate caps during traversal to avoid path explosion.

Figure 4: Schema-Constrained Path Pool Construction

7.4 Support-based Top-K Selection↩︎

For each source-target candidate pool, we select \(K\) paths using an entity-support score and an overlap constraint, as detailed in Algorithm 5. The support score of a middle path \(m\) is the sum of the occurrence counts of its intermediate entities within the same source-target pool: \[\mathrm{score}(m)=\sum_{e \in m}\mathrm{freq}(e).\] We then greedily select high-score paths while allowing at most \(\delta\) overlapping intermediate entities with the already selected paths. In the academic-domain generator, we use \(K=4\) and \(\delta=1\).

Figure 5: Support-based Top-K Path Selection

7.5 Template Verbalization↩︎

Each selected path is verbalized into a natural-language candidate using a schema-specific template. Entity mentions are marked with bold delimiters, e.g., **entity**. These marked spans define the entity slots used by SPA. The selected paths for the same source-target pair share the same template scaffold and differ only in their intermediate entity slots.

7.6 Dataset Statistics↩︎

Table 6 reports dataset statistics. For each domain, we report the number of nodes and edges in the source knowledge graph, the number of relation schemas used for path enumeration, the number of generated training samples, and the number of candidates per pool size \(K\).

Table 6: Dataset statistics for KARMA-synthesized training data.
Domain #Nodes #Edges #Schemas #Samples \(K\)
Biomedical 47K 4.23M 522 1M 4
Computer Science 5.26M 65M 16 1M 4
Chemistry 1.85M 41M 16 1M 4

8 Training Details↩︎

8.1 Model and LoRA Configuration↩︎

All experiments use Qwen2.5-7B-Instruct as the base model. We fine-tune the model with LoRA adapters. The LoRA rank is 32 and the LoRA alpha is 32. Adapters are inserted into the attention and feed-forward projection modules. The full configuration is reported in Table 7. The reference model \(\pi_{\mathrm{ref}}\) used by SPA and all DPO-family baselines is obtained by disabling the LoRA adapter on the policy model \(\pi_{\theta}\); that is, \(\pi_{\theta}\) and \(\pi_{\mathrm{ref}}\) share identical base parameters and differ only in whether the trained adapters are active.

Table 7: Model and LoRA configuration.
Configuration Value
Base model Qwen2.5-7B-Instruct
Fine-tuning method LoRA
LoRA rank 32
LoRA alpha 32
Target modules q_proj, k_proj, v_proj, o_proj
gate_proj, up_proj, down_proj
Precision bfloat16
Max sequence length 4096
Gradient checkpointing Enabled
Attention implementation SDPA
Reference model \(\pi_{\mathrm{ref}}\) Policy model with LoRA adapter disabled
Table 8: SPA training hyperparameters. The preference-loss weight \(\lambda_{\mathrm{pref}}\) is fixed to \(1.0\) in all experiments based on the sensitivity analysis in Table [tbl:tab:spa95hyperparams], and is therefore absorbed into \(\mathcal{L}_{\mathrm{pref}}\) in Eq. [eq:spa95full95objective].
Hyperparameter Value
Learning rate \(5\times10^{-5}\)
Epochs 3
Per-device batch size 8
Gradient accumulation 1
Max gradient norm 1.0
\(\lambda_{\mathrm{anchor}}\) 0.5
\(\lambda_{\mathrm{template}}\) 0.1
Entity margin parameter \(\beta\) 0.1
Variant shuffling Enabled

8.2 Training Protocol↩︎

All training runs share the same general-purpose hyperparameters (learning rate, optimizer, batch size, epochs, gradient clipping, LoRA configuration) across baselines and KARMA, so that performance differences reflect the training objective rather than tuning. Method-specific hyperparameters, such as \(\lambda_{\mathrm{anchor}}\), \(\lambda_{\mathrm{template}}\), and \(\beta\) for SPA, are set as in Table 8 for KARMA, and the corresponding original defaults are used for DPO, MDPO, and TDPO. We do not perform validation-based checkpoint selection; the final epoch checkpoint is used for evaluation. Each domain dataset is used for training only, and evaluation is performed on the held-out benchmarks listed in Table 11.

All results reported in this paper, including the main results in Table 1 and all ablations, are computed as the mean of 5 independent runs with different random seeds.

8.3 Compute Infrastructure↩︎

All experiments are run on NVIDIA A100 GPU. A single SPA training run for one domain (1M samples, 3 epochs) takes approximately 40 GPU-hours on 1 GPU. The total compute budget across 5 random seeds, three domains, all baseline methods, and ablation studies is on the order of a few thousand A100 GPU-hours.

8.4 Baseline Implementations↩︎

We compare KARMA with the base model, open-data SFT, KARMA-data SFT, and preference-optimization baselines, as listed in Table 9. All fine-tuned baselines share the same base model, LoRA configuration, learning rate, batch size, epochs, and optimizer as KARMA; they differ only in the training objective and, where applicable, in the structure of the input data. Each baseline retains its original method-specific hyperparameters (e.g., the KL coefficient in DPO, the token-level regularization weight in TDPO) at the values recommended in their respective papers.

Table 9: Baseline implementation summary. All baselines share the same base model, LoRA configuration, and general-purpose training hyperparameters.
Baseline Description
Base LLM Qwen2.5-7B-Instruct without task-specific fine-tuning
Open-Data SFT SFT on open-domain or domain instruction data
KARMA-Data SFT SFT on KARMA-generated chosen responses
DPO Pairwise sequence-level preference optimization
MDPO Multi-rejected sequence-level preference optimization
TDPO Token-level preference optimization baseline
KARMA / SPA Slot-level preference optimization on KARMA candidates

8.5 Slot-aware Mask Implementation↩︎

SPA packs candidate variants into a single sequence by replacing each entity slot with a local bundle of chosen and rejected variants. The attention mask starts from a causal mask and then blocks cross-candidate contamination according to Table 10. PAD separators inserted between variants are blocked as both queries and keys.

Table 10: Slot-aware attention mask rules used in SPA.
Query token Allowed keys Blocked keys
Template token Previous templates + previous anchors Rejected variants
Anchor entity token Previous templates + previous anchors + itself Other variants in same slot
Rejected entity token Previous templates + previous anchors + itself Other variants in same slot
PAD separator None All tokens
Future token None Causal future positions

8.6 SPA Loss Computation↩︎

The full SPA loss computation procedure is summarized in Algorithm 6. Given a packed sequence with slot-aware masking, the policy and reference models compute log-probabilities for each variant. Slot-level preference and anchor confidence losses are accumulated across slots, and a template language modeling loss is computed on non-entity tokens.

Figure 6: SPA Loss Computation

9 Evaluation Details↩︎

9.1 Benchmark Sources↩︎

We evaluate on biomedical, chemistry, and computer-science benchmarks. The benchmark groups are summarized in Table 11.

Table 11: Benchmark groups used for domain evaluation.
Domain Benchmark Subset / category
Biomedical MMLU-Bio Anatomy, biology, medicine, genetics, nutrition, virology
MMLU-Pro-Bio Biology
MedQA Full benchmark
PubMedQA Full benchmark
GPQA-Bio Biology
Chemistry MMLU-Chem College chemistry, high school chemistry
MMLU-Pro-Chem Chemistry
GPQA-Chem Chemistry
Computer Science MMLU-CS CS, computer security, high school CS, machine learning
MMLU-Pro-CS Computer Science
CSBench Reasoning task type

9.2 Prompt Templates↩︎

All benchmarks are evaluated using the same model wrapper and benchmark-specific prompt templates, summarized by category in Table 12.

Table 12: Prompt template categories used in evaluation.
Benchmark type Prompt format
Multiple-choice QA Question + answer choices + instruction to select one option
Yes/no/maybe QA Question + instruction to output the normalized label
Reasoning QA Question + optional chain-of-thought style instruction

9.3 Answer Extraction↩︎

Generated responses are normalized to benchmark-specific answer formats before scoring. For multiple-choice tasks, the predicted option is extracted from the generated text and compared against the gold option. For label-based QA tasks such as yes/no/maybe classification, the generated text is mapped to the corresponding normalized label.

9.4 Inference Configuration↩︎

The inference configuration used across all benchmarks is reported in Table 13.

Table 13: Inference configuration used for evaluation.
Configuration Value
Base model Qwen2.5-7B-Instruct
Adapter handling LoRA adapter loading with optional merge
Batch size 8 by default
Max new tokens 512
Number of shots 0 by default
Distributed evaluation Supported with torchrun
Output format JSON result file

10 Hyperparameter Sensitivity↩︎

Table 14 reports sensitivity to the loss weights \(\lambda_{\mathrm{pref}}\), \(\lambda_{\mathrm{anchor}}\), and \(\lambda_{\mathrm{template}}\) on the Biomedical domain. The analysis examines whether SPA is robust to the relative weighting of slot-level preference learning, anchor confidence, and template language modeling. Based on this analysis, we fix \(\lambda_{\mathrm{pref}}=1.0\) in all main experiments and absorb it into \(\mathcal{L}_{\mathrm{pref}}\) in the final objective (Eq. 4 ), tuning only \(\lambda_{\mathrm{anchor}}\) and \(\lambda_{\mathrm{template}}\). The selected configuration is \((\lambda_{\mathrm{pref}}, \lambda_{\mathrm{anchor}}, \lambda_{\mathrm{template}})=(1.0, 0.5, 0.1)\), which achieves the best average accuracy across MedQA, PubMedQA, and MMLU-Pro-Bio.

Table 14: Sensitivity of SPA to the loss weights \(\lambda_{\mathrm{pref}}\), \(\lambda_{\mathrm{anchor}}\), and \(\lambda_{\mathrm{template}}\) on the Biomedical domain. The selected configuration \((\lambda_{\mathrm{pref}}, \lambda_{\mathrm{anchor}}, \lambda_{\mathrm{template}})=(1.0, 0.5, 0.1)\) (bold) achieves the highest average accuracy across MedQA, PubMedQA, and MMLU-Pro-Bio. Based on this analysis, \(\lambda_{\mathrm{pref}}\) is fixed to \(1.0\) in the final objective.
\(\lambda_{\mathrm{pref}}\) \(\lambda_{\mathrm{anchor}}\) \(\lambda_{\mathrm{template}}\) MedQA PubMedQA MMLU-Pro-Bio Avg
1.0 1.0 1.0 0.494 0.235 0.169 0.299
1.0 1.0 0.5 0.541 0.287 0.242 0.357
1.0 1.0 0.1 0.541 0.522 0.362 0.475
1.0 0.5 1.0 0.447 0.313 0.362 0.374
1.0 0.5 0.5 0.588 0.261 0.193 0.347
1.0 0.5 0.1 0.541 0.522 0.532 0.532
1.0 0.1 1.0 0.517 0.444 0.169 0.377
1.0 0.1 0.5 0.565 0.261 0.556 0.460
1.0 0.1 0.1 0.565 0.235 0.507 0.436
0.5 1.0 1.0 0.494 0.365 0.193 0.351
0.5 1.0 0.5 0.306 0.339 0.217 0.288
0.5 1.0 0.1 0.470 0.391 0.266 0.376
0.5 0.5 1.0 0.494 0.444 0.338 0.425
0.5 0.5 0.5 0.612 0.339 0.242 0.397
0.5 0.5 0.1 0.659 0.365 0.411 0.478
0.5 0.1 1.0 0.541 0.313 0.604 0.486
0.5 0.1 0.5 0.588 0.183 0.580 0.450
0.5 0.1 0.1 0.588 0.496 0.507 0.530
0.1 1.0 1.0 0.565 0.209 0.290 0.354
0.1 1.0 0.5 0.447 0.287 0.314 0.349
0.1 1.0 0.1 0.329 0.339 0.121 0.263
0.1 0.5 1.0 0.494 0.104 0.145 0.248
0.1 0.5 0.5 0.470 0.261 0.048 0.260
0.1 0.5 0.1 0.494 0.183 0.266 0.314
0.1 0.1 1.0 0.400 0.183 0.314 0.299
0.1 0.1 0.5 0.423 0.235 0.507 0.389
0.1 0.1 0.1 0.517 0.183 0.314 0.338
Table 15: GPT-4 validation of KARMA chosen-path selection. For each sampled pool, GPT-4 ranks all candidates without preference labels; agreement denotes the fraction of pools in which GPT-4’s top-ranked candidate matches the chosen path selected by support-based Top-\(K\).
Setting Value
Judge model GPT-4
Sampled candidate pools \(10{,}000\)
Candidates per pool (\(K\)) 4
Chance baseline (uniform over \(K\)) \(25.0\%\)
Agreement with KARMA chosen path \(74.8\%\)
Tie handling Counted as disagreement

11 Chosen Path Validation↩︎

To verify that the support-based Top-\(K\) selection (Algorithm 5) yields a chosen path that is genuinely the most plausible among the candidates in a pool, we conduct an LLM-judge validation study using GPT-4. For each candidate pool, GPT-4 is provided with the source-target pair, the shared schema scaffold, and all \(K\) verbalized candidates without preference labels, and is asked to identify the candidate whose intermediate entities form the most factually and semantically plausible reasoning chain between the source and target. We then measure the agreement rate between GPT-4’s top-ranked candidate and the chosen path selected by our support-based procedure. Ties are conservatively counted as disagreement.

As reported in Table 15, GPT-4 agrees with our chosen selection on \(74.8\%\) of sampled pools, well above the \(25\%\) chance baseline for \(K=4\) candidates. This indicates that entity-support scoring is a reliable proxy for path plausibility, and that the resulting chosen-rejected partition reflects a meaningful preference signal rather than an artifact of the heuristic. The remaining disagreement reflects cases in which multiple candidates within a pool are comparably plausible, which is consistent with the resolution mismatch motivating SPA: at the entity-slot resolution, several variants may be defensible, and the learning objective must be capable of expressing fine-grained preferences among them.

12 Qualitative Analysis↩︎

Table 16 shows a representative example of a KARMA-generated candidate pool from the biomedical domain, and Table 17 provides the corresponding path-only view.

Table 16: Example of a generated candidate pool.
Field Example
Instruction Using the following biomedical data, explain how the biological cascade initiating from Anatomy ’internal carotid artery’ reaches Biological Process.
Chosen candidate This path represents a key hypothesis explaining the biological causality between **’internal carotid artery’** and **’phospholipase C-activating G-protein coupled receptor signaling pathway’**. **[Detailed Mechanism]**: From a clinical perspective, **’internal carotid artery’** forms a biological interaction network with **migraine**, **’migraine’** represents a condition where **Ergotamine** is administered for symptomatic relief or cure, **’Ergotamine’** forms a biological interaction network with **HTR2A**, **’HTR2A’** is involved in **phospholipase C-activating G-protein coupled receptor signaling pathway**, regulating physiological homeostasis. Furthermore ultimately leading to this conclusion.
Rejected candidate 1 This path represents a key hypothesis explaining the biological causality between **’internal carotid artery’** and **’phospholipase C-activating G-protein coupled receptor signaling pathway’**. **[Detailed Mechanism]**: From a clinical perspective, **’internal carotid artery’** forms a biological interaction network with **migraine**, **’migraine’** represents a condition where **Cyproheptadine** is administered for symptomatic relief or cure, **’Cyproheptadine’** forms a biological interaction network with **HTR2A**, **’HTR2A’** is involved in **phospholipase C-activating G-protein coupled receptor signaling pathway**, regulating physiological homeostasis. Furthermore ultimately leading to this conclusion.
Rejected candidate 2 This path represents a key hypothesis explaining the biological causality between **’internal carotid artery’** and **’phospholipase C-activating G-protein coupled receptor signaling pathway’**. **[Detailed Mechanism]**: From a clinical perspective, **’internal carotid artery’** forms a biological interaction network with **migraine**, **’migraine’** represents a condition where **Methylergometrine** is administered for symptomatic relief or cure, **’Methylergometrine’** forms a biological interaction network with **HTR2A**, **’HTR2A’** is involved in **phospholipase C-activating G-protein coupled receptor signaling pathway**, regulating physiological homeostasis. Furthermore ultimately leading to this conclusion.
Rejected candidate 3 This path represents a key hypothesis explaining the biological causality between **’internal carotid artery’** and **’phospholipase C-activating G-protein coupled receptor signaling pathway’**. **[Detailed Mechanism]**: From a clinical perspective, **’internal carotid artery’** forms a biological interaction network with **migraine**, **’migraine’** represents a condition where **Cyclobenzaprine** is administered for symptomatic relief or cure, **’Cyclobenzaprine’** forms a biological interaction network with **HTR2A**, **’HTR2A’** is involved in **phospholipase C-activating G-protein coupled receptor signaling pathway**, regulating physiological homeostasis. Furthermore ultimately leading to this conclusion.
Table 17: Path-only view of the candidate pool in Table [tbl:tab:generated95candidate95example]. All four candidates share the same Anatomy, Disease, Gene, and Biological Process nodes, while differing only in the Compound node (bold), illustrating the entity-slot resolution at which preference learning must operate.
Preference label Candidate path
Chosen internal carotid artery \(\rightarrow\) migraine \(\rightarrow\) Ergotamine \(\rightarrow\) HTR2A \(\rightarrow\) phospholipase C-activating GPCR signaling pathway
Rejected 1 internal carotid artery \(\rightarrow\) migraine \(\rightarrow\) Cyproheptadine \(\rightarrow\) HTR2A \(\rightarrow\) phospholipase C-activating GPCR signaling pathway
Rejected 2 internal carotid artery \(\rightarrow\) migraine \(\rightarrow\) Methylergometrine \(\rightarrow\) HTR2A \(\rightarrow\) phospholipase C-activating GPCR signaling pathway
Rejected 3 internal carotid artery \(\rightarrow\) migraine \(\rightarrow\) Cyclobenzaprine \(\rightarrow\) HTR2A \(\rightarrow\) phospholipase C-activating GPCR signaling pathway

References↩︎

[1]
J. Wei et al., “Chain of thought prompting elicits reasoning in large language models,” in Advances in neural information processing systems, 2022, [Online]. Available: https://openreview.net/forum?id=_VjQlMeSB_J.
[2]
DeepSeek-AI, DeepSeek-R1: Incentivizing reasoning capability in LLMs via reinforcement learning,” arXiv preprint arXiv:2501.12948, 2025.
[3]
A. Jaech et al., “Openai o1 system card,” arXiv preprint arXiv:2412.16720, 2024.
[4]
J. Uesato et al., “Solving math word problems with process- and outcome-based feedback,” arXiv preprint arXiv:2211.14275, 2022.
[5]
H. Lightman et al., “Let’s verify step by step,” in The twelfth international conference on learning representations, 2023.
[6]
P. Wang et al., “Math-shepherd: Verify and reinforce LLMs step-by-step without human annotations,” in Proceedings of the 62nd annual meeting of the association for computational linguistics (volume 1: Long papers), 2024, pp. 9426–9439.
[7]
Y. Wang et al., “Self-instruct: Aligning language models with self-generated instructions,” in Proceedings of the 61st annual meeting of the association for computational linguistics (volume 1: Long papers), Jul. 2023, pp. 13484–13508, doi: 10.18653/v1/2023.acl-long.754.
[8]
C. Xu et al., “WizardLM: Empowering large pre-trained language models to follow complex instructions,” in The twelfth international conference on learning representations, 2024, [Online]. Available: https://openreview.net/forum?id=CfXh93NDgH.
[9]
A. Gudibande et al., “The false promise of imitating proprietary LLMs.” 2023, [Online]. Available: https://arxiv.org/abs/2305.15717.
[10]
I. Shumailov, Z. Shumaylov, Y. Zhao, N. Papernot, R. Anderson, and Y. Gal, AI models collapse when trained on recursively generated data,” Nature, vol. 631, no. 8022, pp. 755–759, 2024.
[11]
H. Riaz, S. S. Bhabesh, V. Arannil, M. Ballesteros, and G. Horwood, MetaSynth: Meta-prompting-driven agentic scaffolds for diverse synthetic data generation,” in Findings of the association for computational linguistics: ACL 2025, Jul. 2025, pp. 18770–18803, doi: 10.18653/v1/2025.findings-acl.962.
[12]
R. Rafailov, A. Sharma, E. Mitchell, C. D. Manning, S. Ermon, and C. Finn, “Direct preference optimization: Your language model is secretly a reward model,” in Advances in neural information processing systems, 2023.
[13]
R. Rafailov, J. Hejna, R. Park, and C. Finn, “From \(r\) to \(Q^*\): Your language model is secretly a Q-function,” arXiv preprint arXiv:2404.12358, 2024.
[14]
Y. Zeng, G. Liu, W. Ma, N. Yang, H. Zhang, and J. Wang, “Token-level direct preference optimization,” in Proceedings of the 41st international conference on machine learning, 2024.
[15]
W. Zhou, S. Zhang, L. Zhao, and T. Meng, T-REG: Preference optimization with token-level reward regularization,” in Proceedings of the 63rd annual meeting of the association for computational linguistics (volume 1: Long papers), 2025.
[16]
X. Tan, X. Wang, Q. Liu, X. Xu, X. Yuan, and W. Zhang, “Paths-over-graph: Knowledge graph empowered large language model reasoning,” in Proceedings of the ACM on web conference 2025, 2025, pp. 3505–3522, doi: 10.1145/3696410.3714892.
[17]
J. Sun et al., “Think-on-graph: Deep and responsible reasoning of large language model on knowledge graph,” in The twelfth international conference on learning representations, 2024.
[18]
L. Luo, Y.-F. Li, G. Haffari, and S. Pan, “Reasoning on graphs: Faithful and interpretable large language model reasoning,” in The twelfth international conference on learning representations, 2024.
[19]
J. Wang et al., “Learning to plan for retrieval-augmented large language models from knowledge graphs,” in Findings of the association for computational linguistics: EMNLP 2024, Nov. 2024, pp. 7813–7835, doi: 10.18653/v1/2024.findings-emnlp.459.
[20]
C. Gardent, A. Shimorina, S. Narayan, and L. Perez-Beltrachini, “The WebNLG challenge: Generating text from RDF data,” in Proceedings of the 10th international conference on natural language generation, Sep. 2017, pp. 124–133, doi: 10.18653/v1/W17-3518.
[21]
O. Agarwal, H. Ge, S. Shakeri, and R. Al-Rfou, “Knowledge graph based synthetic corpus generation for knowledge-enhanced language model pre-training,” in Proceedings of the 2021 conference of the north american chapter of the association for computational linguistics: Human language technologies, Jun. 2021, pp. 3554–3565, doi: 10.18653/v1/2021.naacl-main.278.
[22]
K. Yang, Z. Liu, Q. Xie, J. Huang, E. Min, and S. Ananiadou, “Selective preference optimization via token-level reward function estimation,” in Proceedings of the 2025 conference on empirical methods in natural language processing, Nov. 2025, pp. 7032–7056, doi: 10.18653/v1/2025.emnlp-main.359.
[23]
F. Christopoulou, R. Cardenas, G. Lampouras, H. Bou Ammar, and J. Wang, SparsePO: Controlling preference alignment of LLMs via sparse token masks,” in Findings of the association for computational linguistics: EMNLP 2025, Nov. 2025, pp. 25477–25503, doi: 10.18653/v1/2025.findings-emnlp.1389.
[24]
N. Yang, H. Lin, Y. Liu, B. Tian, G. Liu, and H. Zhang, “Token-importance guided direct preference optimization,” in The fourteenth international conference on learning representations, 2026, [Online]. Available: https://openreview.net/forum?id=cMEnMVvMw9.
[25]
A. Liu et al., TIS-DPO: Token-level importance sampling for direct preference optimization with estimated weights,” in The thirteenth international conference on learning representations, 2025.
[26]
H. Luo et al., WizardMath: Empowering mathematical reasoning for large language models via reinforced evol-instruct,” arXiv preprint arXiv:2308.09583, 2023.
[27]
M. N. Uddin, E. R. George, E. Blanco, and S. Corman, “Generating uncontextualized and contextualized questions for document-level event argument extraction,” in Proceedings of the 2024 conference of the north american chapter of the association for computational linguistics: Human language technologies (volume 1: Long papers), Jun. 2024, pp. 5612–5627, doi: 10.18653/v1/2024.naacl-long.312.
[28]
J. H. Cho, J. Oh, M. Kim, and B.-J. Lee, “Rethinking DPO: The role of rejected responses in preference misalignment,” in Findings of the association for computational linguistics: EMNLP 2025, Nov. 2025, pp. 8159–8176, doi: 10.18653/v1/2025.findings-emnlp.433.
[29]
F. Song et al., “Preference ranking optimization for human alignment,” in Proceedings of the thirty-eighth AAAI conference on artificial intelligence and thirty-sixth conference on innovative applications of artificial intelligence and fourteenth symposium on educational advances in artificial intelligence, 2024, doi: 10.1609/aaai.v38i17.29865.
[30]
T. Liu et al., LiPO: Listwise preference optimization through learning-to-rank,” in Proceedings of the 2025 conference of the nations of the americas chapter of the association for computational linguistics: Human language technologies (volume 1: Long papers), Apr. 2025, pp. 2404–2420, doi: 10.18653/v1/2025.naacl-long.121.
[31]
M. Zhu, X. Chen, Z. Wang, B. Yu, H. Zhao, and J. Jia, TGDPO: Harnessing token-level reward guidance for enhancing direct preference optimization,” in Proceedings of the 42nd international conference on machine learning, 2025.
[32]
J. Wu et al., OCEAN: Offline chain-of-thought evaluation and alignment in large language models,” in The thirteenth international conference on learning representations, 2025, [Online]. Available: https://openreview.net/forum?id=rlgplAuN2p.
[33]
S. Dernbach, K. Agarwal, A. Zuniga, M. Henry, and S. Choudhury, GLaM: Fine-tuning large language models for domain knowledge graph alignment via neighborhood partitioning and generative subgraph encoding,” in Proceedings of the AAAI symposium series, 2024.
[34]
D. Hendrycks et al., “Measuring massive multitask language understanding,” in International conference on learning representations, 2021, [Online]. Available: https://openreview.net/forum?id=d7KBjmI3GmQ.
[35]
Y. Wang et al., “MMLU-pro: A more robust and challenging multi-task language understanding benchmark,” in Advances in neural information processing systems, 2024, vol. 37, pp. 95266–95290, doi: 10.52202/079017-3018.
[36]
D. Jin, E. Pan, N. Oufattole, W.-H. Weng, H. Fang, and P. Szolovits, “What disease does this patient have? A large-scale open domain question answering dataset from medical exams,” Applied Sciences, vol. 11, no. 14, 2021, doi: 10.3390/app11146421.
[37]
Q. Jin, B. Dhingra, Z. Liu, W. Cohen, and X. Lu, PubMedQA: A dataset for biomedical research question answering,” in Proceedings of the 2019 conference on empirical methods in natural language processing and the 9th international joint conference on natural language processing (EMNLP-IJCNLP), Nov. 2019, pp. 2567–2577, doi: 10.18653/v1/D19-1259.
[38]
D. Rein et al., GPQA: A graduate-level google-proof q&a benchmark,” in First conference on language modeling, 2024, [Online]. Available: https://openreview.net/forum?id=Ti67584b98.
[39]
X. Song et al., CS-bench: A comprehensive benchmark for large language models towards computer science mastery,” in The thirteenth international conference on learning representations, 2025, [Online]. Available: https://openreview.net/forum?id=fjEZ2LPceZ.
[40]
Y. Luo, Z. Yang, F. Meng, Y. Li, J. Zhou, and Y. Zhang, “An empirical study of catastrophic forgetting in large language models during continual fine-tuning,” IEEE Transactions on Audio, Speech and Language Processing, 2025.
[41]
P.-N. Kung and N. Peng, “Do models really learn to follow instructions? An empirical study of instruction tuning,” in Proceedings of the 61st annual meeting of the association for computational linguistics (volume 2: Short papers), Jul. 2023, pp. 1317–1328, doi: 10.18653/v1/2023.acl-short.113.
[42]
B. Jin et al., “Graph chain-of-thought: Augmenting large language models by reasoning on graphs,” in Findings of the association for computational linguistics: ACL 2024, Aug. 2024, pp. 163–184, doi: 10.18653/v1/2024.findings-acl.11.

  1. Corresponding author.↩︎