Align on the Fly: Adapting Chatbot Behavior to Established Norms

Chunpu Xu, Steffi Chern, Ethan Chern, Ge Zhang, Zekun Wang, Ruibo Liu, Jing Li, Jie Fu, Pengfei LiuarXiv 2023

Abstract

In this paper, we aim to align large language models with the ever-changing, complex, and diverse human values (e.g., social norms) across time and locations. This presents a challenge to existing alignment techniques, such as supervised fine-tuning, which internalize values within model parameters. To overcome this, we propose an On-the-fly Preference Optimization (OPO) method, which is a real-time alignment that works in a streaming way. It employs an external memory to store established rules for alignment, which can constrain LLMs' behaviors without further training, allowing for convenient updates and customization of human values. We also introduce a scalable evaluation to assess the proposed method more effectively. Experimental results on both human-annotated and auto-generated questions from legal and moral domains indicate the effectiveness of the proposed OPO method.

Introduction

Aligning Large Language Models (LLMs) with human values is a critical challenge. Current methods like Supervised Fine-Tuning (SFT) and Reinforcement Learning from Human Feedback (RLHF) "internalize" values into model parameters. However, values are dynamic, varying across cultures and time. Re-training models for every shift is computationally expensive and often results in models that are misaligned with specific local or temporal norms.

Comparison between Internalized Alignment and OPO's Externalized Alignment.

This approach has three major flaws: values are dynamic and geographically dependent, fine-tuning is resource-intensive, and existing benchmarks often suffer from data leakage, making it difficult to distinguish between reasoning and memorization.

Methodology: On-the-fly Preference Optimization (OPO)

To address these limitations, we introduce On-the-fly Preference Optimization (OPO), an "externalized alignment" framework. OPO treats alignment as a retrieval problem rather than a parameter-optimization problem, making it "plug-and-play."

Comparison of alignment methods across key operational dimensions.

The OPO framework consists of three core modules:

  1. Rule Creation Module: A curated corpus of nearly one million rules, including Chinese national laws, middle school morality textbooks, and professional ethics guidelines (e.g., S&P Global’s ethics code).
  2. Alignment Module: Utilizing Retrieval-Augmented Generation (RAG), the system retrieves relevant rules from a vector database (Faiss) and injects them into the prompt as "soft limits" during inference.
  3. Evaluation Module: A scalable pipeline that uses GPT-4 to generate complex multiple-choice questions based on specific rules, ensuring the evaluation remains robust against benchmark leakage.

Experimental Results

The researchers utilized several distinct datasets for evaluation, including human-annotated legal questions (H-Law), auto-generated legal questions (A-Law), and various morality datasets (H-Basic-Morality, A-Professional-Morality, H-Social-Morality).

OPO was tested across 15 different LLMs, including GPT-4, ChatGPT, and open-source models like Llama2 and Qwen. Key findings include:

  • Consistent Gains: OPO improved performance across almost all models and datasets in a zero-shot setting.
  • GPT-4 Performance: On the A-Law dataset, GPT-4’s accuracy jumped from 84.43% (Base) to 94.65% (OPO).
  • Open Source Success: Smaller models saw dramatic relative improvements. For example, the XVERSE-Chat-13B model saw a +10.95% absolute increase in accuracy on the A-Law dataset.

Discussion and Key Insights

  • The "Oracle" Gap: Comparison with an "Oracle" setting (providing the exact rule) suggests that the current bottleneck for better alignment is retrieval model accuracy rather than the LLM's reasoning capabilities.
  • Context Length Sensitivity: Performance typically peaks at a context length of around 1,000 tokens; excessive rules can introduce noise that degrades model reasoning.
  • Reasoning Complexity: Legal questions proved significantly harder than moral ones, likely due to the multi-step logical deduction required by specific statutes.

Conclusion

OPO provides a training-free, scalable method for aligning LLMs with evolving human norms. While it introduces some inference latency and relies on retrieval quality, it offers a path toward geographically and temporally adaptive AI behavior. Future work will focus on multi-lingual expansion and resolving conflicting normative rules.

Summary updated

BibTeX
@misc{xu2023align,
  author = {Chunpu Xu and Steffi Chern and Ethan Chern and Ge Zhang and Zekun Wang and Ruibo Liu and Jing Li and Jie Fu and Pengfei Liu},
  title = {{Align on the Fly: Adapting Chatbot Behavior to Established Norms}},
  year = {2023},
  eprint = {2312.15907},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.15907},
}
Figure