Abstract
NL2LTL is an open-source Python package that bridges the gap between human intuition and formal logic. By leveraging Large Language Models (LLMs) and traditional Natural Language Understanding (NLU), it translates everyday English instructions into Linear Temporal Logic (LTL) formulas. This allows non-experts to interface directly with sophisticated automated planning and workflow management systems, reducing the expertise required to author formal specifications.
Introduction
In enterprise environments, managing complex workflows—such as data pipelines or web service compositions—often requires "declarative specifications." Linear Temporal Logic (LTL) is the gold standard for these specifications because it can describe system behavior over time (e.g., "If A happens, B must eventually follow"). However, writing LTL requires significant expertise in formal methods, creating a high barrier to entry. While some translation tools exist, they are often restricted to specific domains or rigid "templated" English. NL2LTL provides a general-purpose, extensible framework to handle the ambiguity of natural language while outputting rigorous logic.
System Architecture
The NL2LTL architecture is designed for modularity and extensibility, consisting of three primary components: supported patterns (templates), NLU engines, and filtering functions.
- Supported Patterns (Templates): The system includes "DECLARE" templates—a standard in business process management—and allows developers to add custom templates.
- NLU Engines: The package supports multiple backends, including Rasa (intent-entity paradigm) and GPT-3 (LLM-based logic extraction).
- Filtering Functions: To handle natural language ambiguity, NL2LTL includes filters to remove conflicting or redundant candidate formulas (e.g., subsumption filtering).
The system also provides "Explanations" by translating generated LTL back into English, enabling users to verify the system's interpretation of their intent.
Integration and Workflow
A key advantage of NL2LTL is its domain agnosticism. Unlike previous tools hard-coded for specific tasks, NL2LTL acts as a "plug-and-play" component for various domains, from industrial automation to web services.
As shown in the integration workflow, NL2LTL replaces brittle, manual rules with a domain-independent pipeline. In real-world applications, such as web service composition tasks presented at AAAI-22, this approach significantly reduced maintenance overhead by removing parser-specific code.
Key Insights
- Logic-Aware Filtering: Translating text to logic is insufficient without a layer to handle logical conflicts and redundancies, a critical feature for using LLMs in formal reasoning.
- Extensibility: By making NLU engines and logic templates modular, the framework is future-proofed against evolving LLM capabilities.
- Machine-Consumable Human Speech: The focus is on making human speech "machine-consumable" without sacrificing the accessibility of the user interface.
Results and Limitations
NL2LTL demonstrates utility through industrial integration and confidence-ranked outputs. For example, a request like "Send me a Slack after receiving a Gmail" generates a ChainResponse template with high confidence (~0.99).
However, challenges remain. The system's quality is dependent on the underlying NLU engine, and LLM "hallucinations" necessitate robust filtering. Furthermore, while DECLARE templates cover many use cases, translating highly complex, nested LTL formulas that fall outside pre-defined templates remains an open research challenge. Future work will involve formal user studies to quantify the reduction in the barrier to entry for non-experts.
Summary updated