Enhancing Ethical Explanations of Large Language Models through Iterative Symbolic Refinement (2024)

Abstract: An increasing amount of research in Natural Language Inference (NLI) focuses on the application and evaluation of Large Language Models (LLMs) and their reasoning capabilities. Despite their success, however, LLMs are still prone to factual errors and inconsistencies in their explanations, offering limited control and interpretability for inference in complex domains. In this paper, we focus on ethical NLI, investigating how hybrid neuro-symbolic techniques can enhance the logical validity and alignment of ethical explanations produced by LLMs. Specifically, we present an abductive-deductive framework named Logic-Explainer, which integrates LLMs with an external backward-chaining solver to refine step-wise natural language explanations and jointly verify their correctness, reduce incompleteness and minimise redundancy. An extensive empirical analysis demonstrates that Logic-Explainer can improve explanations generated via in-context learning methods and Chain-of-Thought (CoT) on challenging ethical NLI tasks, while, at the same time, producing formal proofs describing and supporting models’ reasoning. As ethical NLI requires commonsense reasoning to identify underlying moral violations, our results suggest the effectiveness of neuro-symbolic methods for multi-step NLI more broadly, opening new opportunities to enhance the logical consistency, reliability, and alignment of LLMs.

## introduction natural language inference (nli) is the task of determining whether a given premise entails a hypothesis @xcite @xcite . in general, nli in complex domains requires multi-step reasoning alongside the ability to select and combine multiple premises to support or reject a given hypothesis @xcite @xcite ; wang and ## explanations for ethical nli ethical nli involves reasoning about everyday scenarios in which individuals perform actions that can positively or negatively affect others @xcite . one of the challenges of ethical explanations is the ability to perform abstractive commonsense reasoning @xcite to connect statements about concrete situations to foundational and unifying moral principles. in this work, we focus on the task of generating logically valid, complete and non-redundant explanations to determine underlying moral violations of ethical statements. formally, given a statement s i , we want to determine whether s i is morally acceptable through the construction of an explanation e i composed of a set of facts {f 1 , f 2 , ..., f n }. in particular, we want the explanation e i to identify one of a set of moral violations @xmath0, v 2 , ..., v n } that are related to core moral principles such that an explanation e i is considered to be valid and non-redundant if all the facts in e i are necessary and sufficient for the entailment ## logic-explainer to construct an explanation e i for s i , we present a neuro-symbolic model that integrates an llm with an external symbolic reasoner, adopting a refinement strategy for a fixed number t of iterations. the pipeline of logic-explainer is composed of several intermediate stages (figure 2 ). in the first stage (a), we apply a semantic prompting strategy (see section 3.1), using the llm to generate the initial explanation and a hypothesis semantic roles ... : parents are typically considered authority figures in a family. ## empirical evaluation we evaluated logic-explainer on ethical nli benchmarks. specifically, we adopt the ethics dataset @xcite , which provides moral questions centred around human ethical judgments in everyday scenarios. we applied three human annotators to re-annotate the dataset for multi-label classification of moral violations (for more details, see appendix e), within an average inter-annotator agreement α = 0.705. from the annotated corpus, we sampled 166 easy and 145 challenging moral statements, which are distributed across six moral foundations. ## corpus: explainethics to encourage future research in the field, we augmented the corpus of ethics @xcite with logically structured explanations for morally unacceptable statements constructed by logic-explainer and released a corpus containing a total of 311 statements with generated explanations and annotated moral violations. specifically, we generated the corpus adopting logic-explainer to generate and verify logical correctness in the explanations, providing the model with the correct moral foundation annotated by humans and then iteratively verifying the explanation using the symbolic solver. once the explanatory chain is verified by the hybrid framework, we add the instance to the corpus. 247 out of 311 instances were successfully verified by the symbolic solver within a maximum of 4 iterations. for the remaining examples, we manually added explanatory sentences to make them logically valid. these explanations exhibit high lexical overlap and logical coherence, potentially supporting future work on multi-hop reasoning and explanation evaluation. neuro-symbolic reasoning. neuro-symbolic models are methods that integrate neural networks with symbolic logic solvers to enhance the inference ability of rule-based models, allowing them to work with larger datasets while maintaining interpretable inference. several models @xcite @xcite have been introduced for performing multi-step logical inference in multihop reasoning tasks, using neural networks to improve robustness. moreover, @xcite @xcite have proposed the integration of llms with symbolic solvers to enhance the faithfulness and reliability of reasoning processes in the domain of mathematical reasoning, multi-hop reasoning, and commonsense reasoning. yang et al. (2022) applied neuro-symbolic reasoning as a validation model with the aim to generate logically valid inferences. our approach involves extracting knowledge from llms and using a prolog solver to automatically verify the logical correctness of the formed explanation without additional human annotation. llms self-refinements. self-refinement strategies for addressing the challenges of hallucination and unfaithful reasoning in llms have been broadly studied in recent works, both through internal @xcite and external feedback @xcite @xcite . internal feedback uses the llm itself to iteratively refine the output from previous steps until a gold standard is reached. external feedback refines the outputs based on the feedback from external tools, external knowledge sources or external metrics, either in the format of scalar values or natural language sentences @xcite . we refine the quality of the generated outputs using external feedback on solvability and symbolic information from the constructed proof of a neuro-symbolic reasoner. this ensures the logical consistency, completeness and absence of redundancy in downstream tasks by processing symbolic self-refinement on the generated outputs. ## conclusion in this work, we propose a neuro-symbolic framework for ethical reasoning integrating in-context learning and external solvers. we introduced a validation model to verify the logical correctness of generated explanations. our proposed model iteratively refines the explanations for ethical questions, resulting in logically valid, more complete, and non-redundant explanations that can form a coherent reasoning chain supporting a hypothesis. we have significantly reduced the instances of hallucination and redundancy in llms, effectively demonstrating the benefits of integrating llms with logical/symbolic reasoning. in future work, we aspire to enhance the model's inference capabilities concerning challenging moral questions and further improve its capacity for building coherent explanations.