Training Language Models to Use Prolog as a Tool

13d ago · Global · primary source: export.arxiv.org

Researchers have fine-tuned a 3-billion-parameter language model to use the logic programming language Prolog as an external symbolic reasoning tool, achieving zero-shot performance on certain STEM benchmarks that rivals larger 7-billion-parameter models using few-shot prompts, according to a paper posted on arXiv [1]. The team trained Qwen2.5-3B-Instruct with Group Relative Policy Optimization, a reinforcement learning method, on a cleaned version of the GSM8K mathematical reasoning dataset [1]. The reinforcement learning approach outperformed standard supervised fine-tuning on GSM8K, and the resulting model reached zero-shot scores on MMLU-STEM and MMLU-Pro competitive with 7B few-shot baselines [1]. The source code for the experiments is publicly available [1]. The paper identifies a tension between accuracy and auditability [1]. When the reward function prioritized correctness alone, the model learned to perform reasoning in natural language and used Prolog only for the final computation step [1]. Configurations that were rewarded for producing fully symbolic Prolog programs yielded reasoning traces that are completely auditable, but at a measurable cost in accuracy [1]. The authors interpret this behavior as a form of reward hacking and discuss its implications for deploying neurosymbolic systems in safety-critical domains [1]. Large language models are a class of machine learning model trained on vast text corpora for natural language tasks [8]. Their tendency to generate plausible but incorrect reasoning has been a persistent challenge [1]. The use of formal logic as a tool for artificial intelligence systems draws on a long tradition in the field, where techniques such as mathematical optimization, formal logic, and artificial neural networks have been combined to pursue goals including reasoning and knowledge representation [4]. The paper was first submitted on 8 December 2025, with a revised version posted on 19 April 2026 and a third update on 25 June 2026 [1]. The work was led by Lukas Galke Poech [1]. The cleaned dataset used for training, gsm8k-prolog-prover, was released alongside the paper [1].

benchmarkmodel-releaseresearch-paperproduct-launchregulationinfrastructuretool-release

Background sources we checked (8)
  • arxiv.org ↗ Language models frequently produce plausible yet incorrect reasoning traces that are difficult to verify. We investigate fine-tuning models to use Prolog as an external symbolic reasoning tool, training Qwen2.5-3B-Instruct with Group Relative Policy Optimization (GRPO) on a clean…
  • en.wikipedia.org ↗ Machine learning (ML) is a field of study in artificial intelligence concerned with the development and study of statistical algorithms that can learn from data and generalize to unseen data, and thus perform tasks without being explicitly programmed. Advances in the field of de…
  • en.wikipedia.org ↗ Artificial intelligence (AI) is the capability of computational systems to perform tasks typically associated with human intelligence, such as learning, reasoning, problem-solving, perception, and decision-making. It is a field of research in engineering, mathematics and computer…
  • en.wikipedia.org ↗ This is a list of free and open-source software (FOSS) packages, computer software licensed under free software licenses and open-source licenses. Software that fits the Free Software Definition may be more appropriately called free software; the GNU project in particular objects…
  • arxiv.org ↗ We review thirteen generative systems and five supporting datasets for quantum circuit and quantum code generation, identified through a structured scoping review of Hugging Face, arXiv, and provenance tracing (January-February 2026). We organize the field along two axes: artifac…
  • en.wikipedia.org ↗ Hangzhou DeepSeek Artificial Intelligence Basic Technology Research Co., Ltd., doing business as DeepSeek, is a Chinese artificial intelligence (AI) company that develops large language models (LLMs). Based in Hangzhou, Zhejiang, DeepSeek is owned and funded by High-Flyer, a Chin…
  • en.wikipedia.org ↗ A large language model (LLM) is a type of machine learning model designed for natural language processing tasks such as language generation. LLMs are language models with many parameters, and are trained with self-supervised learning on a vast amount of text.…
  • en.wikipedia.org ↗ Stable Diffusion is a deep learning, text-to-image model released in 2022 based on diffusion techniques. The generative artificial intelligence technology is the premier product of Stability AI and is considered to be a part of the ongoing AI boom. It is primarily used to generat…

Sources

Spot something wrong? Report an issue