AI Research
Extracting Logic Formulas from Training Data Is Computationally Hard
A new study shows that learning linear temporal logic formulas from positive and negative examples is NP-complete for most operator combinations, with only narrow exceptions.
Researchers have formally established the computational barriers to a fundamental machine learning problem: inferring human-readable logical formulas that distinguish between desired and undesired behaviors based on example traces.
The Core Problem#
The challenge centers on linear temporal logic (LTL), a formal system for expressing properties that hold over time. Given a set of positive examples (sequences that should satisfy some property) and negative examples (those that should not), the goal is to discover the simplest LTL formula that correctly classifies them. This capability would make AI decision-making more interpretable and trustworthy.
Complexity Findings#
Researchers analyzed this problem across all variations of negation-free LTL built from operators including:
- F (eventually)
- G (globally)
- X (next)
- ∧ (conjunction)
- ∨ (disjunction)
The study reveals a striking divide in computational difficulty. For certain restricted operator combinations—specifically those excluding pairs like {X, ∧}, {X, ∨}, {F, ∧}, or {G, ∨}—the problem can be solved in polynomial time. However, for all other fragments, the problem jumps to NP-complete difficulty, meaning no known efficient algorithm exists for it, even on alphabets containing just two or three symbols.
Approximation and Next Steps#
The authors identified one exception: the fragment combining only the X and ∧ operators admits a polynomial-time algorithm that guarantees solutions within a factor of 3 of optimal. However, achieving better guarantees would require P = NP, suggesting this avenue has limited room for improvement.
These theoretical hardness results underscore why practical systems cannot rely on exact solutions. The researchers conclude that the path forward requires developing heuristic methods that, while lacking worst-case guarantees, can find reasonable formulas in practice.
Read the full paper on arXiv.