Cited by 10Logic, Reasoning, and KnowledgeAI-based Problem Solving and PlanningTopic Modeling

ChatLogic: Integrating Logic Programming with Large Language Models for Multi-Step Reasoning

Open access
Wang, Zhongsheng, Liu, Jiamou, Bao, Qiming, Rong, Hongfei, Zhang, Jingfeng·2024·2024 International Joint Conference on Neural Networks (IJCNN)

Abstract

Large language models (LLMs) such as ChatGPT and GPT-4 have demonstrated impressive capabilities in various generative tasks. However, their performance is often hampered by limitations in accessing and leveraging long-term memory, leading to specific vulnerabilities and biases, especially during long interactions. This paper introduces ChatLogic, an innovative framework specifically targeted at LLM reasoning tasks that can enhance the performance of LLMs in multi-step deductive reasoning tasks by integrating logic programming. In Chat-Logic, the language model plays a central role, acting as a controller and participating in every system operation stage. We propose a novel method of converting logic problems into symbolic integration with an inference engine. This approach leverages large language models’ situational understanding and imitation skills and uses symbolic memory to enhance multi-step deductive reasoning capabilities. Our results show that the ChatLogic framework significantly improves the multi-step reasoning capabilities of LLMs. The source code and data are available at https://github.com/Strong-AI-Lab/ChatLogic.

AI snapshot

Written from the paper’s full text.

TL;DR

ChatLogic is a framework that augments LLMs with pyDatalog logic programming, using the LLM as controller and adding semantic and syntax correction loops for multi-step deductive reasoning. Across PARARULE-Plus and CONCEPTRULES V1/V2, ChatLogic generally improves accuracy over base and zero-shot CoT baselines, especially for smaller models.

Key findings

  • On PARARULE-Plus, ChatLogic improved total accuracy over base and zero-shot CoT: GPT-3.5 0.5275 vs 0.344 and 0.3875; GPT-4 0.73 vs 0.555 and 0.69; Llama 2-7B 0.1825 vs 0.0475 and 0.105.
  • On CONCEPTRULES V1/V2, ChatLogic improved GPT-3.5 to 0.69/0.67 (V1 simplified/full) and 0.79/0.74 (V2 simplified/full), and Llama 2-7B to 0.48/0.49 and 0.37/0.36. GPT-4 with zero-shot CoT sometimes matched or slightly surpassed ChatLogic, especially on CONCEPTRULES V2 full.
  • Code executability improved with correction modules: on PARARULE-Plus, GPT-3.5 rose from 0.26 base to 0.5 with Semantic Correction and 0.62 with Semantic + Syntax Correction; GPT-4 from 0.54 to 0.64 and 0.7; Llama 2-7B from 0.1 to 0.16 and 0.16.
  • The paper reports that ChatLogic primarily enhances models with smaller parameter counts by providing appropriate guidance, while GPT-4 appears to reach a “performance ceiling” on current datasets.

Methods

  • Design: ChatLogic uses an LLM as controller and converts natural-language facts, rules, and queries into pyDatalog logic programs. It has four phases: input processing, Semantic Correction, Syntax Correction, and local execution response. It introduces Mix-shot CoT, combining zero-shot CoT and one-shot learning.
  • Data: PARARULE-Plus has approximately 400,000 samples under the closed-world assumption; experiments randomly selected 50 instances from each depth level in Animal and People categories, forming 100 test cases per depth from Depth=2 to Depth=5. CONCEPTRULES V1 and V2 were pooled across train/test/dev, and 100 instances were randomly sampled from each simplified and full version.
  • Models and analysis: ChatGPT (gpt-3.5-turbo), GPT-4 (gpt-4), and Llama 2-7B were tested with temperature 0. Accuracy was compared against Base and Zero-shot CoT baselines; an ablation study measured code executability with Semantic Correction and Semantic + Syntax Correction.

Limitations

  • The paper states that PARARULE-Plus relies on the closed-world assumption, and CONCEPTRULES V1/V2 are artificially constructed and lack natural linguistic expression, so they may not fully represent real-world complexity. It also states that open-world assumptions with more complex sentences and differently expressed external knowledge remain challenging.
  • The paper states that the optimization module’s applicability is currently limited to specific datasets, and the carefully designed prompt sample cases are not a universal prompt template.
  • The text makes evident that syntax corrections can be unreliable and may get stuck in an infinite loop; the authors introduce an upper loop limit, which they say somewhat diminishes ChatLogic’s inferential capabilities while improving robustness. It also notes GPT-4 may have reached a performance ceiling on the current datasets.

