SkyworkR1V2<T>

Models & Types · AiDotNet.VisionLanguage.Reasoning

Skywork R1V2: hybrid RL (MPO + GRPO) for multimodal reasoning SOTA.

Inheritance: NeuralNetworkBase<T> → VisionLanguageModelBase<T> → SkyworkR1V2<T>

Implements: IReasoningVLM<T>

For Beginners

Skywork R1V2 is an advanced vision-language model using hybrid reinforcement learning for state-of-the-art multimodal reasoning. Default values follow the original paper settings.

How It Works

Skywork R1V2 (2025) achieves state-of-the-art multimodal reasoning through hybrid reinforcement learning combining MPO (Multi-head Policy Optimization) and GRPO (Group Relative Policy Optimization) objectives. This hybrid RL approach improves both the quality of reasoning chains and the accuracy of final answers on complex visual tasks.

References:

  • Paper: “Skywork R1V2: Multimodal Hybrid Reinforcement Learning” (2025)

Example

// Create a Skywork R1V2 model for state-of-the-art multimodal reasoning
// with hybrid RL training combining MPO and GRPO objectives
var architecture = new NeuralNetworkArchitecture<double>(
    inputType: InputType.TwoDimensional,
    taskType: NeuralNetworkTaskType.ImageClassification,
    inputHeight: 224, inputWidth: 224, inputDepth: 3, outputSize: 512);
            
// ONNX inference mode with pre-trained model
var model = new SkyworkR1V2<double>(architecture, "skyworkr1v2.onnx");
            
// Training mode with native layers
var trainModel = new SkyworkR1V2<double>(architecture, new SkyworkR1V2Options());

Constructors

Constructor Summary
SkyworkR1V2(NeuralNetworkArchitecture<T> architecture, SkyworkR1V2Options options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer)
SkyworkR1V2(NeuralNetworkArchitecture<T> architecture, string modelPath, SkyworkR1V2Options options)

Properties

Property Summary
int DecoderEmbeddingDim { get; }
int EmbeddingDimension { get; }
int MaxGenerationLength { get; }
string LanguageModelName { get; }
string ReasoningApproach { get; }

Methods

Method Summary
ModelMetadata<T> GetModelMetadata()
Tensor<T> Chat(Tensor<T> image, IEnumerable<ValueTuple<string, string>> conversationHistory, string userMessage)
Tensor<T> EncodeImage(Tensor<T> image)
Tensor<T> GenerateFromImage(Tensor<T> image, string prompt) Generates text from image using Skywork R1V2’s hybrid RL-aligned pipeline.
Tensor<T> ReasonWithChainOfThought(Tensor<T> image, string question) Generates reasoning using Skywork R1V2’s hybrid RL chain-of-thought.