Showing posts with label Model Generalization. Show all posts
Showing posts with label Model Generalization. Show all posts

10.5.25

New Research Compares Fine-Tuning and In-Context Learning for LLM Customization

 On May 9, 2025, VentureBeat reported on a collaborative study by Google DeepMind and Stanford University that evaluates two prevalent methods for customizing large language models (LLMs): fine-tuning and in-context learning (ICL). The research indicates that ICL generally provides better generalization capabilities compared to traditional fine-tuning, especially when adapting models to novel tasks. 

Understanding Fine-Tuning and In-Context Learning

Fine-tuning involves further training a pre-trained LLM on a specialized dataset, adjusting its internal parameters to acquire new knowledge or skills. In contrast, ICL does not alter the model's parameters; instead, it guides the model by providing examples of the desired task within the input prompt, allowing the model to infer how to handle similar queries. 

Experimental Approach

The researchers designed controlled synthetic datasets featuring complex, self-consistent structures, such as imaginary family trees and hierarchies of fictional concepts. To ensure the novelty of the information, they replaced all nouns, adjectives, and verbs with invented terms, preventing any overlap with the models' pre-training data. The models were then tested on various generalization challenges, including logical deductions and reversals. 

Key Findings

The study found that, in data-matched settings, ICL led to better generalization than standard fine-tuning. Models utilizing ICL were more adept at tasks like reversing relationships and making logical deductions from the provided context. However, ICL is generally more computationally expensive at inference time, as it requires providing additional context to the model for each use. 

Introducing Augmented Fine-Tuning

To combine the strengths of both methods, the researchers proposed an augmented fine-tuning approach. This method involves using the LLM's own ICL capabilities to generate diverse and richly inferred examples, which are then added to the dataset used for fine-tuning. Two main data augmentation strategies were explored:

  1. Local Strategy: Focusing on individual pieces of information, prompting the LLM to rephrase single sentences or draw direct inferences, such as generating reversals.

  2. Global Strategy: Providing the full training dataset as context, then prompting the LLM to generate inferences by linking particular documents or facts with the rest of the information, leading to longer reasoning traces.

Models fine-tuned on these augmented datasets showed significant improvements in generalization, outperforming both standard fine-tuning and plain ICL. 

Implications for Enterprise AI Development

This research offers valuable insights for developers and enterprises aiming to adapt LLMs to specific domains or proprietary information. While ICL provides superior generalization, its computational cost at inference time can be high. Augmented fine-tuning presents a balanced approach, enhancing generalization capabilities while mitigating the continuous computational demands of ICL. By investing in creating ICL-augmented datasets, developers can build fine-tuned models that perform better on diverse, real-world inputs.

  Anthropic Enhances Claude Code with Support for Remote MCP Servers Anthropic has announced a significant upgrade to Claude Code , enablin...