LoRARecycleAlgorithm<T, TInput, TOutput>

Models & Types · AiDotNet.MetaLearning.Algorithms

Implementation of LoRA-Recycle (Hu et al., CVPR 2025).

Inheritance: ModelBase<T, TInput, TOutput> → MetaLearnerBase<T, TInput, TOutput> → LoRARecycleAlgorithm<T, TInput, TOutput>

Implements: IGeneratedParameterRegistrar<T>

How It Works

LoRA-Recycle enables tuning-free few-shot adaptation by recycling pre-tuned LoRA adapters. It maintains a bank of task-specific LoRA adapters and a prototype-based selection mechanism that computes task embeddings from the support set to weight and combine stored adapters without any gradient-based inner-loop optimization.

Algorithm:

Key difference from MAML: No gradient-based inner-loop optimization at inference time. Adaptation is a single forward pass through the prototype encoder followed by adapter selection and fusion.

Constructors

Constructor Summary
LoRARecycleAlgorithm(LoRARecycleOptions<T, TInput, TOutput> options)

Properties

Property Summary
MetaLearningAlgorithmType AlgorithmType { get; }

Methods

Method Summary
IModel<TInput, TOutput, ModelMetadata<T>> Adapt(IMetaLearningTask<T, TInput, TOutput> task)
T MetaTrain(TaskBatch<T, TInput, TOutput> taskBatch)