SearcharxivSearch

arXiv subjects

Niklas Mellgren

Publications and source records attributed to Niklas Mellgren.

2 recordsLinked to original sources

Training Language Models to Use Prolog as a Tool

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 cleaned version of GSM8K (which we release as gsm8k-prolog-prover). We systematically vary prompt structure, reward composition (execution, syntax, semantics, structure), and inference protocol (single-try, multiple-try, and two agentic modes). Our reinforcement learning approach outperforms supervised fine-tuning on GSM8K, and the resulting 3B model achieves zero-shot performance on MMLU-STEM and MMLU-Pro competitive with 7B few-shot baselines. Most importantly, we identify an accuracy--auditability trade-off: configurations tuned for correctness alone learn to delegate reasoning to natural language and use Prolog only for the final computation, while configurations rewarded for symbolic structure produce fully auditable programs at a cost in accuracy. We interpret this trade-off as a form of reward hacking and discuss its implications for deploying neurosymbolic systems in safety-critical domains. The source code for our experiments is available under https://github.com/aisilab/Prolog-as-a-Tool

cs.CL

A Mathematical Model of the Rainwater Flows in a Green Roof

A model is presented for the gravity-driven flow of rainwater descending through the soil layer of a green roof, treated as a porous medium on a flat permeable surface representing an efficient drainage layer. A fully saturated zone is shown to occur. It is typically a thin layer, relative to the total soil thickness, and lies at the bottom of the soil layer. This provides a bottom boundary condition for the partially saturated upper zone. It is shown that after the onset of rainfall, well-defined fronts of water can descend through the soil layer. Also the rainwater flow is relatively quick compared with the moisture uptake by the roots of the plants in the roof. In separate models the exchanges of water are described between the (smaller-scale) porous granules of soil, the roots and the rainwater in the inter-granule pores.

physics.geo-ph