Skip to main content
QUICK REVIEW

[Paper Review] Generalization Properties of Retrieval-based Models

Soumya Basu, Ankit Singh Rawat|arXiv (Cornell University)|Oct 6, 2022
Machine Learning and Data ClassificationComputer Science5 citations
TL;DR

This paper provides a theoretical analysis of retrieval-based models in classification, proposing a local empirical risk minimization (local ERM) framework that uses retrieved training examples to train simple, low-complexity models per input. It demonstrates that under local regularity assumptions, such models achieve strong generalization with minimal parametric capacity, outperforming standard models on ImageNet with a small MobileNet-V3 and competitive accuracy using only 4.01M parameters.

ABSTRACT

Many modern high-performing machine learning models such as GPT-3 primarily rely on scaling up models, e.g., transformer networks. Simultaneously, a parallel line of work aims to improve the model performance by augmenting an input instance with other (labeled) instances during inference. Examples of such augmentations include task-specific prompts and similar examples retrieved from the training data by a nonparametric component. Remarkably, retrieval-based methods have enjoyed success on a wide range of problems, ranging from standard natural language processing and vision tasks to protein folding, as demonstrated by many recent efforts, including WebGPT and AlphaFold. Despite growing literature showcasing the promise of these models, the theoretical underpinning for such models remains underexplored. In this paper, we present a formal treatment of retrieval-based models to characterize their generalization ability. In particular, we focus on two classes of retrieval-based classification approaches: First, we analyze a local learning framework that employs an explicit local empirical risk minimization based on retrieved examples for each input instance. Interestingly, we show that breaking down the underlying learning task into local sub-tasks enables the model to employ a low complexity parametric component to ensure good overall accuracy. The second class of retrieval-based approaches we explore learns a global model using kernel methods to directly map an input instance and retrieved examples to a prediction, without explicitly solving a local learning task.

Motivation & Objective

  • To understand the theoretical underpinnings of retrieval-based models, which combine parametric and nonparametric learning but lack formal analysis.
  • To investigate how retrieval of similar training examples improves generalization in classification tasks.
  • To formalize the conditions under which local learning via retrieved examples leads to strong performance with low-complexity models.
  • To compare local ERM with global models and kNN baselines across diverse datasets, including CIFAR-10 and ImageNet.

Proposed method

  • Proposes a local ERM framework: for each test input, retrieve nearby training examples and train a local model using only those examples.
  • Derives finite-sample generalization bounds that balance model complexity and neighborhood size under local regularity assumptions.
  • Uses kernel methods and parametric models (linear, MLP, polynomial, RBF) as local predictors on retrieved sets.
  • Employs L2 distance in input or embedding space for retrieval, with unsupervised features (e.g., ALIGN) for high-dimensional data.
  • Applies fine-tuning with Adam optimizer on small models (e.g., MobileNet-V3) for local ERM in large-scale settings.
  • Compares performance against standard ERM, kNN, and SoTA models on ImageNet, CIFAR-10, and synthetic data.

Experimental results

Research questions

  • RQ1How does the size of the retrieved neighborhood affect the generalization performance of local ERM models?
  • RQ2Under what conditions does local learning via retrieval outperform global parametric learning?
  • RQ3Can a low-complexity parametric model achieve high accuracy when trained on retrieved examples alone?
  • RQ4What is the role of global representations (e.g., from ALIGN) in enhancing local ERM performance?
  • RQ5How does the trade-off between approximation error and generalization error manifest in retrieval-based learning?

Key findings

  • On ImageNet, a small MobileNet-V3 model (4.01M parameters) trained via local ERM achieved 82.78% top-1 accuracy, significantly outperforming the same model trained globally (65.80%).
  • The local ERM approach achieved competitive performance (82.78%) compared to a SoTA ViT-G/14 model (90.45% top-1 accuracy) with vastly reduced model size and compute cost.
  • On CIFAR-10, performance peaked at intermediate neighborhood sizes, confirming a trade-off between generalization error (small sets) and approximation error (large sets).
  • Using global representations (ALIGN embeddings) enabled a simple linear model to outperform a more complex MobileNet-V3 model trained directly on raw image inputs.
  • The finite-sample generalization bounds show that local regularity allows low-complexity models to generalize well when the neighborhood is small and representative.
  • The results validate that retrieval-based models can achieve high performance by implicitly performing local learning with minimal parametric capacity.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.