---
title: Interaction Graph Semantic-Logical Score (IGS)
url: https://www.emergentmind.com/topics/interaction-graph-semantic-logical-score-igs
type: topic
---

# Interaction Graph Semantic-Logical Score (IGS)

Searching arXiv for the specified papers to ground the article.
Interaction Graph Semantic-Logical Score (IGS) is a graph-based scoring construct used to compare structured dependencies and semantic content beyond surface similarity. In the cited literature, the term is used for two distinct formulations. In GraphIC, IGS is a query-anchored, asymmetric similarity score for in-context example retrieval in multi-step reasoning, derived from a Bayesian Network likelihood on a thought graph [2410.02203]. In a quantum-circuit integrity framework, IGS is a pre-execution score defined from normalized discrepancies between interaction graphs of a candidate circuit and a reference circuit, and is positioned alongside the Structural Integrity Score (SIS) and the Operational Integrity Score (OIS) [2604.26430]. Both formulations emphasize interaction patterns, dependency order, and semantics carried by graph structure rather than direct text cosine similarity or structure-only comparison.

## 1. Scope and naming

The two reported uses of IGS differ in objective, graph construction, and mathematical form, while sharing the assumption that a graph can encode semantic-logical dependencies more faithfully than flat representations.

| Setting | Graph object | Score form |
|---|---|---|
| Multi-step reasoning retrieval | Thought graph \(G=(V,E,A)\) | \(S(G_q,G_c)=\alpha_c^\top X_q^\top Z_q \beta_c\) |
| Quantum-circuit integrity | Labeled DAG \(G(C)=(V,E,\lambda_V,\lambda_E)\) | \(IGS(C,C_{ref})=1-\Delta_{IGS}\) |

In GraphIC, the graph is built from a formalized reasoning representation (FRR) or, for code, from a control-flow graph; the score is asymmetric because candidate parameters are applied to the query graph [2410.02203]. In the quantum-circuit framework, the graph is a labeled directed acyclic graph whose nodes are operations and whose edges encode shared-qubit precedence; the score is symmetric in presentation as a discrepancy from a reference artifact, although the framework itself is oriented around candidate-versus-reference validation [2604.26430].

## 2. GraphIC formulation: thought graphs, aggregation, and asymmetric scoring

GraphIC defines a thought graph for any example or query as a directed, vertex-attributed graph \(G=(V,E,A)\), where \(V=\{v_1,\dots,v_n\}\) are reasoning units, \(E\subseteq V\times V\) are directed dependencies, and \(A\) contains node text, node embeddings \(x_i\in\mathbb{R}^{n_f}\), and, for math, logic, and proofs, an operation label \(o_i\) [2410.02203]. Each vertex corresponds to an operation or intermediate conclusion in natural-language reasoning, or to a code block or basic block in code tasks. The adjacency matrix is binary, \(A_{ij}=1\) if \((v_i\to v_j)\in E\), and \(\deg(v_j)\) is the in-degree of \(v_j\).

For math and logical reasoning, GraphIC generates an FRR with an LLM and parses lines of the exact form
\[
\texttt{Output = [OperationName](input\_1, \dots, input\_n)}.
\]
The parser extracts inputs, output, and operation name, creates nodes as needed, labels the output node with the operation name, and adds directed edges from each input to the output, yielding a DAG that respects causal and temporal order. For code generation on MBPP, the paper uses `staticfg` to parse Python into a control-flow graph, anonymizes identifiers, and computes node features with CodeBERT [2410.02203].

After parsing, node embeddings are stacked into
\[
X^{(0)}=X=(x_1,\dots,x_n)^\top\in\mathbb{R}^{n\times n_f}.
\]
GraphIC then performs graph-dependent aggregation with a Personalized PageRank-style mixture of forward propagation and return-to-sources:
\[
\tilde A=\tilde D_A^{-1/2}(A+I)\tilde D_A^{-1/2},\qquad
\tilde D_A=\operatorname{diag}\!\left(1+\sum_j A_{ij}\right),
\]
\[
B_{ij}=1\ \text{if}\ \deg(v_j)=0,\ \text{else}\ 0,\qquad
\tilde B=\tilde D_B^{-1/2}(B+I)\tilde D_B^{-1/2},
\]
\[
\tilde D_B=\operatorname{diag}\!\left(1+\sum_j B_{ij}\right),
\]
\[
X^{(h+1)}=\big[(1-\lambda)\tilde A+\lambda \tilde B\big]X^{(h)},\qquad X^{(0)}=X,
\]
\[
Z=\big[(1-\lambda)\tilde A+\lambda \tilde B\big]^H X.
\]
This recurrence propagates and smooths node features along ordered dependency paths while allowing periodic revisits to root or earlier nodes, which the paper describes as capturing sequential and temporal patterns in multi-step reasoning [2410.02203].

The score is then derived from a Bayesian Network conditional model on aggregated features. With \(z_i\) the \(i\)-th row of \(Z\),
\[
p(x_i\mid \operatorname{pa}(v_i))=g(\operatorname{dist}(x_i,\hat x_i)),\qquad \hat x_i=W z_i.
\]
GraphIC uses
\[
\operatorname{dist}(x_1,x_2)=l-x_1^\top x_2,\qquad
l=\max_{t\in NL}\operatorname{Emb}(t)^\top \operatorname{Emb}(t),
\]
\[
g_i(u)=\frac{1}{C_i}\exp(-u),
\]
so that
\[
p(x_i;G,X)=\frac{1}{C_i}\exp\!\left[-\big(l-z_i^\top W^\top x_i\big)\right].
\]
The joint log-likelihood, up to constants, is
\[
\log L_W=-\sum_i \log C_i-nl+\operatorname{tr}(ZW^\top X^\top).
\]

To avoid non-uniqueness and reduce computation, GraphIC constrains \(W\) to rank \(1\),
\[
W=\alpha\beta^\top,\qquad \|\alpha\|_2=\|\beta\|_2=1,
\]
which yields the optimization
\[
\max_{\alpha,\beta}\ \alpha^\top X^\top Z\beta\qquad
\text{s.t.}\ \|\alpha\|_2=\|\beta\|_2=1.
\]
The closed-form solution is given by the top singular vectors of \(X^\top Z\): if \(U,\Sigma,V=\operatorname{SVD}(X^\top Z)\), then \(\alpha=U[0,:]\) and \(\beta=V[0,:]\). For a candidate \(c\), the fitted parameters \((\alpha_c,\beta_c)\) are estimated from \((X_c,Z_c)\), and for a query \(q\), the Interaction Graph Semantic-Logical Score is
\[
S(G_q,G_c):=\alpha_c^\top X_q^\top Z_q \beta_c.
\]
The paper explicitly states that IGS is inherently asymmetric,
\[
S(G_q,G_c)\neq S(G_c,G_q),
\]
because candidate parameters are applied to the query’s features and structure. This directionality is presented as important for retrieval, since the relevant question is whether a candidate’s thought pattern is useful for the query rather than whether the reverse holds [2410.02203].

## 3. Retrieval workflow and empirical profile in GraphIC

GraphIC uses an offline-online retrieval procedure. Offline, for each candidate example, the system generates an FRR with an LLM, parses it to \(G_c=(V_c,E_c)\), builds node embeddings \(X_c\), removes numeric-only leaves if present in math and logic tasks, computes \(Z_c\) with the aggregation rule above, computes \((\alpha_c,\beta_c)\) from the top singular vectors of \(X_c^\top Z_c\), and stores those parameters with candidate metadata. Online, for a query \(q\), the system generates an FRR, constructs \(G_q\), \(X_q\), and \(Z_q\), then scores each candidate with
\[
s_c=S(G_q,G_c)=\alpha_c^\top X_q^\top Z_q \beta_c.
\]
The paper notes an implementation shortcut:
\[
u_c=X_q\alpha_c\in\mathbb{R}^n,\qquad v_c=Z_q\beta_c\in\mathbb{R}^n,\qquad s_c=u_c^\top v_c,
\]
which avoids materializing \(X_q^\top Z_q\) [2410.02203].

The reported complexity is \(O(H(m+n)n_f)\) for aggregation with sparse adjacency, where \(n\) is the number of nodes, \(m=|E|\), \(n_f\) is the embedding dimension, and \(H\) is the propagation depth. Scoring one candidate for one query requires two matrix-vector multiplies and one dot product, with costs \(O(nn_f)\), \(O(nn_f)\), and \(O(n)\), respectively. Memory usage is reduced by storing only \((\alpha_c,\beta_c)\in\mathbb{R}^{n_f\times 2}\) per candidate and \(X_q,Z_q\) for the current query. For very large candidate pools, the paper suggests pre-filtering by a cheap similarity such as FRR-text BERT cosine, caching \(X_q\) and \(Z_q\), and parallelizing candidate scoring.

