---
title: Bidirectional Search & Pullback-Based Verification
url: https://www.emergentmind.com/topics/bidirectional-search-and-pullback-based-verification
type: topic
---

# Bidirectional Search & Pullback-Based Verification

Bidirectional search and pullback-based verification constitute the core of Self-Querying Bidirectional Categorical Planning (SQ-BCP), designed for high-fidelity inference-time planning under partial observability with large language models. SQ-BCP explicitly models and resolves underspecified preconditions via self-querying and bridging hypotheses, executes bidirectional (forward–backward) search through a task category, and globally verifies goal compatibility using categorical pullbacks. This method achieves significant reductions in resource-violation rates compared to prior baselines, ensuring generated plans are both executable and goal-compatible when hard constraints and global compatibility are satisfied [2601.20014].

## 1. Bidirectional Search Architecture

SQ-BCP maintains two simultaneously expanding frontiers:
- \(G_F\): forward-searching from the known initial state \(w_0\)
- \(G_B\): backward-searching from the goal specification \(w^*\)

Each frontier node is a “state object” \(w=(r,s,\ell,t)\), where:
- \(r\in\mathbb{N}^m\): resource vector,
- \(s\in\Sigma^*\): structural/categorical description,
- \(\ell\in\{0,1\}^n\): logical predicates,
- \(t\in\mathbb{R}\): time budget.

Edges correspond to fully refined hypothesis-morphisms \(h\) whose preconditions \(\{(p_j,\lambda_j)\}\) have all unknowns (\(Unk\)) resolved. Candidate morphisms \(h\) are scored using a weighted sum distance metric:
\[
D(w, w') = \alpha_s d_s(s, s') + \alpha_r \|r - r'\|_1 + \alpha_\ell d_\ell(\ell, \ell') + \alpha_t d_t(t, t')
\]
with pruning below a threshold \(\theta_{\min}\) via a softmax-style measure:
\[
\mathit{score}(h) = \exp\left(-D(\Apply(h, w), w^*)/\tau\right)
\]

Meeting-in-the-middle (MIM) occurs when forward state \(w_f\) and backward state \(w_b\) satisfy:
\[
\|r_f - r_b\|_1 < \delta_r,\quad d_s(s_f, s_b) < \delta_s,\quad d_\ell(\ell_f, \ell_b) < \delta_\ell, \quad d_t(t_f, t_b) < \delta_t
\]
This triggers pullback-based verification.

Algorithmic steps are formally specified in Algorithm 1 in [2601.20014], emphasizing strict insertion of only feasible, fully-checked morphisms and prioritized expansion, with fairness and termination established under bounded branching and refinement depth.

## 2. Category-Theoretic Planning Formalism

