Memory-Augmented Generative Adversarial Transformers

Stephan Raaijmakers, Roos Bakker, Anita Cremers, Roy de Kleijn, Tom Kouwenhoven, Tessa VerhoefarXiv 2024 · arXiv

TL;DR

This paper introduces the Memory-Augmented Generative Adversarial Transformer (GAT), a novel architecture that combines external memory banks with adversarial training to improve factuality and stylistic control in conversational AI. By equipping Transformers with a dedicated attention layer for external data and a discriminator to enforce "felicity conditions," the authors demonstrate significant performance gains in goal-oriented dialogues and personalized style adaptation.

What Problem Does This Paper Address?

While Large Language Models (LLMs) like GPT-4 are incredibly fluent, they suffer from two major flaws in conversational settings: hallucinations and poor grounding. Vanilla Transformers are designed to predict the next word based on internal patterns learned during training, not to accurately interweave external facts (like database entries) or adapt to specific social constraints (like an interlocutor's age).

When a user asks a car navigation system for the "nearest parking garage," a standard LLM might confidently invent a non-existent address. The authors aim to fix this by creating a mechanism that forces the model to pay attention to external "truth" and punishes it when it deviates from stylistic or factual requirements.

Methods

The authors propose a two-pronged architectural upgrade:

  1. Memory-Augmentation: They add an extra multi-head attention layer to both the encoder and decoder blocks of a standard Transformer. This layer specifically handles a separate stream of "metadata" or external facts. As shown in Figure 1, this allows the model to compute attention over the input text and the external memory bank simultaneously.
Figure 1: The memory-augmented Transformer with its encoder (left block) and decoder (right block).
  1. Generative Adversarial Training (GAT): They wrap these memory-augmented Transformers in a GAN framework. A Generator (the conversational agent) tries to produce responses, while a Discriminator tries to distinguish between real human responses and generated ones. Crucially, the Generator is conditioned on additional loss functions—such as a "Point of Interest" (POI) loss—that penalize it if it fails to include required factual slots from the memory bank.
Figure 2: The conditional Generative Adversarial Transformer (GAT), built up from two memory-augmented Trans- formers. The generator is equipped with additional loss functions conditioning its output. Notice how the generator receives summed losses from the additional loss functions ("Conditions") and the discriminator ("D-loss").

For factual QA, they break the process into a three-stage pipeline (Figure 3): Slot Detection (identifying entities), Slot Mapping (linking entities to response templates), and Slot Filling (inserting actual database values).

Figure 3: Setup for factual question answering. Three separate memory-augmented Transformers, each trained with their own conditional GAT, address different stages in the process.

Datasets

The researchers evaluated their approach on two distinct datasets:

  • CAR: A multi-turn conversational dataset for the automotive domain (e.g., navigation and weather). It relies on a knowledge base of destinations and POIs.
  • Personalized bAbI: A restaurant booking dataset extended with profile information (age and gender) of the human user. This is used to test style adaptation—for example, ensuring the bot uses more formal language for elderly users.

Key Insights and Ideas

  • Adversarial "Felicity": The core "aha" moment is using the GAN framework to enforce "felicity conditions"—linguistic rules for what makes an utterance appropriate in context. By adding custom loss functions to the generator, they can force the model to respect external constraints that standard maximum-likelihood training ignores.
  • Internalizing Knowledge vs. RAG: Unlike Retrieval-Augmented Generation (RAG), which often just stuffs facts into a prompt, this method attempts to "internalize" the external data through a dedicated attention mechanism, allowing for tighter integration between the language and the facts.
  • Style as External Data: The authors treat social properties (like age/gender) exactly like factual data. This unified approach suggests that "style" and "facts" are just different types of external constraints that can be handled by the same memory-augmented architecture.

Key Results

  • Style Adaptation: On the Personalized bAbI task, the memory-augmented model achieved a BLEU-4 score of 61.1, compared to a dismal 8.8 for the model without external data. This highlights how critical the memory bank is for capturing stylistic nuances.
  • Factual Grounding: In the CAR dataset experiments, adding the POI loss function significantly improved performance in the slot mapping stage (Stage 2). The model using both external data and POI loss achieved a BLEU-4 of 11.2, statistically outperforming the baseline (9.9).
  • Linguistic Fluency: Stage 1 (Slot Detection) showed very high performance (BLEU-4 of 81.7), proving the architecture is highly capable of learning the underlying structure of the dialogue domain.

Limitations and Future Work

Despite the improvements, the authors noted that factual hallucinations still occur in the final "Slot Filling" stage. For instance, the model might correctly identify that a distance is needed but insert "1 mile" when the database says "3 miles."

The authors suggest several paths forward:

  • End-to-End Training: In this study, the three stages were trained independently. Joint optimization could lead to better error correction.
  • Structured Data: Moving beyond simple slot-value pairs to using Knowledge Graphs as the external memory source.
  • Human Feedback: Incorporating Reinforcement Learning from Human Feedback (RLHF) to further refine the discriminator's ability to judge "appropriateness" beyond simple string matching.

Summary updated

Abstract

Conversational AI systems that rely on Large Language Models, like Transformers, have difficulty interweaving external data (like facts) with the language they generate. Vanilla Transformer architectures are not designed for answering factual questions with high accuracy. This paper investigates a possible route for addressing this problem. We propose to extend the standard Transformer architecture with an additional memory bank holding extra information (such as facts drawn from a knowledge base), and an extra attention layer for addressing this memory. We add this augmented memory to a Generative Adversarial Network-inspired Transformer architecture. This setup allows for implementing arbitrary felicity conditions on the generated language of the Transformer. We first demonstrate how this machinery can be deployed for handling factual questions in goal-oriented dialogues. Secondly, we demonstrate that our approach can be useful for applications like {\it style adaptation} as well: the adaptation of utterances according to certain stylistic (external) constraints, like social properties of human interlocutors in dialogues.
BibTeX
@misc{raaijmakers2024memory,
  author = {Stephan Raaijmakers and Roos Bakker and Anita Cremers and Roy de Kleijn and Tom Kouwenhoven and Tessa Verhoef},
  title = {{Memory-Augmented Generative Adversarial Transformers}},
  year = {2024},
  eprint = {2402.19218},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.19218},
}
Figure