Revision Transformers: Instructing Language Models to Change Their Values

Felix Friedrich, Wolfgang Stammer, Patrick Schramowski, Kristian Kersting

Abstract

Current transformer language models (LM) are large-scale models with billions of parameters. They have been shown to provide high performances on a variety of tasks but are also prone to shortcut learning and bias. Addressing such incorrect model behavior via parameter adjustments is very costly. This is particularly problematic for updating dynamic concepts, such as moral values, which vary culturally or interpersonally. In this work, we question the current common practice of storing all information in the model parameters and propose the Revision Transformer (RiT) to facilitate easy model updating. The specific combination of a large-scale pre-trained LM that inherently but also diffusely encodes world knowledge with a clear-structured revision engine makes it possible to update the model's knowledge with little effort and the help of user interaction. We exemplify RiT on a moral dataset and simulate user feedback demonstrating strong performance in model revision even with small data. This way, users can easily design a model regarding their preferences, paving the way for more transparent AI models.

Introduction

Large Language Models (LLMs) are often described as "stochastic parrots," inheriting biases, outdated worldviews, and specific cultural norms from their massive, uncurated training sets. When these models exhibit incorrect or biased behavior, the traditional solution is parameter fine-tuning. However, this approach faces three major hurdles: the prohibitive computational cost of retraining billions of parameters, the inherent subjectivity of moral values across different cultures, and the temporal decay of knowledge.

Instead of treating the model as a static black box, we propose decoupling "world knowledge" from "specific values." By managing values externally, we can create models that are personalized, transparent, and easily updated. The Revision Transformer (RiT) achieves this by utilizing a non-parametric revision engine that allows for on-the-fly adjustments through human interaction.

Conceptual overview of RiT's interactive value update process.

The Revision Transformer (RiT) Architecture

The RiT framework introduces a retrieval-augmented generation (RAG) pipeline that sits alongside a frozen, pre-trained LLM. This architecture ensures that the core capabilities of the model remain intact while its specific outputs are guided by a user-editable corpus.

The Revision Engine and Retrieval Pipeline

The core of the system is the Revision Engine, which contains a corpus of text entries representing desired values or corrected knowledge. When a user submits a query, the system follows a structured process:

  1. Embedding: A sentence-level LLM (S-LLM) converts both the user query and the corpus entries into high-dimensional embeddings.
  2. Similarity Search: The system calculates the similarity between the query and the corpus. If the similarity score exceeds a predefined threshold ($t$), the most relevant corrective context ($C_r$) is retrieved.
  3. Contextualization: The retrieved context is prepended to the user's query in a specific prompt format (e.g., "Context: [Retrieved Info] Question: [User Query] Answer:"). This forces the LLM to prioritize the provided context over its internal pre-trained biases.
Technical architecture of the Revision Engine and retrieval pipeline.

Interactive Feedback Loop

A key strength of RiT is its "human-in-the-loop" capability. If the model is uncertain (indicated by low similarity scores) or provides an incorrect answer, a user can interactively add new examples to the revision engine. This allows the model to "learn" from its mistakes instantly without requiring a single gradient update or expensive retraining session.

Experimental Evaluation

We evaluated RiT using the Commonsense Norm Bank (CNB), a dataset focused on moral judgments and societal norms. We tested the framework across various base models, including T0 and Bloom (ranging from 3b to 176b parameters).

Key Results

  • Accuracy Improvements: The baseline T0 model achieved a moral alignment accuracy of 63%. By integrating the training data into the RiT revision engine, accuracy rose to 86% without any additional training.
  • Iterative Success: In simulations of user interaction (the i2RiT model), where context was added for examples the model was initially uncertain about, accuracy reached 91%.
  • Data Efficiency: RiT proved remarkably data-efficient. Comparable performance to full fine-tuning was achieved using as little as 7.5% of the training data as retrieved context.
  • NLG Quality: Natural Language Generation scores, such as BLEU-3, more than doubled (from 0.25 to 0.69), showing that the model's justifications for its moral judgments became significantly more human-like and aligned with the provided norms.

Discussion and Conclusion

RiT represents a shift toward "democratic" AI, where users can swap out revision engines to change a model's cultural or ethical perspective as easily as changing a plugin. While the system's performance is dependent on the quality of the retrieval mechanism and the S-LLM, it offers a transparent and cost-effective alternative to traditional fine-tuning.

Future work will address the potential for malicious revisions and the scaling of context retrieval for massive corpora. By moving values out of the parameters and into a user-controlled engine, RiT paves the way for AI systems that are more adaptable, accountable, and aligned with the diverse needs of global users.

Summary updated

BibTeX
@inproceedings{friedrich2022revision,
  author = {Felix Friedrich and Wolfgang Stammer and Patrick Schramowski and Kristian Kersting},
  title = {{Revision Transformers: Instructing Language Models to Change Their Values}},
  booktitle = {ECAI},
  year = {2022},
  url = {https://openreview.net/forum?id=upHwAYLN3S},
}
Figure