In integration into in-context learning, the candidate bank is precomputed per dataset or task. At inference time, the system constructs \(G_q\), \(X_q\), and \(Z_q\), computes \(s_c\) for all candidates, selects the top-\(k\), formats them into prompts with dataset-specific templates, and submits the prompt to the target LLM. The reported settings use BERT-base-uncased for math and logic, CodeBERT for code, \(H=3\), \(\lambda\in\{0,0.1,0.2,0.3\}\) chosen per dataset and LLM, typically \(k=8\), and temperature \(10^{-5}\) in the reported experiments [2410.02203].

Empirically, across GSM8K, AQUA, MBPP, and ProofWriter with GPT-4o-mini and Llama-3.1-8B-Instruct, GraphIC’s IGS-based retrieval consistently outperforms 10 baseline methods. With GPT-4o-mini, the paper reports that GraphIC exceeds the best training-free baseline by \(2.57\%\) and the best training-based baseline by \(1.18\%\) on average; on AQUA it reaches \(73.62\%\) versus \(72.44\%\) for the best training-based system. With Llama-3.1-8B-Instruct, GraphIC ranks first on GSM8K, AQUA, and ProofWriter, improving over the best training-free baseline by \(4.29\%\) and the best training-based baseline by \(2.5\%\) on average. An additional GSM8K experiment with GPT-3.5-Turbo reports \(82.79\%\) for GraphIC versus \(82.10\%\) for the best baseline. Ablations link the gains to the graph construction, the PPR-style aggregation, and the BN likelihood: on GSM8K with Llama-3.1-8B-Instruct, text-only BERT embeddings yield \(74.15\), FRR embeddings without graph yield \(78.31\), graph-only aggregation yields \(78.46\), and Graph + PPR + BN reaches \(79.98\). The same section reports that adding PPR with \(\lambda>0\) yields consistent improvements, for example AQUA \(54.72\to 56.30\), and that the full BN likelihood with rank-1 parameterization performs best across datasets. The asymmetry claim is also validated empirically by comparing GraphIC’s score matrices with a ground-truth usefulness matrix \(S_{gt}\), which is itself asymmetric [2410.02203].

## 4. Quantum-circuit IGS: interaction graphs and discrepancy decomposition

In the quantum-circuit integrity framework, each circuit is represented pre-execution as a labeled directed acyclic graph
\[
G(C)=(V,E,\lambda_V,\lambda_E),
\]
where \(V\) is the set of quantum operations, \(E\subseteq V\times V\) are dependency edges induced by shared-qubit usage and execution order, \(\lambda_V\) assigns node attributes, and \(\lambda_E\) may annotate edges with the qubit that induces the dependency [2604.26430]. Node attributes include gate family or type \(\tau(v)\in\Gamma\), arity \(a(v)\), qubit set \(Q(v)\), role or port map \(\rho(v)\), topological layer index \(t(v)\), unitary fingerprint \(\phi(v)\in\mathbb{R}^6\), and measurement/reset flags \(\chi_{\text{meas}}(v)\), \(\chi_{\text{reset}}(v)\).

Edges are built with a linear-time shared-qubit strategy. For each qubit \(q\), one defines the ordered list
\[
S_q(C)=(v_{q,1},v_{q,2},\dots,v_{q,k_q})
\]
of nodes acting on \(q\) in textual or compiled order, and adds edges \((v_{q,i},v_{q,i+1})\) for \(i=1,\dots,k_q-1\). The union of these per-qubit chains yields \(E\) and guarantees acyclicity. The paper also makes explicit the matrices \(A(C)\) for adjacency, \(H(C)\) for node-qubit incidence, undirected two-qubit interaction counts \(P(C)\), directed control-target interaction counts \(Q(C)\), per-qubit usage vector \(u(C)\), and the ordering bigram multiset \(B(C)\) formed from adjacent gate-family pairs along each \(S_q(C)\). The stated semantic-logical content includes gate semantics via \(\tau\), arity, \(\phi\), and \(\rho\); logical dependencies via \(E\), \(t\), and \(A(C)\); entanglement and interaction structure via \(P(C)\) and \(Q(C)\); and classical effects via the measurement and reset flags [2604.26430].