Planning is formulated in a category \(\mathcal{T}\) whose objects are compound state representations \(w=(r,s,\ell,t)\). Morphisms \(f\colon w \rightarrow w'\) implement typed effects, subject to deterministic hard constraints:
\[
r' = r + \Delta r,\quad s' = f_s(s),\quad \ell' = \ell \oplus \Delta\ell,\quad t' = t + \Delta t
\]
Precondition sets are
\[
Pre(h) = \{(p_j, \lambda_j)\},\quad \lambda_j \in \{Sat, Viol, Unk\}
\]
with the unresolved set
\[
U(w,h) = \{\,p_j : (p_j, Unk) \in Pre(h)\,\}
\]
Morphisms are considered admissible for expansion only when all preconditions are labeled as \(Sat\) and hard constraints are met.

This categorical formalization enables categorical pullback constructions for global verification and introduces rigorous semantics for task composition and compatibility.

## 3. Pullback-Based Global Verification

Upon bidirectional frontier intersection, compatibility is not established via local constraints alone, but instead via a categorical pullback in \(\mathcal{T}\). The constraint datum object \(C\) captures goal requirements, with projection morphisms \(C_f: w_f \to C\) and \(C^*: w^* \to C\).

The pullback square:
\[
\begin{tikzcd}
P \arrow[r,"\pi_1"] \arrow[d,"\pi_2"'] & w_f \arrow[d,"C_f"] \\
w^* \arrow[r,"C^*"'] & C
\end{tikzcd}
\]
guarantees, by the universal property, a unique factorization for any compatible pair \((w_f, w^*)\), certifying that the plan chain from initial to goal state is compatible with all hard constraints and goal data.

PullbackVerify returns success if a pullback \(P\) exists with all induced maps satisfying the relevant constraints. The verification theorem establishes that, given preconditions along the chain are resolved to \(Sat\), all hard intermediate checks pass, and PullbackVerify holds, the chain is categorically compatible with the goal state [2601.20014]. Completeness and progress (termination with valid output) are guaranteed under bounded branching and finite refinement depth.

## 4. Deterministic Unknown Precondition Resolution

For candidate morphisms with unresolved preconditions (\(Unk\)), SQ-BCP employs Deterministic Refinement (Algorithm 2):
1. For each unknown \(p\), attempt up to \(T_{\rm bridge}\) “bridging” actions to establish \(p\).
2. If bridging fails, issue a self-query \(Q(p)\) to an oracle/user.
3. Unknowns so queried are labeled \(Sat\) or \(Viol\); if any are \(Viol\), \(h\) is discarded.

The process guarantees termination in at most \(|U(w,h)| \cdot (T_{\rm bridge} + 1)\) steps. Cycle prevention is implemented by hashing signatures over \([w,p,Pre,Eff]\).

This approach enforces explicit precondition status propagation, providing a strong guarantee that only fully specified, feasible hypothesis-morphisms are expanded.

## 5. Empirical Results and Comparative Performance

Empirical evaluation was conducted on WikiHow and RecipeNLG task datasets with withheld preconditions, with Resource-Violation Rate (ResViol) as the principal metric:
\[
\mathrm{ResViol} = \frac{\# \text{plans using illegal resources}}{\# \text{total plans}} \times 100\%
\]
Reference similarity was measured for WikiHow using ROUGE-1 and ROUGE-2 scores, for RecipeNLG using BLEU.

Key comparative outcomes are summarized as follows:

| Method         | ROUGE-1 | ROUGE-2 | ResViol (WH) | BLEU  | ResViol (RNLG) |
|----------------|---------|---------|-------------|-------|---------------|
| Direct Prompt  | 46.3    | 42.1    | 78.3 %      | 0.897 | 65.7 %        |
| CoT            | 48.5    | 44.7    | 83.2 %      | 0.900 | 64.1 %        |
| ToT            | 52.9    | 45.2    | 94.7 %      | 0.892 | 66.5 %        |
| ReAct          | 55.8    | 47.4    | 76.9 %      | 0.912 | 59.9 %        |
| Self-Ask       | 56.1    | 47.4    | 26.0 %      | 0.913 | 15.7 %        |
| SQ-BCP         | 52.7    | 45.9    | 14.9 %      | 0.907 | 5.8 %         |

Structured precondition tracking and pullback-based verification in SQ-BCP halve resource violations relative to the best prior baseline at a minimal cost to linguistic similarity metrics. Under finite refinement and branching, completeness and soundness are theoretically guaranteed.

## 6. Significance and Broader Context

SQ-BCP demonstrates that explicit Sat/Viol/Unk semantics, deterministic precondition refinement (bridging and self-querying), and pullback-based categorical verification collectively establish a powerful framework for inference-time planning where observability is partial or incomplete. The categorical abstraction enables modularity, provides interpretable compatibility certificates, and aligns symbolic reasoning quality with deep learning-based planning in partially observable domains.

A plausible implication is that categorical methods, global symbolic verification, and explicit precondition modeling will be increasingly important for robust, executable reasoning in large language models and compositional AI systems facing incomplete specification scenarios [2601.20014].

Source: https://www.emergentmind.com/topics/bidirectional-search-and-pullback-based-verification