Table of Contents
Fetching ...

Unraveling Indirect In-Context Learning Using Influence Functions

Hadi Askari, Shivanshu Gupta, Terry Tong, Fei Wang, Anshuman Chhabra, Muhao Chen

TL;DR

This paper broadens In-Context Learning by introducing Indirect ICL, which selects demonstrations from task-agnostic pools or noisy data rather than directly labeled end-task samples. It leverages Influence Functions to quantify how individual demonstrations influence model predictions and uses this signal to re-rank and prune candidates in two settings: Mixture of Tasks and Noisy ICL. Across extensive experiments with multiple LLMs and tasks, the authors show that IF-based strategies, especially when combined with semantic similarity metrics, improve accuracy and provide resilience to mislabeled data and backdoor attacks. The work suggests a general, robust framework for demonstration selection that extends beyond traditional ICL, highlighting the practical impact of task inductive bias in prompt-based learning.

Abstract

In this work, we introduce a novel paradigm for generalized In-Context Learning (ICL), termed Indirect In-Context Learning. In Indirect ICL, we explore demonstration selection strategies tailored for two distinct real-world scenarios: Mixture of Tasks and Noisy ICL. We systematically evaluate the effectiveness of Influence Functions (IFs) as a selection tool for these settings, highlighting the potential of IFs to better capture the informativeness of examples within the demonstration pool. For the Mixture of Tasks setting, demonstrations are drawn from 28 diverse tasks, including MMLU, BigBench, StrategyQA, and CommonsenseQA. We demonstrate that combining BertScore-Recall (BSR) with an IF surrogate model can further improve performance, leading to average absolute accuracy gains of 0.37\% and 1.45\% for 3-shot and 5-shot setups when compared to traditional ICL metrics. In the Noisy ICL setting, we examine scenarios where demonstrations might be mislabeled or have adversarial noise. Our experiments show that reweighting traditional ICL selectors (BSR and Cosine Similarity) with IF-based selectors boosts accuracy by an average of 2.90\% for Cosine Similarity and 2.94\% for BSR on noisy GLUE benchmarks. For the adversarial sub-setting, we show the utility of using IFs for task-agnostic demonstration selection for backdoor attack mitigation. Showing a 32.89\% reduction in Attack Success Rate compared to task-aware methods. In sum, we propose a robust framework for demonstration selection that generalizes beyond traditional ICL, offering valuable insights into the role of IFs for Indirect ICL.

Unraveling Indirect In-Context Learning Using Influence Functions

TL;DR

This paper broadens In-Context Learning by introducing Indirect ICL, which selects demonstrations from task-agnostic pools or noisy data rather than directly labeled end-task samples. It leverages Influence Functions to quantify how individual demonstrations influence model predictions and uses this signal to re-rank and prune candidates in two settings: Mixture of Tasks and Noisy ICL. Across extensive experiments with multiple LLMs and tasks, the authors show that IF-based strategies, especially when combined with semantic similarity metrics, improve accuracy and provide resilience to mislabeled data and backdoor attacks. The work suggests a general, robust framework for demonstration selection that extends beyond traditional ICL, highlighting the practical impact of task inductive bias in prompt-based learning.

Abstract

In this work, we introduce a novel paradigm for generalized In-Context Learning (ICL), termed Indirect In-Context Learning. In Indirect ICL, we explore demonstration selection strategies tailored for two distinct real-world scenarios: Mixture of Tasks and Noisy ICL. We systematically evaluate the effectiveness of Influence Functions (IFs) as a selection tool for these settings, highlighting the potential of IFs to better capture the informativeness of examples within the demonstration pool. For the Mixture of Tasks setting, demonstrations are drawn from 28 diverse tasks, including MMLU, BigBench, StrategyQA, and CommonsenseQA. We demonstrate that combining BertScore-Recall (BSR) with an IF surrogate model can further improve performance, leading to average absolute accuracy gains of 0.37\% and 1.45\% for 3-shot and 5-shot setups when compared to traditional ICL metrics. In the Noisy ICL setting, we examine scenarios where demonstrations might be mislabeled or have adversarial noise. Our experiments show that reweighting traditional ICL selectors (BSR and Cosine Similarity) with IF-based selectors boosts accuracy by an average of 2.90\% for Cosine Similarity and 2.94\% for BSR on noisy GLUE benchmarks. For the adversarial sub-setting, we show the utility of using IFs for task-agnostic demonstration selection for backdoor attack mitigation. Showing a 32.89\% reduction in Attack Success Rate compared to task-aware methods. In sum, we propose a robust framework for demonstration selection that generalizes beyond traditional ICL, offering valuable insights into the role of IFs for Indirect ICL.
Paper Structure (36 sections, 11 equations, 3 figures, 24 tables)

This paper contains 36 sections, 11 equations, 3 figures, 24 tables.

Figures (3)

  • Figure 1: Example showcasing demonstration selection for Indirect ICL using Influence Functions (IFs). Consider web corpora with many tasks (different from the end-task) and noisy data-- Indirect ICL can be formalized as: Mixture of Tasks (\ref{['MoT']}) and Noisy (\ref{['ssec:noisy']}) ICL, respectively. In MoT, for a given target task (e.g. Medical Genetics), we first filter from this (indirect) pool of candidate demonstrations using BertScore and Cosine Similarity, then re-rank with IFs to select suitable demonstrations (e.g. High-School Biology). For Noisy ICL, we leverage IFs to filter out the Noisy ICL before conducting ICL with the remaining clean demonstrations.
  • Figure 2: Average performance of different demonstration selection methods across Llama2-13b-chat, Zephyr-7b-beta and Mistral-7b-v0.3 for $k=3$ shots.
  • Figure 3: Average performance of the baselines across the 4 datasets.