The quantum-circuit IGS is defined as
\[
IGS(C,C_{ref})=1-\Delta_{IGS}(C,C_{ref}),
\]
with
\[
\Delta_{IGS}(C,C_{ref})=w_e D_{edge}+w_n D_{node}+w_o D_{order}+w_i D_{inter}+w_u D_{usage},
\]
subject to
\[
w_e+w_n+w_o+w_i+w_u=1.
\]
The work initializes the weights as
\[
w_e=0.15,\quad w_n=0.35,\quad w_o=0.20,\quad w_i=0.20,\quad w_u=0.10,
\]
thereby emphasizing node semantics.

The five discrepancy terms are normalized to \([0,1]\). The topology discrepancy is a Jaccard distance on edge sets,
\[
D_{edge}=1-\frac{|E\cap E'|}{|E\cup E'|},
\]
with \(0/0=0\) when both sets are empty. The node semantic discrepancy is a cosine distance between family-aggregated fingerprint vectors. For each \(g\in\Gamma\), with \(v_g(C)=\{v\in V(C):\tau(v)=g\}\),
\[
\mu_g(C)=\frac{1}{\max\{1,|v_g(C)|\}}\sum_{v\in v_g(C)}\phi(v),
\]
and \(x(C)\in\mathbb{R}^{6|\Gamma|}\) is formed by concatenating these family means. Then
\[
D_{node}=1-\frac{\langle x(C),x(C_{ref})\rangle}{\|x(C)\|_2\|x(C_{ref})\|_2},
\]
with \(D_{node}=0\) if both vectors are zero.

The order discrepancy compares local gate-order patterns through multiset Jaccard distance on bigrams,
\[
D_{order}=1-\frac{|B\cap B'|}{|B\cup B'|}.
\]
The interaction discrepancy combines undirected and directed two-qubit interaction differences:
\[
d_{und}=1-\frac{\langle \operatorname{vec}(P),\operatorname{vec}(P_{ref})\rangle}{\|\operatorname{vec}(P)\|_2\|\operatorname{vec}(P_{ref})\|_2},
\]
\[
d_{dir}=1-\frac{\langle \operatorname{vec}(Q),\operatorname{vec}(Q_{ref})\rangle}{\|\operatorname{vec}(Q)\|_2\|\operatorname{vec}(Q_{ref})\|_2},
\]
with zero if both norms are zero, and
\[
D_{inter}=0.5\,d_{und}+0.5\,d_{dir}.
\]
Finally, with normalized usage distributions \(p=u(C)/\|u(C)\|_1\) and \(q=u(C_{ref})/\|u(C_{ref})\|_1\),
\[
D_{usage}=\frac{1}{2}\|p-q\|_1.
\]
By construction, \(0\le D_{\cdot}\le 1\), hence \(0\le \Delta_{IGS}\le 1\) and \(IGS\in[0,1]\). The paper states that \(IGS=1\) indicates exact agreement in all five components [2604.26430].

## 5. Role in circuit integrity evaluation and representative behaviors

The quantum-circuit framework places IGS between SIS and OIS. SIS is defined from normalized relative deviations of gate count, depth, two-qubit gate count, and DAG topology:
\[
\Delta_{struct}(C,C_{ref})=w_g\delta_{gate}+w_d\delta_{depth}+w_c\delta_{2q}+w_t\delta_{topo},\qquad
SIS(C,C_{ref})=1-\Delta_{struct}(C,C_{ref}).
\]
OIS is defined from the Jensen–Shannon distance between output distributions:
\[
D_{KL}(p\|r)=\sum_i p(i)\log_2\!\frac{p(i)}{r(i)},
\]
\[
M=\frac{p+q}{2},\qquad
D_{JS}(p,q)=\frac{1}{2}D_{KL}(p\|M)+\frac{1}{2}D_{KL}(q\|M),
\]
\[
JSD(p,q)=\sqrt{D_{JS}(p,q)},\qquad
OIS(C,C_{ref})=1-JSD(p,q).
\]
Within this three-metric framework, SIS is described as fast and coarse, OIS as behaviorally definitive but execution-dependent, and IGS as the pre-execution metric intended to detect interaction-level anomalies that are invisible to global structure but often predictive of behavioral issues [2604.26430].

