From Language to Logic: A Bi-Level Framework for Structured Reasoning
Structured reasoning over natural language inputs remains a core challenge in artificial intelligence, as it requires bridging the gap between unstructured linguistic expressions and formal logical representations. In this paper, we propose a novel bi-level framework that maps language to logic through a two-stage process: high-level task abstraction and low-level logic generation. At the upper level, a large language model (LLM) parses natural language queries into intermediate structured representations specifying the problem type, objectives, decision variables, and symbolic constraints. At the lower level, the LLM uses these representations to generate symbolic workflows or executable reasoning programs for accurate and interpretable decision making. The framework supports modular reasoning, enforces explicit constraints, and generalizes across domains such as mathematical problem solving, question answering, and logical inference. We further optimize the framework with an end-to-end bi-level optimization approach that jointly refines both the high-level abstraction and low-level logic generation stages. Experiments on multiple realistic reasoning benchmarks demonstrate that our approach significantly outperforms existing baselines in accuracy, with accuracy gains reaching as high as 40%. Moreover, the bi-level design enhances transparency and error traceability, offering a promising step toward trustworthy and systematic reasoning with LLMs.
Unlike the constrained approaches of prior methods, human experts, by contrast, tackle complex problems not just by prolonging deliberation but by deeply understanding their logical structure. They abstract and modeling problems—often using formal logical or mathematical frameworks to define variables, constraints, and objectives—before applying analytical or computational methods to solve them. This “modeling and solving” paradigm, prevalent in fields like mathematics (Bender 2000) and operations research (Churchman et al. 1957), inspires our approach. Drawing from this, we propose Lang2Logic, a novel bilevel structured reasoning framework. Lang2Logic decomposes reasoning into two layers: a high-level Optimization-Guided Formalization(OGF) LLM, which transforms natural-language queries into structured formal models (specifying problem type, variables, constraints, and objectives). In the lower layer, the Logic Generation(LG) LLM first constructs logical representations, such as rule-based workflows or constraint-driven solution paths, and then translates these into executable Python code, which serves as a universal symbolic workflow logic generation. This design enables modular reasoning across diverse domains, while ensuring the reasoning process is both systematic and transparent.