Enhancing Large Language Models through Transforming Reasoning Problems into Classification Tasks

Tarun Raheja, Raunak Sinha, Advit Deepak, Will Healy, Jayanth Srinivasa, Myungjin Lee, Ramana KompellaCOLING 2024

Abstract: In this paper, we introduce a novel approach for enhancing the reasoning capabilities of large language models (LLMs) for constraint satisfaction problems (CSPs), by converting reasoning problems into classification tasks. Our method leverages the LLM’s ability to decide when to call a function from a set of logical-linguistic primitives, each of which can interact with a local “scratchpad” memory and logical inference engine. Invocation of these primitives in the correct order writes the constraints to the scratchpad memory and enables the logical engine to verifiably solve the problem. We additionally propose a formal framework for exploring the “linguistic” hardness of CSP reasoning-problems for LLMs. Our experimental results demonstrate that under our proposed method, tasks with significant computational hardness can be converted to a form that is easier for LLMs to solve and yields a 40% improvement over baselines. This opens up new avenues for future research into hybrid cognitive models that integrate symbolic and neural approaches.

Introduction

Despite the significant advancements in Large Language Models (LLMs), multi-step logical reasoning remains a persistent challenge. Specifically, LLMs struggle with Constraint Satisfaction Problems (CSPs), such as spatial reasoning or ordering tasks. While models may show "sparks of AGI," they often fail when asked to maintain a consistent logical state across multiple clues. Even with Chain-of-Thought (CoT) prompting, models frequently hallucinate constraints or contradict their own previous steps mid-sentence.

Example of a logical contradiction in standard LLM output, where the model correctly identifies constraints but fails to maintain consistency in its conclusion.

This failure occurs because LLMs are being asked to perform two distinct tasks simultaneously: linguistic interpretation (extracting meaning from text) and logical deduction (computing a valid state). This research proposes a hybrid cognitive architecture designed to decouple these processes, treating reasoning as a classification problem.

Methodology

The proposed framework transforms reasoning into a series of high-precision classification tasks. The workflow is divided into five distinct stages:

  1. Problem Parsing: The input text is segmented into individual sentences to isolate specific constraints.
  2. Problem Type Classification: The LLM identifies the problem domain (e.g., spatial "left-right" positioning, age, or pricing).
  3. Primitive Mapping: The core of the method involves mapping sentences to Linguistic-Logical Primitives (LLPs). These are atomic API calls, such as add_left(object_a, object_b), which represent symbolic logic.
  4. Symbolic Solver: Rather than generating a text-based guess, the primitives populate a "scratchpad" memory linked to a symbolic logic engine (e.g., a Python-based constraint solver). The engine then calculates the verifiable solution.
  5. Iterative Refinement: To mitigate classification errors, the system utilizes a stochastic loop to re-prompt the model and self-correct primitive selection before final execution.
Overview of the hybrid cognitive architecture, demonstrating the transformation of a natural language problem into symbolic constraints.

Experimental Setup

The study utilized the Logical Deduction datasets from BIG-bench Hard (BBH) to evaluate the architecture. The researchers tested problems involving 3, 5, and 7 objects to assess how the system scales with computational difficulty. The tasks covered four reasoning categories: leftright, competition, price, and age. A sample of 300 problems was used to benchmark the system against standard GPT-3.5 and Chain-of-Thought baselines.

Key Insights and Results

Decoupling Complexity

A primary finding is that LLMs are highly effective at handling Linguistic Complexity (ambiguous phrasing) when they are not simultaneously tasked with Computational Complexity (the NP-hard math of the puzzle). By acting as "micro-classifiers" for simple, atomic primitives, the models achieved far higher precision than when acting as "macro-reasoners."

Performance Gains

The hybrid approach demonstrated a significant performance leap:

  • Accuracy: The proposed method achieved 74.66% accuracy, a substantial improvement over base GPT-3.5 (43.66%) and CoT (41%).
  • Robust Scaling: While standard LLM performance plummeted as the number of objects increased from 3 to 7, the "Simple Primitives" approach remained robust, maintaining high accuracy on complex tasks.
  • Domain Specificity: In "competition" style problems, the iterative refinement method reached 94.34% accuracy, nearly doubling baseline performance.

Explainability

Because the system outputs a list of symbolic constraints (e.g., position(red_book) < position(green_book)), the reasoning process is fully transparent. This allows for immediate identification of which specific sentence led to a misclassification, providing a level of interpretability missing from standard neural reasoning.

Conclusion

While the current method requires manual definition of primitives for new domains, it proves that symbolic-neural hybrids can overcome the inherent logical limitations of LLMs. Future work will focus on Automated Primitive Generation, aiming to allow LLMs to define their own symbolic functions on the fly, further bridging the gap between neural flexibility and symbolic precision.

Summary updated

BibTeX
@inproceedings{raheja2024enhancing,
  author = {Tarun Raheja and Raunak Sinha and Advit Deepak and Will Healy and Jayanth Srinivasa and Myungjin Lee and Ramana Kompella},
  title = {{Enhancing Large Language Models through Transforming Reasoning Problems into Classification Tasks}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2024},
  url = {https://openreview.net/forum?id=u4fG27RY9Y},
}
Figure