InContextRLAlgorithm<T, TInput, TOutput>

Models & Types · AiDotNet.MetaLearning.Algorithms

Implementation of In-Context RL: meta-RL via in-context learning without explicit gradient updates at test time.

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

Implements: IGeneratedParameterRegistrar<T>

How It Works

In-Context RL trains a model to adapt through its forward pass by conditioning on a growing context buffer. The context buffer stores compressed representations of past (input, prediction, loss) triplets. A context aggregator (learned attention-like mechanism) combines the buffer entries into a context vector that modulates the model’s parameters. At test time, no gradients are needed — the model improves purely by observing more support examples in its context.

Algorithm:

Constructors

Constructor Summary
InContextRLAlgorithm(InContextRLOptions<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)