TL;DR
This paper introduces a novel approach to building natural language generation (NLG) systems for converting structured data (RDF triples) into text. Instead of traditional training methods, they use a team of LLM agents to collaboratively write, test, and refine a Python-based rule-based NLG system from scratch. This method results in fully interpretable, fast, and hallucination-reducing NLG systems without requiring human-annotated data.
What Problem Does This Paper Address?
Generating coherent and accurate text from structured data, like knowledge graphs represented as RDF triples, is a crucial task in Natural Language Generation (NLG). Existing methods fall into two main categories: rule-based systems and neural approaches. Rule-based systems offer interpretability and control but are often labor-intensive to create and maintain. Neural approaches, especially those using large language models (LLMs), can generate fluent text but suffer from a lack of interpretability, a tendency to "hallucinate" (generate incorrect information), and require significant computational resources. Furthermore, training these neural models typically relies on large amounts of human-annotated data, which is expensive and time-consuming to produce. This paper addresses the challenge of building NLG systems that are interpretable, controllable, accurate, and efficient, without the need for extensive human supervision.
Methods
The core innovation of this paper is a "neuro-symbolic" framework where LLM agents act as a development team to build an NLG system. This process involves several specialized LLM agents:
- Software Architect (SA): Designs the overall structure of the NLG system, defining functions, their responsibilities, and interactions.
- Test Engineer (TE): Generates unit tests by creating example input-output pairs from RDF triples, essentially acting as a data generator for testing.
- Software Engineer (SE): Implements the Python code for the NLG system based on the SA's design and the TE's tests.
- Evaluator (Eval): Runs the generated Python code against the unit tests and uses another LLM to assess the quality of the generated text.
- Code Analyst (CA): Analyzes the test results and code, identifying whether issues stem from the design or implementation, and guides the other agents to fix them.
This iterative process continues until the system passes all unit tests or a maximum iteration limit is reached. The final output is a standalone Python script that can generate text without any LLMs.
Datasets
The authors evaluated their approach on two main domains:
- WebNLG: A popular dataset for RDF-to-text generation, containing RDF triples and corresponding natural language descriptions. They used the standard test set and three additional test sets from the GEM 2024 shared task (factual, counterfactual, and fictional triples) to test robustness.
- OpenDialKG: A dataset containing dialogues annotated with RDF triples, used for an RDF-to-triple task.
Key Insights and Ideas
- LLMs as a Development Team: The most striking idea is using multiple LLMs to collaboratively "program" an NLG system. This shifts the paradigm from LLMs being the system to LLMs building the system.
- Interpretable by Design: By generating rule-based Python code, the resulting NLG system is inherently interpretable and can be manually edited, unlike black-box neural models.
- Zero-Shot Training Data: The system learns to generate text solely from RDF triples and the LLM agents' understanding of programming and language, eliminating the need for human-annotated text pairs during training.
- Efficiency and Speed: The final Python-based system runs very fast, even on a single CPU, significantly outperforming GPU-based neural models in inference time.
Key Results
- Reduced Hallucinations: The generated NLG systems produced significantly fewer hallucinations compared to fine-tuned BART and prompted Llama 3.3, as confirmed by both reference-based and reference-less evaluations.
- Competitive Performance: While fine-tuned neural models sometimes achieved higher scores on traditional metrics like BLEU, the LLM-agent-built system was competitive, especially on out-of-domain examples, and showed strong performance in human evaluations for grammaticality and lack of omissions.
- Impressive Inference Speed: The generated Python system achieved a 35x speedup on CPU compared to BART on GPU and a 272x speedup when both ran on CPU.
- Human Evaluation: Human experts found no hallucinations in the system's output and noted a comparable omission rate to prompted LLMs, with the lowest assessment of disfluencies and repetitions.
- Interpretability Verified: Two experienced software engineers successfully completed interpretability and modification tasks on the generated code, confirming its understandability.
Limitations and Future Work
- Potential for Non-Factual Outputs: The authors acknowledge that while hallucinations are reduced, the system may still generate non-factual outputs, suggesting the need for thorough testing before deployment.
- Robustness to Schema Changes: The generated programs might not be robust to differences in date formatting or other schema variations across datasets, leading to reduced performance on datasets like GEM.
- Future Work: The paper suggests further exploration of LLM agents for NLG system construction, potentially expanding to more complex NLG tasks and improving robustness. The authors also highlight the potential for manual editing and refinement of the generated code.
Summary updated