Learning Logical Structure through Entity Masking

This direction is no longer present in the current build. Its last version stays readable and citable here.

Version 1 of 133 papers42 conceptsfrozen 2026-10-04

Neural networks are notoriously "lazy" learners. When tasked with logical reasoning, they often bypass the hard work of understanding rules by latching onto statistical shortcuts and domain-specific facts. If a model sees the premise "Paris is in France" and the conclusion "Paris is in Europe," it might correctly identify the entailment not because it understands transitivity, but because it has memorized the geographical relationship between those specific entities.

To force models to move beyond memorization, a growing body of research advocates for de-semanticization: the process of stripping away specific entities and predicates and replacing them with generic placeholders. By focusing on the "skeleton" of an argument or query, these systems learn to reason about the underlying structure of logic itself.

The Problem of Semantic Bias

In tasks like Natural Language Inference (NLI), models frequently "cheat" by identifying keywords that correlate with certain labels. Mithun Paul Panenghat, Faiz Rafique, and colleagues in Towards the Necessity for Debiasing Natural Language Inference Datasets demonstrate that identifying that two sentences refer to the same entity is far more critical for logic than knowing the entity's actual name. When models rely on specific vocabulary, they fail to generalize when moved to a new domain where the entities are unfamiliar.

Similarly, in chemistry reasoning, Zehua Zhao and Zhixian Huang argue in SUPERChem: A Multimodal Reasoning Benchmark in Chemistry that replacing domain entities with placeholders is the only way to ensure a model is applying procedural scientific principles rather than simply retrieving facts from its training data.

Structural Distillation and Normalization

The core mechanism of this research direction is structural distillation. By replacing entities (e.g., "Albert Einstein") and predicates (e.g., "born in") with generic tokens like <ENT_1> and <REL_A>, researchers create a "term-agnostic" representation.

Monireh Ebrahimi, Federico Bianchi 0001, and their team pioneered this in Reasoning over RDF Knowledge Bases using Deep Learning. They found that normalizing triples into generic placeholders allows a Deep Learning model to learn the universal patterns of deductive reasoning. Because the model never learns the specific meaning of "Einstein," it can apply the same logical rules to a completely different dataset—such as a medical or legal knowledge graph—without any retraining.

This abstraction also helps in identifying logical fallacies. Zhijing Jin and Abhinav Lalwani use this technique in Logical Fallacy Detection to isolate the relationship between premises and conclusions, preventing the model from being swayed by topical biases or emotional language.

Decoupling Logic from Fact

A major benefit of this approach is the ability to pair the linguistic flexibility of Large Language Models (LLMs) with the rigorous precision of symbolic logic. Navid Madani and Kenneth Joseph show in Answering Questions Over Knowledge Graphs Using Logic Programming Along with Language Models that by replacing entity names with placeholders, a small model (T5-small) can learn to generate Prolog queries with 100% accuracy.

The model doesn't need to "know" the facts; it only needs to "understand" the question's intent. This decoupling allows the system to handle "personalized" knowledge graphs—where entities might be private or unique to a single user—as explored by Ritam Dutt and Carolyn Rose in PerKGQA: Question Answering over Personalized Knowledge Graphs.

Retrieval by Logical Intent

Beyond training, entity masking is a powerful tool for Case-Based Reasoning (CBR). When a system encounters a new problem, it needs to find similar examples in its memory to use as a guide. However, standard vector retrieval often finds examples that share the same topic rather than the same logic.

In Knowledge Base Question Answering by Case-based Reasoning over Subgraphs, Rajarshi Das and Ameya Godbole demonstrate that masking entities during retrieval shifts the focus to the underlying relational structure. For instance, a question about "the director of Inception" and "the author of The Hobbit" are logically identical (Subject -> Relation -> ?). Masking allows the system to retrieve the "author" example to help solve the "director" question.

This "structural abstraction retrieval" is now being applied to diverse fields:

  • Text-to-SQL: Chunxi Guo and colleagues in A Case-Based Reasoning Framework for Adaptive Prompting in Cross-Domain Text-to-SQL use "question skeletons" to find relevant SQL templates across different database schemas.
  • Enterprise Search: Yuhui Yun and Xinru Li use entity masking in EICopilot to retrieve query templates based on structural similarity rather than specific corporate entities.
  • Robotics: Songhao Huang and Sunan Huang apply this to PDDL domain generation in SPAR, allowing robots to plan tasks by retrieving logically similar "rulebooks."

Why It Works: The Intuition

The success of entity masking lies in dimensionality reduction for logic. The semantic space of natural language is infinite and messy. By collapsing thousands of possible entities into a handful of placeholders, the model's search space is drastically reduced. It no longer has to wonder if "Paris" behaves differently than "London" in a logical chain; it only sees the relationship between <E1> and <E2>.

As Yi Cai and Haopeng Ren suggest in A Logical Pattern Memory Pre-trained Model for Entailment Tree Generation, this forces the model to store "abstract logical templates" in its memory. When the model is finally asked to reason in the real world, it simply "plugs" the real entities back into these pre-learned logical skeletons, resulting in reasoning that is more consistent, transferable, and robust.

Papers in this version

History & citationVersion 1 · 2026-10-04

No longer present in the current build · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_learning_logical_structure_through_entit_c46a36c2,
  title = {Learning Logical Structure through Entity Masking},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/learning-logical-structure-through-entity-masking/rdr_c46a36c2ffc1412f91c2413d272c116f},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-19},
}

This exact version (version 1, frozen text):

@misc{lacuna_learning_logical_structure_through_entit_c46a36c2_v1,
  title = {Learning Logical Structure through Entity Masking},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/learning-logical-structure-through-entity-masking/rdr_c46a36c2ffc1412f91c2413d272c116f/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-19},
}