Model-written summary. Check it against the paper before relying on it.

Integrity signals

Registry

Crossref · 10.1109/ijcnn60899.2024.10650138

Cites

31 of 31 references verified0 citation errors · 0 not checkable

Statistics

Nothing to recompute.

Claims the paper makes

7 of 12 cited sources checked · 2 supported · 0 flagged · accuracy not yet measured

  • Premisecitation

    Token caps in models like GPT-3.5 and GPT-4 pose a significant constraint, particularly in multi-turn conversations.

    “The token caps in models like GPT-3.5 and GPT-4, while extendable through engineering prompts or technologies like Recursive Model Training [4], still pose a significant constraint.”
    Quote in the paperSubstantial claim1 of 1 sources checked
    • cites [4] Bulatov, 2023, Scaling transformer to 1m tokens and beyond with rmt source

      The Figure 5 passage (Usage of Parameter-Efficient Methods; page unavailable) reports a 32K-token input size for GPT-4 and shows that recurrent memory extended a pre-trained BERT model to much longer sequences. It does not establish a cap for GPT-3.5, test prompt-based extensions, or specifically assess constraints in multi-turn conversations. (LLM, conf=0.84)

      Experimental — accuracy not yet measured
  • Findingown data

    The improvement in inference accuracy is notably evident in multi-step reasoning tasks, as demonstrated on datasets such as PARARULE-Plus, CONCEPTRULES V1, and CONCEPTRULES V2.

    “This improvement is notably evident in multi-step reasoning tasks, as demonstrated on datasets such as PARARULE-Plus 1 , CONCEPTRULES V1, and CONCEPTRULES V2.”
    Quote in the paperSubstantial claim
  • Findingown data

    Both modules demonstrated incremental improvements in execution rates relative to baseline.

    “Relative to the baseline, both modules demonstrated incremental improvements in execution rates.”
    Quote in the paperNot a substantial claim
  • Findingown data

    On CONCEPTRULES V1 and V2, GPT-4 with Zero-shot CoT either parallels or slightly surpasses ChatLogic in many cases, particularly in the full version of CONCEPTRULES V2.

    “With Zero-shot CoT, GPT-4 either parallels or slightly surpasses ChatLogic in many cases, particularly in the full version of the CONCEPTRULES V2 dataset.”
    Quote in the paperSubstantial claim
  • Findingown data

    The ChatLogic framework significantly enhances LLMs' performance, surpassing the Baseline with considerably higher accuracy in most scenarios.

    “The experimental findings, as illustrated in Tables II and III, unequivocally showcase the ChatLogic framework's significant enhancement of LLMs' performance, surpassing the Baseline with considerably higher accuracy in most scenarios.”
    Quote in the paperSubstantial claim
  • Classified as probably not a substantial claim. 24
  • May combine two claims. 17
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Premisecitation

    Integration of external memory brings challenges such as potential embedding of biases from retrieval models into LLMs.

    “However, this integration brings its own challenges, such as the potential embedding of biases from the retrieval models into the LLMs [7], which could affect their accuracy and stability.”
    Quote in the paperNot a substantial claim1 of 1 sources checked
    • cites [7] Khattab, 2022, Demonstrate-search-predict: Composing retrieval and language models for knowledge-intensive nlp source

      The Introduction (p. 1) describes a retrieval limitation: a retrieve-then-read strategy can fail when the retrieval model cannot find passages that directly answer a question. The passages found in our copy do not address biases from retrieval models becoming embedded in language models or their effects on accuracy and stability; searches for retrieval bias and error propagation found no such discussion. (LLM, conf=0.72)

      Experimental — accuracy not yet measured
  • Probably not a substantial claim: may not pass S3 (load-bearing). May combine two claims.

    Premisecitation

    Zero-sample CoT is considered to be the best inference prompt currently; using 'Let's think step by step' significantly improved multiple inference-related zero-shot tasks.

    “In addition, zero-sample CoT [19] is also considered to be the best inference prompt currently; by using a simple prompt: 'Let's think step by step', the specific prompt and the corresponding two-stage key answer extraction prompt technology has significantly improved multiple inference-related zero-shot tasks.”
    Quote in the paperNot a substantial claim1 of 1 sources checked
    • cites [19] Kojima, 2022, Large language models are zero-shot reasoners, Advances in neural information processing systems source

      The paper describes the two-stage reasoning and answer-extraction prompts (Section 3.1, p. 3) and reports substantial gains over standard zero-shot prompting on multiple reasoning tasks (p. 2). Its conclusion calls Zero-shot-CoT the strongest zero-shot baseline for difficult multi-step reasoning tasks (p. 10), but does not establish it as the best inference prompt generally or currently; the paper also reports that it underperforms carefully crafted few-shot CoT. (LLM, conf=0.88)

      Experimental — accuracy not yet measured
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Premisecitation

    LOGIC-LM creates a deterministic symbolic solver that expresses reasoning in a specific symbolic format to obtain actual results.

    “LOGIC-LM [15] creates a deterministic symbolic solver that expresses reasoning in a specific symbolic format to obtain actual results.”
    Quote in the paperNot a substantial claim1 of 1 sources checked
    • cites [15] source

      The Problem Goal Answer passage describes LOGIC-LM using an LLM to convert a problem into a symbolic formulation, then a deterministic solver to perform inference. Section 3.2 says the framework calls a task-dependent external solver; it does not say LOGIC-LM creates that solver or that the solver itself expresses the problem in symbolic form. (LLM, conf=0.88)

      Experimental — accuracy not yet measured
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Premisecitation

    LLMs have demonstrated the ability to generate code in various programming languages to meet users' specific needs.

    “LLMs have demonstrated the ability to generate code in various programming languages to meet users' specific needs [13].”
    Quote in the paperNot a substantial claim1 of 1 sources checked
    • cites [13] source

      Section 2.1 says pretrained language models have been used to generate SQL queries, SPARQL queries, logical forms, and programs from natural language. The Conclusion also acknowledges LLMs’ code-generation capability. The paper does not establish the broader claim that LLMs generate code in various programming languages to meet users’ specific needs. (LLM, conf=0.82)

      Experimental — accuracy not yet measured
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Premisecitation

    The SELF-DEBUGGING approach endows LLMs with the ability to debug their output, reinforcing continual refinement in generated code.

    “In terms of optimization, the SELF-DEBUGGING approach [14] leads the post-code generation phase.It endows LLMs with the ability to debug their output, reinforcing the theme of continual refinement in the generated code.”
    Quote in the paperNot a substantial claim1 of 1 sources checked
    • cites [14] Chen, 2023, Teaching large language models to self-debug source
  • Classified as probably not a substantial claim.

    Premisecitation

    LLMs have an impressive ability to convert text into formal structures like math equations and programming languages.

    “In our experience with advanced LLMs such as Llama2 and GPT-4, we've noticed their impressive ability to convert text into formal structures like math equations [21] and programming languages [22].”
    Quote in the paperSubstantial claim1 of 2 sources checked
    • cites [21] He-Yueya, 2023, Solving math word problems by combining language models with symbolic solvers source
    • cites [22] source
  • May combine two claims.

    Findingreasoning

    ChatLogic, by combining LLMs with pyDatalog, translates natural language queries into logic programs, enhancing inference accuracy.

    “ChatLogic, by combining LLMs with pyDatalog, translates natural language queries into logic programs, enhancing inference accuracy.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Findingnone given

    ChatLogic is compatible with existing LLMs, significantly increasing their accuracy, especially in high-precision scenarios.

    “ChatLogic is designed to be compatible with existing LLMs, significantly increasing their accuracy, especially in high-precision scenarios.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S4 (based).

    Findingnone given

    Mix-shot CoT significantly enhances the performance of LLMs by combining various prompt engineering methods.

    “This approach significantly enhances the performance of LLMs by combining various prompt engineering methods.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S4 (based).

    Findingnone given

    The syntax correction module refines a logic program by learning from previous executions, significantly improving the practical application and effectiveness of the generated code.

    “This module refines a logic program by learning from previous executions, significantly improving the practical application and effectiveness of the generated code.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S4 (based). May combine two claims.

    Findingnone given

    ChatLogic mitigates information loss, effectively addressing the long sequence limitation prevalent in adopting LLMs for multi-step reasoning tasks.

    “ChatLogic mitigates information loss, effectively addressing the long sequence limitation prevalent in adopting LLMs for multi-step reasoning tasks.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Findingown data

    Native models demonstrate competency in answering straightforward questions, but exhibit limitations in complex multi-step reasoning tasks, reducing accuracy in more challenging questions.

    “While native models demonstrate competency in answering straightforward questions, they exhibit limitations in complex multi-step reasoning tasks, reducing accuracy in more challenging questions.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Findingnone given

    Syntax corrections are unreliable; they may get stuck in an infinite loop, repeatedly performing meaningless tasks.

    “However, syntax corrections are unreliable; they may get stuck in an infinite loop, repeatedly performing meaningless tasks.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing). May combine two claims.

    Findingnone given

    The carefully designed prompt sample cases are optimized for specific data sets and are not a universal prompt template.

    “The carefully designed prompt sample cases are also optimized for specific data sets and are not a universal prompt template.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S4 (based). May combine two claims.

    Findingnone given

    LLMs excel at semantic corrections, and with limited modifications, correct text translations can be achieved.

    “We observe that LLMs excel at semantic corrections, and with limited modifications, correct text translations can be achieved.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Findingreasoning

    Mix-shot CoT does not entirely eliminate the need for demonstrations like zero-shot CoT, nor does it match the minimal hallucination levels of one-shot learning.

    “While it does not entirely eliminate the need for demonstrations like zero-shot CoT, nor does it match the minimal hallucination levels of one-shot learning, the mix-shot CoT's enhanced adaptability and efficiency make it a powerful tool in the realm of prompt engineering.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S4 (based).

    Findingnone given

    The initial version of the logic code generated by LLMs, after continuous revision through two or more iterations within two modules (semantic and syntactic correction), has significantly improved executability, resulting in more precise results.

    “It is worth noting that the initial version of the logic code generated by LLMs at the beginning, after continuous revision through two or more iterations within two modules (semantic and syntactic correction), as a direct code solution for multi-step reasoning Executability is significantly improved, resulting in more precise results.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Findingreasoning

    Mix-shot CoT reduces hallucination significantly and boasts the highest task-specific accuracy due to its judicious use of high-quality demonstration examples.

    “Our approach reduces hallucination significantly and boasts the highest task-specific accuracy due to its judicious use of high-quality demonstration examples.”
    Quote in the paperSubstantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Premisecitation

    External memory augmentation involves integrating LLMs with extensive databases to enhance reasoning capabilities.

    “This method involves integrating LLMs with extensive databases to enhance their reasoning capabilities [6].”
    Quote in the paperNot a substantial claim0 of 1 sources checked
    • cites [6] Borgeaud, Improving language models by retrieving from trillions of tokens

      Couldn’t be matched to a paper in Crossref, so it can’t be checked.

  • Probably not a substantial claim: may not pass S4 (based).

    Premisenone given

    LLMs' training methodology based on next-token prediction limits their ability to apply logical rules and deep contextual understanding essential for multi-step reasoning.

    “Their training methodology, primarily based on the 'next-token prediction' approach, limits their ability to apply logical rules and deep contextual understanding essential for such tasks.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S4 (based).

    Premisenone given

    Existing methods more or less exposed the weakness of extracting effective content from long and disordered information.

    “But they all more or less exposed the weakness of extracting effective content from long and 1 https://huggingface.co/datasets/qbao775/PARARULE-Plus disordered information.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing). May combine two claims.

    Premisecitation

    Chain of Thought (CoT) reveals intermediate reasoning steps used by models in problem-solving, allowing continual self-correction of logical thinking, thereby greatly enhancing the rationality of reasoning capabilities.

    “However, the most impactful method is the Chain of Thought (CoT) [12], which reveals the intermediate reasoning steps used by these models in problem-solving, allowing for continual self-correction of logical thinking, thereby greatly enhancing the rationality of their reasoning capabilities.”
    Quote in the paperNot a substantial claim0 of 1 sources checked
    • cites [12] Wei, 2022, Chain-of-thought prompting elicits reasoning in large language models, Advances in Neural Information Processing Systems

      Couldn’t be matched to a paper in Crossref, so it can’t be checked.

  • Probably not a substantial claim: may not pass S3 (load-bearing). May combine two claims.

    Interpretationreasoning

    CONCEPTRULES V1 and V2 lack natural linguistic expression, which may not fully represent real-world complexities.

    “Additionally, datasets like CONCEPTRULES V1 and V2, which are also artificially constructed, lack natural linguistic expression, which may not fully represent real-world complexities.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing), S4 (based).

    Interpretationreasoning

    GPT-4 has seemingly reached a performance ceiling on the current datasets.

    “Furthermore, it's important to highlight that GPT-4, due to its extremely advanced capabilities in some subtasks, has seemingly reached a 'performance ceiling' on the current datasets.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S4 (based). May combine two claims.

    Premisenone given

    The challenge escalates as the reasoning depth increases, and LLMs often miss key reasoning steps.

    “The challenge escalates as the reasoning depth increases, and LLMs often miss key reasoning steps.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S4 (based).

    Interpretationnone given

    This methodology ensures the retention of comprehensive information in natural language, effectively preventing omissions and the accumulation of errors that could compromise reasoning outcomes.

    “By adopting this methodology, we ensure the retention of comprehensive information in natural language, effectively preventing omissions and the accumulation of errors that could compromise reasoning outcomes.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Premisecitation

    Translation of LLMs from text to code is often imperfect on the first try and may contain errors.

    “The translation of LLMs from text to code [23] is often imperfect on the first try and may contain errors.”
    Quote in the paperSubstantial claim0 of 1 sources checked
    • cites [23] source
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Interpretationnone given

    When confronted with more complex sentences in the context of an open-world assumption, importing, integrating, and inferring external knowledge information that is expressed differently still poses challenges.

    “When confronted with more complex sentences in the context of an open-world assumption, importing, integrating, and inferring external knowledge information that is expressed differently still poses challenges.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Interpretationreasoning

    Introducing an upper loop limit somewhat diminishes ChatLogic's inferential capabilities but significantly enhances the framework's robustness, making it better suited for multi-step deductive reasoning tasks.

    “Although this somewhat diminishes ChatLogic's inferential capabilities, it significantly enhances the framework's robustness, making it better suited for multi-step deductive reasoning tasks.”
    Quote in the paperSubstantial claim
  • Classified as probably not a substantial claim.

    Premisenone given

    LLMs sometimes struggle with complex, multi-step reasoning tasks.

    “However, these models sometimes struggle with complex, multi-step reasoning tasks.”
    Quote in the paperSubstantial claim
  • Probably not a substantial claim: may not pass S2 (checkable), S4 (based). May combine two claims.

    Interpretationreasoning

    This approach enhances the transparency of the reasoning process, thereby elevating the credibility and traceability of the results.

    “Moreover, this approach enhances the transparency of the reasoning process, thereby elevating the credibility and traceability of the results.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S4 (based). May combine two claims.

    Premisenone given

    While LLMs may not fully understand demo samples or generate fantasies that deviate from reality due to lack of pyDatalog knowledge in pretraining data, they can still simply imitate and produce high-precision output.

    “The existing flaw we hope to improve is that while LLMs may not fully understand demo samples or generate”
    Quote in the paperNot a substantial claim
32 of 32
  • The paper relies on this without support.

    LLM performance is often hampered by limitations in accessing and leveraging long-term memory, leading to specific vulnerabilities and biases, especially during long interactions.

    “However, their performance is often hampered by limitations in accessing and leveraging long-term memory, leading to specific vulnerabilities and biases, especially during long interactions.”
  • The paper relies on this without support.

    Meta attributes must be attributes the object possesses rather than attributes derived through inference.

    “Meta attributes must be attributes the object possesses rather than attributes derived through inference.”
  • The paper relies on this without support.

    All reasoning questions in PARARULE-Plus adhere to the closed-world assumption.

    “All reasoning questions in PARARULE-Plus adhere to the closed-world assumption, totalling approximately 400,000 samples.”
3 of 3

Cites

Flagged first, then by citations

Research works printed but not linked: 1

  1. Marvie, Picolo: A simple python framework for introducing component principles

Cited by

Sorted by citations

Authors
Wang, Z., Liu, J., Bao, Q., Rong, H., & Zhang, J.
Affiliations
University of Auckland (NZ)
Venue
2024 International Joint Conference on Neural Networks (IJCNN)
Publisher
IEEE
Published
2024-06-30
Pages
1-8
OpenAlex
W4402351524
Cited by
8
References
27
Citations by year
2026: 3 · 2025: 5
FWCI
2.35
Type
conference paper
Language
en
Open access
Locations
  • arXiv (Cornell University) (submittedVersion)
  • arXiv (Cornell University)
Topics
  • Physical Sciences › Computer Science › Artificial Intelligence › Logic, Reasoning, and Knowledge
  • Physical Sciences › Computer Science › Artificial Intelligence › AI-based Problem Solving and Planning
  • Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
Keywords
large language models, logic programming, symbolic memory, long-term memory, inference engine, symbolic integration, ChatGPT, GPT-4

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Claims read by deepseek-v4.1-flash under definition version 3 (extract-v3) on 2026-10-19.

Classified by jev-1.13-20260917 (gold-guideline-v0.2) on 2026-10-19.

Cited sources are checked by gpt-6-sol.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review