Unsupervised Cross-Task Generalization via Retrieval Augmentation

Bill Yuchen Lin, Kangmin Tan, Chris Miller, Beiwen Tian, Xiang Ren

TL;DR

When faced with an entirely new task, massive multi-task language models (like T0 or FLAN) are typically left frozen. ReCross changes this by using just a few unlabeled examples of a new task to retrieve the most relevant data from the model's original training mixture, updating the model on-the-fly to significantly boost its zero-shot generalization performance.

What Problem Does This Paper Address?

Large language models trained on massive multi-task datasets exhibit an impressive ability to generalize to unseen tasks. However, in real-world applications, a user might want a model to perform a highly specific, unseen task, providing only a handful of unlabeled examples (inputs with instructions, but no ground-truth labels) as "hints."

Standard fine-tuning isn't an option here because there are no labels. Keeping the model completely frozen, on the other hand, leaves a lot of performance on the table. The authors address this gap—dubbed unsupervised cross-task generalization—by asking: How can we leverage a few unlabeled target examples to safely adapt a multi-task model to a completely new domain?

Figure 1: The unsupervised cross-task generalization problem. In the upstream training stage, we train a multi-task NLP model, M, with a diverse collection of upstream tasks. In the generalization stage, given an unseen task Ui with a few unlabeled examples Qi, we want to update the upstream model (via retrieval augmentation) such that it can generalize to the target task.

Methods

The authors introduce ReCross (Retrieval Augmentation for Cross-Task Generalization), a two-stage framework that finds the best "skills" from the model's upstream training history to prepare it for the new task.

Figure 2: ReCross is a retrieval-augmentation method for unsupervised cross-task general- ization. We reuse the encoder layers of the upstream model (green) to build a dense index, which consists of vectors of the upstream examples D. We also propose an algorithm to generate distant supervision for training a reranker, which takes a pair of examples as input and outputs a score. During the evaluation, we encode query examples Qi for querying the index to get initial ranking results R′, and then pair them with the queries again for reranking. Finally, we take the top-K results (i.e., R) for generalizing the upstream model M to the unseen task Ui.
  1. Dense Retrieval: ReCross first builds a dense index of all upstream training data. Instead of using off-the-shelf text embedding models, it uses the internal encoding layers of the multi-task model itself. It takes the unlabeled target examples as queries and performs a Maximum Inner Product Search (MIPS) to find initial candidate examples.
  2. Cross-Encoder Reranking: To fix the standard dual-encoder limitation (which misses token-to-token interactions), ReCross applies a RoBERTa-based cross-encoder to score and rerank the query-candidate pairs.
  3. Distant Supervision Mining: Training a reranker normally requires labels showing which retrieved examples actually help. Since these don't exist, the authors designed a clever meta-learning-inspired algorithm. They simulate "unseen" tasks using the upstream data, fine-tune the model on candidate subsets, and score them based on how much they reduce validation loss.
  4. Re-learning: Finally, the top-ranked retrieved upstream data is used to fine-tune the multi-task model for a few steps with a very small learning rate before running inference on the target task.

To make experimentation accessible, the authors also introduce BART0, a 0.4-billion parameter variant of T0-3B that achieves comparable zero-shot performance while being 8x smaller.

Datasets

The framework was evaluated using:

  • Upstream Data: 36 diverse NLP datasets converted into text-to-text formats using PromptSource templates (the same mixture used by T0).
  • Target Unseen Tasks: 10 held-out tasks from the T0 evaluation suite (including ANLI, H-Swag, CommitmentBank, WiC, Winogrande, and SQuAD v2).
  • BIG-bench Tasks: 5 challenging out-of-distribution tasks (e.g., strategyqa, movie_dialog) to test extreme generalization.

Key Insights and Ideas

  • Internal Features > Surface Semantics: Using the multi-task model's own internal representations for dense retrieval vastly outperforms semantic embedding models like SentenceBERT. The model's internal embeddings capture the "thinking process" and underlying reasoning skills required, rather than just surface-level word similarities.
  • Formatting is a Strong Cue: When the authors perturbed the prompt templates of the query examples (by stripping them down to raw concatenation or replacing words randomly), retrieval performance degraded to near-random levels. This proves that structural formatting cues are vital for the model to map new tasks to past knowledge.
  • Reasoning Over Format: Counterintuitively, removing tasks with the same format from the retrieval pool can sometimes improve performance. For instance, removing multiple-choice QA tasks from the index actually improved performance on the multiple-choice ARC task. This suggests that similarity in reasoning types is far more critical than format similarity, which can cause the model to overfit to seen domains.

Key Results

ReCross consistently outperforms non-retrieval baselines and alternative retrieval methods across the board:

  • Overall Performance Boost: On the 10 core target tasks, ReCross improved the average SoftEM score by 4.15 percentage points over the baseline BART0 model.
  • Reranking Value: The full ReCross pipeline outperformed its dual-encoder-only version ($\text{ReCross}^\dagger$), demonstrating the clear value of the mined distant supervision reranker.
Main experimental results comparing ReCross against baselines.
  • Instruction Following in BIG-bench: On the movie_dialog task, frozen models completely failed to follow the prompt instructions (scoring near 0%). ReCross successfully adapted the model, skyrocketing its performance to 37.22%.
Results on a subset of BIG-bench tasks.

Limitations and Future Work

While highly effective, ReCross has a few notable limitations:

  • Lack of Transferability: The dense index and the trained reranker are tightly coupled to the specific base model used to create them. They do not automatically align or transfer to other architectures (like T0-3B) without re-indexing.
  • Iterative Saturation: Attempting to run the distant supervision mining process iteratively (self-training style) caused performance to saturate quickly after the first iteration.

Future work includes exploring common embedding spaces to make the index cross-compatible across different models, and finding better ways to directly inject query information during the fine-tuning stage.

Summary updated

BibTeX
@inproceedings{lin2022unsupervised,
  author = {Bill Yuchen Lin and Kangmin Tan and Chris Miller and Beiwen Tian and Xiang Ren},
  title = {{Unsupervised Cross-Task Generalization via Retrieval Augmentation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=kB9jrZDenff},
}
Figure