A Multi-Agent Benchmarking Framework for Evaluating the Performance of Large Language Models in Logic Programming
摘要
Large Language Models (LLMs) have shown strong potential in code generation for mainstream languages, yet their effectiveness in logic programming remains underexplored. This paper presents a configurable multi-agent framework for benchmarking LLMs in Prolog code generation. The system combines a Code Generator Agent, a deterministic execution layer using SWI-Prolog, and an evaluator based on the LLM-as-a-Judge paradigm. It supports model-agnostic experimentation and evaluates outputs across functional correctness, efficiency, structural properties and evaluator reliability. Experimental results show that leading models achieve high correctness on standard tasks but exhibit significant variability in efficiency, token consumption and code structure. More complex tasks expose clear performance gaps. Additionally, the LLM-as-a-Judge approach shows limited reliability, with low inter-rater agreement. These findings highlight both the capabilities and limitations of LLMs in logic programming and demonstrate the importance of combining execution with LLM-based evaluation.