Skip to main content
QUICK REVIEW

[Paper Review] Controlling Conditional Language Models without Catastrophic Forgetting

Tomasz Korbak, Hady Elsahar|arXiv (Cornell University)|Dec 1, 2021
Topic ModelingComputer Science6 citations
TL;DR

This paper proposes Conditional DPG (CDPG), an extension of distributional policy gradients that enables fine-tuning of conditional language models to meet specific control objectives—such as factual consistency in summarization or PEP8 compliance in code generation—without catastrophic forgetting. CDPG uses conditional energy-based models to guide fine-tuning, improving alignment with control criteria while preserving the original model's general capabilities across translation, summarization, and code generation tasks.

ABSTRACT

Machine learning is shifting towards general-purpose pretrained generative models, trained in a self-supervised manner on large amounts of data, which can then be applied to solve a large number of tasks. However, due to their generic training methodology, these models often fail to meet some of the downstream requirements (e.g., hallucinations in abstractive summarization or style violations in code generation). This raises the important question of how to adapt pre-trained generative models to meet all requirements without destroying their general capabilities ("catastrophic forgetting"). Recent work has proposed to solve this problem by representing task-specific requirements through energy-based models (EBMs) and approximating these EBMs using distributional policy gradients (DPG). Despite its effectiveness, this approach is however limited to unconditional distributions. In this paper, we extend DPG to conditional tasks by proposing Conditional DPG (CDPG). We evaluate CDPG on four different control objectives across three tasks (translation, summarization and code generation) and two pretrained models (T5 and GPT-Neo). Our results show that fine-tuning using CDPG robustly moves these pretrained models closer towards meeting control objectives and -- in contrast with baseline approaches -- does not result in catastrophic forgetting.

Motivation & Objective

  • To address the challenge of fine-tuning conditional language models to meet specific control objectives without losing general capabilities.
  • To extend distributional policy gradients (DPG), originally limited to unconditional generation, to conditional settings where context-dependent control is required.
  • To mitigate catastrophic forgetting during fine-tuning by using conditional energy-based models (EBMs) that preserve the original model's distributional properties.
  • To evaluate CDPG across diverse tasks—translation, summarization, code generation—on two pretrained models: T5 and GPT-Neo.
  • To demonstrate that CDPG improves control objective adherence while maintaining or enhancing generation quality and diversity.

Proposed method

  • CDPG extends DPG by modeling control objectives via conditional energy-based models (EBMs), where each context c defines a distinct unnormalized distribution P_c.
  • The method minimizes the average divergence between the model’s conditional distribution p_c and the normalized EBM P_c, ensuring alignment with control constraints.
  • It uses distributional policy gradients to optimize the model parameters θ, updating them based on gradient estimates from sampled sequences under the conditional EBM.
  • The approach leverages a reward signal b(x,c) indicating whether a generated sequence x satisfies the control objective for context c, enabling reinforcement-style learning without ground-truth labels.
  • Fine-tuning is performed end-to-end on pretrained models (T5 and GPT-Neo), preserving their pretraining inductive biases while adapting to task-specific constraints.
  • The method is applied to three control objectives: digit translation, factual consistency in summarization, and PEP8 compliance in code generation.

Experimental results

Research questions

  • RQ1Can distributional policy gradients be extended to conditional language models to enable control without catastrophic forgetting?
  • RQ2How effectively can CDPG enforce control objectives such as factual consistency or style compliance in summarization and code generation?
  • RQ3Does CDPG maintain or improve generation quality and diversity compared to baseline fine-tuning and reinforcement learning methods?
  • RQ4To what extent does CDPG improve the likelihood of satisfying control constraints, such as translating numerals as digits or generating PEP8-compliant code?
  • RQ5Can CDPG generalize across different models (T5, GPT-Neo) and tasks (translation, summarization, code generation) with minimal architectural changes?

Key findings

  • CDPG increased the likelihood of generating sequences satisfying a numeral-to-digit translation constraint by 116 times compared to the original model.
  • In summarization, CDPG fine-tuning improved factual consistency, increasing the number of correct and relevant named entities in summaries and boosting Rouge scores.
  • For code generation, CDPG reduced PEP8 violations and increased compilation success from 40% to over 80% on average, demonstrating strong adherence to style constraints.
  • Unlike reinforcement learning baselines, CDPG did not degrade the diversity or fluency of generated text, preserving model quality.
  • CDPG effectively fine-tuned both T5 and GPT-Neo across all tasks, showing robustness and generalization across different model architectures.
  • The method successfully avoided catastrophic forgetting, maintaining the original model’s broad capabilities while achieving targeted control.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.