Towards Computationally Verifiable Semantic Grounding for Language Models

Michael Collins, Chris Alberti, Kuzman Ganchev, Michael Collins 0001, Sebastian Gehrmann, Ciprian ChelbaarXiv 2022 · DOI · arXiv

Abstract

Large Language Models (LLMs) often struggle with semantic grounding—the ability to accurately convey specific intended messages without hallucination or omission. This paper proposes a framework that treats the LLM as part of a semantic auto-encoder. By integrating a semantic parser to verify outputs against original inputs, we introduce sampling and "greedy finetuning" techniques. These methods significantly enhance semantic accuracy, improving Triple F1 scores by up to 11% absolute on the WebNLG 3.0 dataset while maintaining natural language fluency.

Introduction

While modern LLMs demonstrate remarkable fluency, they frequently function as "stochastic parrots," generating text based on statistical patterns rather than a deep understanding of underlying facts. This lack of semantic grounding leads to outputs that may be fluent but factually inconsistent with the intended input. Verifying whether an LLM's output is semantically correct relative to a set of facts remains a significant challenge.

This research addresses the problem by formalizing semantic grounding as a computationally verifiable task. Given a set of data in the form of entity-relationship triples, the goal is to ensure the resulting text contains exactly those facts, no more and no less.

An example of the semantic grounding task, showing input triples, a target natural language sentence, and an implied fact extracted from the context.

Methodology: The Semantic Auto-encoder

The authors conceptualize the generation process as a closed loop consisting of three stages:

  1. Input: A set of semantic triples (e.g., [Agnes Kant | nationality | Netherlands]).
  2. Language Model (LM): The generator that translates these triples into natural language.
  3. Semantic Parser (SP): A verifier that extracts triples back out of the generated text.

In a perfectly grounded system, the triples extracted by the parser should be identical to the input triples. To optimize for this, two primary techniques are proposed:

Sampling

Instead of relying on greedy search (selecting the most likely token at each step), the model generates multiple candidate sentences. The semantic parser then scores these candidates based on how well they reconstruct the original input triples. The candidate with the highest F1 score is selected as the final output.

Greedy Finetuning

This optimization approach iteratively updates the LM's parameters to maximize the probability that the semantic parser will correctly reconstruct the input. To handle the non-differentiable nature of discrete text generation, the authors employ a straight-through gradient estimator, allowing backpropagation from the frozen parser back into the language model.

Experimental Setup

The framework was evaluated using the WebNLG 3.0 English dataset, which contains RDF (Resource Description Framework) triples paired with human-written reference sentences. The evaluation included both "seen" categories and "unseen" categories to test the model's generalization capabilities.

Key Results

The proposed methods were benchmarked against a T5-XXL baseline. Results indicate that semantic grounding can be significantly improved without compromising text quality.

Comparison of various generation methods on the WebNLG test set, highlighting improvements in Triple F1 scores while maintaining stable BLEU and METEOR metrics.

As shown in the results, the ensemble method (Greedy Finetuning + Sampling) improved the Triple F1 score by 11% absolute (from 0.54 to 0.65) compared to the greedy baseline. Crucially, fluency metrics remained stable; the baseline BLEU score of 0.54 was nearly maintained at 0.53 by the best-performing ensemble method. Human evaluations corroborated these findings, noting that the "Greedy + Sampling" approach achieved the highest recall of intended facts.

Discussion and Limitations

The "semantic auto-encoder" loop demonstrates that grounding can be a measurable objective. However, several challenges remain:

  • Parser Dependency: The system's effectiveness is bottlenecked by the accuracy of the semantic parser.
  • Representation Limits: RDF triples may lack the expressiveness required for complex, open-domain natural language.
  • Computational Overhead: Greedy finetuning is resource-intensive. Future work may explore parameter-efficient methods like prompt tuning to reduce the cost of inference-time optimization.

Summary updated

Abstract

The paper presents an approach to semantic grounding of language models (LMs) that conceptualizes the LM as a conditional model generating text given a desired semantic message formalized as a set of entity-relationship triples. It embeds the LM in an auto-encoder by feeding its output to a semantic parser whose output is in the same representation domain as the input message. Compared to a baseline that generates text using greedy search, we demonstrate two techniques that improve the fluency and semantic accuracy of the generated text: The first technique samples multiple candidate text sequences from which the semantic parser chooses. The second trains the language model while keeping the semantic parser frozen to improve the semantic accuracy of the auto-encoder. We carry out experiments on the English WebNLG 3.0 data set, using BLEU to measure the fluency of generated text and standard parsing metrics to measure semantic accuracy. We show that our proposed approaches significantly improve on the greedy search baseline. Human evaluation corroborates the results of the automatic evaluation experiments.
BibTeX
@misc{collins2022towards,
  author = {Michael Collins and Chris Alberti and Kuzman Ganchev and Michael Collins and Sebastian Gehrmann and Ciprian Chelba},
  title = {{Towards Computationally Verifiable Semantic Grounding for Language Models}},
  year = {2022},
  eprint = {2211.09070},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2211.09070},
}
Figure