AegisVR: Leveraging Reinforcement Learning and LLMs for Personalized Cybersickness Mitigation and Reasoning in VR
AegisVR a reinforcement learning (RL)–based adaptive cybersickness mitigation framework to predict, explain, and mitigate cybersickness. It integrates a Transformer-based cybersickness severity predictor as RL reward shaping, a PPO-based reinforcement learning (RL) agent, and an LLM-powered dialogue engine that interprets user feedback and provides natural language explanations.
Goal: Trigger appropriate mitigation such as Dynamic Field of View (DFOV) and Dynamic Gaussian Blur (DGB) with proper intensity based on both user state and model predictions, maintaining immersion while reducing discomfort.
Core Idea:
AegisVR continuously observes real-time user signals (e.g., eye-tracking, head motion, and scene context) and applies an RL policy trained to optimize cybersickness mitigation while integrating LLM-based reasoning for interactive and human-in-the-loop adaptation.
| Component | Version | Notes |
|---|---|---|
| Unity | 6 LTS or newer | Supports URP & ML-Agents |
| Unity ML-Agents Toolkit | 4.0.0 | For PPO training and model export (ML-Agents Guide) |
| Python | 3.9 – 3.11 | Backend for training |
| VR SDK | Oculus / OpenXR | Required for XR runtime |
| Tobii XR SDK | 4.x | For eye and head tracking data |
| OpenAI API (GPT) | gpt-4o-mini | Dialogue reasoning & explanation generation |
AdaptVR/
│
├── Assets/
│ ├── Scenes/
│ │ └── AdaptVR.unity
│ ├── Scripts/
│ │ ├── RL_Agent/
│ │ │ ├── AdaptVRAgent.cs
│ │ │ ├── AdaptVRControl.cs
│ │ │ ├── AdaptVRLiveSensorsXR.cs
│ │ │ ├── MitigationManager.cs
│ │ └── UserStudy/
│ │ ├── SpeechRecogniser.cs
│ │ ├── VoiceIntentClassifier.cs
│ │ ├── UserRequest.cs
│ │ ├── HilCsvLogger.cs
│ │ ├── ParticipantSessionCounter.cs
│ │ └── ParticipantIdSettings.cs
│ └── Models/
│ └── AdaptVR.onnx
│
├── Training/
│ └── config_adaptvr.yaml
│
├── Image/
│
└── README.md
behaviors:
AdaptVR:
trainer_type: ppo
hyperparameters:
batch_size: 1024
buffer_size: 10240
learning_rate: 3.0e-4
beta: 5.0e-3
epsilon: 0.2
lambd: 0.95
num_epoch: 3
network_settings:
normalize: true
hidden_units: 256
num_layers: 2
reward_signals:
extrinsic:
strength: 1.0
gamma: 0.99
max_steps: 2.0e6
time_horizon: 128
summary_freq: 20000This configuration trains the RL agent using PPO to minimize cybersickness (ΔFMS) and action instability while encouraging comfort-preserving transitions.
AegisVR training follows the standard Unity ML-Agents workflow.
Refer to:
👉 Unity ML-Agents Toolkit – Training Environments
Example training command:
mlagents-learn Training/config_adaptvr.yaml --run-id=AdaptVR_train --env=Builds/AdaptVR.exe --forceOnce training completes, the exported .onxx model (e.g., AdaptVR.onxx) can be loaded in Unity for runtime inference.
During runtime, AegisVR operates in inference-only mode using the pretrained RL model.
AegisVR scene hierarchy showing integrated components.
| GameObject | Description |
|---|---|
| DL_Detection_Model | Transformer model for cybersickness severity prediction (ONNX). |
| XR Origin (XR Rig) | Player rig for VR locomotion and tracking. |
| ├── RL_Agent | RL inference component using the trained PPO model (AdaptVR.ONNX). |
| ├── UserStudy (HIL) | Collects user comfort data, triggers LLM reasoning, and logs preferences. |
| ├── XR Interaction Manager / EventSystem | Handles XR controller and event input. |
| LLM | GPT reasoning node providing explanations and recommendations. |
| TobbiEyeTracking | (Optional) Eye-tracking module for gaze vector input. |
| DFOV / DGB | Adaptive mitigation techniques managed via RL policy. |
| MitigationManager | Central execution hub for applying DFOV/DGB actions. |
| Data | Session parameters, and configuration. |
The LLM module integrates GPT-4o-mini for:
- Parsing voice feedback (via
SpeechRecogniserandVoiceIntentClassifier). - Explaining selected mitigation actions.
- Logging reasoning outputs in CSV for personalization.
Configuration:
- Set your OpenAI API key in Unity’s environment configuration.
ChatGPT Client configuration showing API URL, Key, Organization, and Model settings.
Setup Instructions
- Fill the following fields:
- API URL:
https://api.openai.com/v1/chat/completions - API Key: Your OpenAI API key
- API Organization: (Optional) your organization ID
- API Model:
gpt-4o-mini
- API URL:
- Toggle Debug to log reasoning outputs in the Unity Console.
The reasoning process runs asynchronously to maintain frame-time efficiency.
User (voice input)
↓
Speech Recogniser → Voice Intent Classifier → GPT Reasoning Engine
↓
RL Agent (AdaptVRAgent) → MitigationManager (DFOV / DGB)
↓
HilCsvLogger (records feedback, policy, reasoning)
All logs include user ID, session ID, timestamp, predicted severity, and chosen mitigation level.
- Unity ML-Agents Toolkit (v4.0.0)
- Unity ML-Agents: Training Environments
- OpenAI GPT-4o API
- Tobii XR SDK


