Nano: Nested Human-in-the-Loop Reward Learning for Few-shot Language Model Control

Xiang Fan, Yiwei Lyu, Paul Pu Liang, Ruslan Salakhutdinov, Louis-Philippe Morency

Introduction

Large Language Models (LLMs) have demonstrated remarkable capabilities in general text generation. However, steering these models toward specific, often subjective, user preferences remains a significant challenge. Traditional methods for Controllable Text Generation (CTG) typically rely on large datasets or pre-defined categories, making them ill-suited for "unquantified" distributions—such as a user's personal taste in hotel reviews or specific news interests.

NANO (Nested Human-in-the-Loop Reward Learning) addresses this gap by introducing a sample-efficient framework that allows users to steer LLMs using only a handful of ratings. By nesting a guided tree search within a continuous human feedback cycle, NANO achieves state-of-the-art control over subjective text distributions.

The Challenge of Subjective Control

Most existing CTG research focuses on quantified goals, such as maintaining a specific ratio of topics (e.g., 30% science, 70% art). While useful, these methods do not translate well to subjective preferences. How does one mathematically define "surprising news" or "reviews focusing on specific amenities"? These preferences vary by individual and are difficult to capture without extensive manual labeling. NANO aims to bridge this gap, enabling models to learn arbitrary, subjective distributions quickly.

The NANO Framework

The core of NANO is its "nested" architecture, comprising two distinct loops that work in tandem to refine the model's output.

1. The Outer Loop: Active Learning

The outer loop follows a classic active learning cycle: Generate, Label, and Train. The model produces a set of candidate sentences, which a human user then rates (e.g., on a scale of 1 to 5). These ratings are used to update both a "critic" network and the "generator" itself. This iterative process ensures that the model's understanding of the target distribution improves with every round of feedback.

2. The Inner Loop: Guided Generation

During the generation phase, NANO employs an inner loop to ensure high-quality outputs even before the model is fully trained. Instead of sampling tokens blindly, NANO performs a tree search guided by the critic network. At each step, the critic evaluates potential completions, and a "soft loss" is backpropagated to temporarily shift the language model's internal states toward the desired goal.

The NANO framework iteratively refines the model's output distribution through a Generate-Label-Train loop.

Technical Innovation: Complementary Loss

A significant hurdle in few-shot learning is making the most of negative feedback. Simply suppressing "bad" words often results in disfluent or repetitive text. NANO introduces a Complementary Loss function. When a human provides a low rating, the model doesn't just penalize those tokens; it boosts the probability of all other valid tokens. This approach preserves the natural flow of language while effectively steering the model away from unwanted attributes.

Experimental Results

The researchers evaluated NANO across personalization tasks, quantified distributions (biographies and cuisines), and single-attribute control benchmarks.

Personalization and Subjective Taste

In a hotel review task, NANO successfully learned the distinct preferences of different annotators. For instance, it identified that one user prioritized indoor facilities while another focused on location. When models were cross-evaluated, users gave significantly lower scores to models tuned for someone else's taste, confirming that NANO captured individual "vibes" rather than just general quality.

Example of personalized generation where NANO captures specific user preferences compared to standard GPT-2.

Efficiency and Accuracy

NANO demonstrated exceptional sample efficiency. On topic control tasks (e.g., Politics, Space), it achieved over 99% accuracy with fewer than 400 human labels. In the Biography dataset, NANO hit target distributions with near-perfect precision. For a requested 50/50 gender split, NANO achieved exactly 50.0%, a stark contrast to the base GPT-2 model, which naturally produced only 7.4% female biographies.

Key Insights

  • Iterative Refinement: Providing feedback in small batches over multiple rounds is far more effective than providing a large batch of labels at once. This allows the model to improve between rounds, making subsequent human effort more productive.
  • Signal from Negative Data: By using the complementary loss, NANO extracts valuable information from negative samples that other methods might discard, which is crucial in data-scarce, few-shot scenarios.
  • Search vs. Prompting: While zero-shot prompting is popular, it often fails to capture subtle distributional goals. NANO’s inner-loop search provides the necessary "nudge" to maintain control without sacrificing fluency.

Limitations and Future Work

Despite its success, NANO is limited by the underlying knowledge of the base language model; it cannot generate facts the model hasn't learned. Additionally, the current implementation relies on sentence-level feedback. Future iterations could benefit from fine-grained feedback, where users highlight specific phrases or words within a sentence to provide even more precise guidance.

Conclusion

NANO represents a significant step forward in making LLMs truly personalizable. By combining active human feedback with guided search, it enables precise control over subjective text generation with minimal human effort, paving the way for AI assistants that truly understand and adapt to individual user tastes.

Paper Citation: Fan, X., Lyu, Y., Liang, P. P., Salakhutdinov, R., & Morency, L.-P. (2023). NANO: Nested Human-in-the-Loop Reward Learning for Few-shot Language Model Control. Findings of the Association for Computational Linguistics: ACL 2023.

Summary updated

BibTeX
@inproceedings{fan2023nano,
  author = {Xiang Fan and Yiwei Lyu and Paul Pu Liang and Ruslan Salakhutdinov and Louis-Philippe Morency},
  title = {{Nano: Nested Human-in-the-Loop Reward Learning for Few-shot Language Model Control}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.findings-acl.758},
}
Figure