← Latest papers
🤖 machine learning

CRUMB: Efficient Prior Fitted Network Inference via Distributionally Matched Context Batching

This paper introduces CRUMB, an architecture-agnostic inference wrapper that significantly improves the efficiency and performance of Prior-Fitted Networks by clustering test queries and selecting distributionally matched training subsets via MMD minimization, thereby enabling effective in-context learning on large datasets without retraining.

Original authors: Jamie Heredge, Mattia J. Villani, Pranav Deshpande, Akshay Seshadri, Niraj Kumar

Published 2026-06-11
📖 5 min read🧠 Deep dive

Original authors: Jamie Heredge, Mattia J. Villani, Pranav Deshpande, Akshay Seshadri, Niraj Kumar

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

The Problem: The Overwhelmed Librarian

Imagine you have a brilliant librarian (this is the Prior-Fitted Network, or PFN). This librarian has read every book in the world during their training. If you ask them a question, they don’t need to study your specific topic; they just use what they already know to give you an answer instantly.

However, there is a catch. To answer your question, the librarian needs you to hand them a stack of reference books (the training data) that are relevant to your question.

  • The Old Way: If you have 10,000 reference books, the librarian has to read all of them to find the answer. This takes a huge amount of time and brainpower (memory). It’s like asking the librarian to read an entire library just to answer one question.
  • The "Quick" Way: You could just pick 10 random books to hand them. This is fast, but those 10 books might be about cooking when your question is about physics. The answer will be bad.
  • The "Personal" Way: For every single question you ask, you find the 10 most relevant books. This gives a great answer, but it’s incredibly slow. If you have 1,000 questions, the librarian has to start reading from scratch 1,000 times.

The Solution: CRUMB (Clustered Retrieval Using Minimised-MMD Batching)

The authors propose a method called CRUMB. Think of CRUMB as a smart assistant who organizes the work so the librarian doesn’t get overwhelmed, but still gets the right books.

CRUMB works in three stages:

Stage 1: Grouping the Questions (Clustering)

Instead of handing the librarian 1,000 individual questions one by one, CRUMB looks at all the questions and groups them into 20 buckets (clusters).

  • Analogy: Imagine you have a pile of 1,000 mixed-up mail letters. Instead of sorting them one by one, you quickly sort them into 20 piles: "Bills," "Magazines," "Family," "Work," etc. Now you have 20 distinct topics instead of 1,000 individual items.

Stage 2: Finding the Right Books for Each Bucket (MMD Selection)

For each of the 20 buckets of questions, CRUMB goes to the library (the training data) and picks out a small, specific set of reference books.

  • The Secret Sauce (MMD): CRUMB doesn’t just pick books that are close to the questions (like finding the nearest neighbor). It uses a mathematical trick called Maximum Mean Discrepancy (MMD).
  • Analogy: Imagine the "Bills" bucket contains questions about electricity, water, and internet. A simple method might just pick books about electricity because it’s the most common. But CRUMB uses MMD to ensure the selected books cover the whole variety of the bucket. It picks a few books on electricity, a few on water, and a few on internet, ensuring the "distribution" of the books matches the "distribution" of the questions. It avoids picking 10 books on electricity and zero on water.

Stage 3: The Librarian Works in Batches (Batched Inference)

Now, the librarian takes the first bucket (e.g., "Bills") and the specific set of books selected for it. They read those books and answer all the questions in that bucket at once. Then they move to the next bucket.

  • Result: Instead of 1,000 separate reading sessions, the librarian only does 20 reading sessions. This is much faster.

Why is CRUMB Better?

The paper compares CRUMB to other methods and finds two main advantages:

  1. Speed vs. Accuracy Balance:

    • Uniform Subsampling (picking random books) is fast but inaccurate.
    • kNN (picking the nearest book for every single question) is accurate but very slow.
    • CRUMB is almost as accurate as kNN but much faster because it batches the work. It achieves this by ensuring the books it picks are statistically representative of the questions in that batch.
  2. Resilience to "Drift" (Changing Trends):

    • Imagine the questions you ask change over time. Maybe last month you asked mostly about winter coats, but this month you’re asking about swimsuits. This is called Covariate Drift.
    • Other methods (like MICP) organize their books based on how the library is arranged. If the library is organized for winter, it struggles when you suddenly ask about summer.
    • CRUMB organizes based on your current questions. Because it looks at your current batch of questions first, it naturally adapts. If your questions shift to swimsuits, CRUMB immediately selects books about swimsuits. The paper shows that as the "drift" gets worse, CRUMB stays much more accurate than other methods.

Summary

CRUMB is a wrapper that sits in front of a powerful AI model. It says:

  1. "Don't look at every question individually."
  2. "Group similar questions together."
  3. "For each group, pick a diverse set of reference data that matches the group's needs."
  4. "Answer the whole group at once."

This allows the AI to handle massive amounts of data quickly without losing accuracy, and it handles changing data trends better than previous methods.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →