Introduction
In deep reinforcement learning (DRL), observations such as a bot's position, velocity, and sensor data are typically treated as "free" and instantly available. However, in real-time systems like AAA video games or autonomous driving, computing these features incurs a significant computational cost. For instance, a game bot utilizing hundreds of "raycasts" to detect obstacles 60 times per second can consume substantial GPU/CPU resources needed for rendering and game logic.
Ubisoft researchers have introduced the Budgeted Decision Transformer (BDT) to address this challenge. BDT is an offline reinforcement learning framework that treats data features as costly resources, enabling Active Feature Acquisition (AFA). This allows an agent to dynamically decide which features are necessary at any given timestep to maintain high performance while adhering to strict computational budgets.
The Budgeted Decision Transformer Architecture
BDT builds upon the Decision Transformer (DT), which frames reinforcement learning as a sequence modeling problem. The core innovation of BDT is its dual-policy architecture that shares a single causal transformer backbone.
As shown in the architecture diagram, the model processes sequences of returns-to-go ($rtg_t$), queries ($q_t$), and actions ($a_t$). It consists of two sub-policies:
- Acquisition Policy ($\hat{\pi}$): Outputs a binary mask (a query) to determine which features to compute.
- Action Policy ($\tilde{\pi}$): Utilizes the acquired features to decide on the agent's next action.
To handle the discrete nature of feature selection, BDT employs Differentiable Masking via a Straight-Through Estimator (STE), allowing the model to learn feature importance through gradient descent. Additionally, the model is fed both the masked features and the mask itself, a process known as Feature Disambiguation, which helps the transformer distinguish between a feature that is naturally zero and one that was omitted to save costs.
Training and Optimization
Instead of optimizing for a fixed reward, BDT uses a constrained optimization approach. A Penalty Function is utilized during training to increase the cost weight ($\gamma$) whenever the agent exceeds a user-defined inference time budget (e.g., 1 ms).
A key advantage of the transformer backbone is its temporal memory. BDT can remember features acquired in previous timesteps, allowing it to "flicker" its sensors—sampling expensive features only when necessary and relying on internal memory for intermediate frames. This temporal context also enables the model to effectively "denoise" information when choosing between expensive clean features and cheap noisy ones.
Experimental Results
The researchers evaluated BDT on standard D4RL locomotion benchmarks and a custom 3D navigation environment built in the Godot Engine. In the D4RL tasks, costs were artificially assigned to observation dimensions, while the Godot environment used realistic costs for raycasts of varying lengths.
As illustrated in the performance-to-cost analysis, BDT consistently outperforms other offline RL methods like IQL or RCBC when budgets are restricted. On the D4RL Hopper task, BDT achieved near-maximum performance using only 60% of the available features. In the complex 3D navigation environment, BDT maintained expert-level performance while utilizing only 20% of the total raycast budget. These results demonstrate that the transformer's ability to model sequences provides a significant advantage for budgeted sensing over memory-less baselines.
Conclusion and Future Work
BDT represents a significant step toward creating computationally efficient game bots. By automating the trade-off between decision quality and sensor cost, it reduces the need for manual balancing by developers.
Future research may address current limitations, such as the training bottleneck caused by the sequential dependency between queries and actions, which prevents simultaneous loss computation across all timesteps. Additionally, exploring more efficient architectures like Transformer-XL could further reduce the total computational footprint of the bot itself, beyond just the cost of its sensors.
Summary updated