The paper gives several concrete case analyses. In a Bell-state preparation circuit with a control-target flip, \(H(0);CX(0\to 1)\) versus \(H(0);CX(1\to 0)\), the per-qubit adjacency and ordering remain unchanged, so \(D_{edge}\approx 0\) and \(D_{order}\approx 0\), and the undirected interaction matrix \(P\) is identical; however the directed interaction matrix \(Q\) changes, so \(d_{dir}=1\) and \(D_{inter}=0.5\). With illustrative \(D_{node}\approx 0.6\) and the default weights, the paper computes \(IGS=0.69\), while noting that SIS could be approximately \(1\). In a commutation-preserving reorder across disjoint qubits, such as \(RX(0,\theta);RZ(1,\phi)\) versus \(RZ(1,\phi);RX(0,\theta)\), the paper reports \(D_{edge}=D_{order}=D_{inter}=D_{usage}=D_{node}=0\), hence \(IGS=1\). In an early measurement insertion example, moving \(MEAS(0)\) ahead of \(CX(0\to 1)\) changes \(B\) and \(E\), may change \(P\) and \(Q\), and can alter \(u\), so the net effect is a substantial IGS drop. A qubit-permutation case is described as dependent on whether strict label matching or permutation-aware matching is used; the reported experiments use strict index matching [2604.26430].

The empirical role of IGS is clearest in structural blind-spots, defined as cases with \(SIS\ge 0.95\). On a QASMBench-derived dataset with 133 circuits, eight anomaly types, and three severities \(0.1/0.3/0.6\), OIS detects anomalies in \(93.85\%\) of blind-spot instances, while IGS detects \(72.58\%\) over 569 cases. The detection rate of IGS increases with severity, from \(64.07\%\) to \(74.83\%\) to \(85.81\%\). The paper presents these figures as evidence that high structural similarity does not ensure behavioral equivalence and that IGS provides additional pre-execution sensitivity [2604.26430].

## 6. Assumptions, calibration, and limitations

The two formulations attach different operational assumptions to IGS. In GraphIC, performance depends on the quality of the FRR, on the graph parser, and on the rank-1 Bayesian Network parameterization. The paper states that the rank-1 constraint \(W=\alpha\beta^\top\) may underfit more intricate patterns, and identifies higher-rank \(W\) or learned similarity functions as natural extensions. It also identifies FRR quality as a bottleneck: mis-parses or missing steps degrade graph fidelity, and improvements in FRR prompting, parsers, or light validation can mitigate the problem. For very large candidate pools, the paper recommends multi-stage retrieval with a cheap prefilter followed by IGS re-ranking [2410.02203].

In the quantum-circuit setting, IGS is explicitly pre-execution: semantics are derived statically from known gate unitaries, parameters, qubit usage, and order, without sampling quantum states or output distributions. The paper states that IGS is robust to backend differences so long as gate-family encodings and role semantics are preserved, but that aggressive re-synthesis, routing with SWAP insertion, and basis changes will shift \(P\), \(Q\), \(\phi\), and \(B\), thereby reducing IGS even when behavior is preserved. This is described as a deliberate design choice for interaction-level anomaly detection before execution. The paper also notes the converse limitation that subtle semantic errors not reflected in the aggregated fingerprints may escape detection [2604.26430].

Calibration is correspondingly task-specific. In the quantum-circuit study, anomaly detection in structural blind-spots uses a fixed threshold of \(0.95\), with scores below \(0.95\) counted as detections. The practical guidance keeps \(w_n\) relatively large, uses \(w_o\approx w_i\approx 0.2\), \(w_e\approx 0.1\)–\(0.2\), and \(w_u\approx 0.1\), and suggests tightening thresholds for high-assurance settings or relaxing them for broader triage. In GraphIC, the recommended starting point is \(H=3\) and \(\lambda\in\{0.0,0.1,0.2,0.3\}\), with larger \(\lambda\) favoring revisits to early premises and smaller \(\lambda\) emphasizing local forward flow [2604.26430] [2410.02203].

Taken together, the two reported uses of IGS show that the name denotes a family of graph-centered scoring ideas rather than a single canonical formula. In GraphIC, IGS is an asymmetric structure-first retrieval score for selecting in-context examples whose thought patterns explain a query’s multi-step trajectory. In quantum-circuit validation, IGS is a normalized interaction-level integrity score that complements structural and behavioral metrics by detecting ordering, role, and interaction anomalies before execution.

Source: https://www.emergentmind.com/topics/interaction-graph-semantic-logical-score-igs