OrLog: Resolving Complex Queries with LLMs and Probabilistic Reasoning

Mohanna Hoveyda, Jelle Piepenbrock, Arjen P. de Vries, Maarten de Rijke, Faegheh Hasibi

TL;DR

OrLog is a novel neuro-symbolic retrieval framework that tackles complex, constraint-heavy search queries by decoupling semantic understanding from logical reasoning. By using a Large Language Model (LLM) strictly as an "uncertainty oracle" to score individual predicates and delegating the compositional logic to a probabilistic reasoning engine (ProbLog), OrLog significantly improves top-rank retrieval precision. Remarkably, it achieves these accuracy gains while slashing token generation costs by approximately 90% compared to standard LLM-as-reasoner approaches.

What Problem Does This Paper Address?

Standard search engines excel at finding documents semantically similar to a query, but they stumble when faced with complex logical constraints. Consider a query like "Museums in Paris or Amsterdam but not art museums." To answer this accurately, a system must strictly enforce the intersections (AND), unions (OR), and exclusions (NOT) embedded within the text.

Current retrieval systems either ignore these constraints entirely within their neural embeddings or rely on LLMs to perform end-to-end generative reasoning (e.g., Chain-of-Thought). However, monolithic LLM generation is computationally expensive, verbose, and notoriously prone to logical inconsistencies. Conversely, traditional neuro-symbolic methods are too rigid for information retrieval because they assume perfect, unambiguous data and complete evidence.

The authors introduce OrLog to bridge this gap, creating a framework capable of handling the messy, uncertain nature of natural language retrieval while maintaining strict logical fidelity.

Methods

OrLog splits the retrieval problem into five distinct steps, separating semantic parsing, fact-checking, and logical deduction:

  1. Candidate Retrieval: A standard sparse (BM25) or dense (E5) retriever narrows down the massive corpus to the top-$k$ candidate entities.
  2. Query Decomposition: An LLM parses the natural language query into a set of atomic predicates and a clean Boolean logical form. For example, translating the query into museum(e) AND (paris(e) OR amsterdam(e)) AND NOT art(e).
  3. Predicate Plausibility Estimation: Instead of generating free-form text, the LLM acts as an uncertainty oracle. For each candidate entity and predicate, the model runs a single, decoding-free forward pass. It extracts the raw logits for the tokens True and False and applies a softmax function to derive a normalized "plausibility score" between 0 and 1.
  4. Probabilistic Inference: These plausibility scores are fed as prior probabilities into a ProbLog program (a probabilistic logic programming engine). ProbLog computes the exact posterior probability that a given entity satisfies the full logical formula.
  5. Reranking: The candidates are sorted and returned based on their final query-satisfaction probabilities.
Overview of the OrLog framework

Datasets

The framework was evaluated using the QUEST dataset, a benchmark specifically designed for entity-seeking queries with implicit set operations. It features 1,727 test queries derived from Wikipedia category compositions, spanning seven distinct logical templates that combine intersection, union, and difference operations.

Key Insights and Ideas

  • Play to Model Strengths: LLMs are excellent at local semantic matching (determining if an entity description matches a single predicate) but struggle with complex, multi-step compositional logic. By offloading the composition to ProbLog, OrLog bypasses the LLM's logical weaknesses.
  • Disjunction is the LLM's Achilles' Heel: The authors discovered that monolithic LLMs frequently treat disjunctions (OR) as conjunctions (AND). They tend to reject perfectly valid entities because they fail to realize that satisfying just one of the alternative conditions is sufficient. OrLog’s symbolic engine handles disjunctions flawlessly.
  • The Necessity of Grounding: When the LLM relies purely on its internal weights (Parametric setup), its plausibility scores are poorly calibrated. Providing a brief text snippet or Wikipedia description (Parametric+ setup) grounds the model, drastically improving the calibration of the logits and the final ranking accuracy.

Key Results

  • Massive Efficiency Gains: Because OrLog bypasses free-form token generation during the verification step, it cuts the mean token count per query-entity pair by ~90% (dropping from 35–55 tokens down to fewer than 6 tokens).
  • Superior Precision: In the grounded setting (Parametric+), OrLog consistently outperformed monolithic LLM-as-reasoner baselines in top-rank precision ($P@1$ and $NDCG@1$).
  • Compensating for Scale: Interestingly, a smaller model (Qwen-2.5-7B) running within the OrLog framework was able to outperform a much larger monolithic model (Qwen-72B). This proves that superior post-training and a symbolic backend can effectively compensate for a lower parameter count.

Limitations and Future Work

The primary limitation of OrLog is its heavy dependence on the calibration of the LLM's logits. If the underlying model yields highly miscalibrated or noisy plausibility scores due to weak external evidence, the downstream ProbLog reasoning degrades.

To address this, the authors propose three future directions:

  1. Transitioning to DeepProbLog to jointly learn predicate plausibility and logical inference end-to-end.
  2. Replacing point probabilities with full probability distributions to better marginalize uncertainty.
  3. Refining truth-valuation prompts and exploring alternative logit-space aggregation methods to extract cleaner probability estimates from the LLM.

Summary updated

BibTeX
@inproceedings{hoveyda2026orlog,
  author = {Mohanna Hoveyda and Jelle Piepenbrock and Arjen P. de Vries and Maarten de Rijke and Faegheh Hasibi},
  title = {{OrLog: Resolving Complex Queries with LLMs and Probabilistic Reasoning}},
  booktitle = {ECIR},
  year = {2026},
  doi = {10.1007/978-3-032-21289-4\_7},
}
Figure