[Paper Review] An Empirical Study on Hyperparameters and their Interdependence for RL Generalization
This paper investigates the interdependence of hyperparameters in deep reinforcement learning (RL) and their impact on generalization, using gradient cosine similarity (GCS) as a key metric to analyze training-test gradient alignment. It finds that hyperparameters like discount factor (γ), stochasticity, and regularization are not independent; their interactions significantly affect generalization, with non-monotonic GCS patterns often predicting test performance instability and poor outcomes.
Recent results in Reinforcement Learning (RL) have shown that agents with limited training environments are susceptible to a large amount of overfitting across many domains. A key challenge for RL generalization is to quantitatively explain the effects of changing parameters on testing performance. Such parameters include architecture, regularization, and RL-dependent variables such as discount factor and action stochasticity. We provide empirical results that show complex and interdependent relationships between hyperparameters and generalization. We further show that several empirical metrics such as gradient cosine similarity and trajectory-dependent metrics serve to provide intuition towards these results.
Motivation & Objective
- To understand how hyperparameters in deep RL affect generalization performance beyond isolated tuning.
- To investigate whether hyperparameters such as γ, stochasticity, and regularization are orthogonal or interdependent in their effects on generalization.
- To evaluate the utility of trajectory-dependent metrics like gradient cosine similarity (GCS) in predicting generalization failure.
- To assess the robustness of GCS as a proxy for loss landscape smoothness and training stability in RL.
- To explore how data augmentation and reward function complexity influence the reliability of GCS as a generalization predictor.
Proposed method
- Formalizes RL generalization as a supervised learning analogy, with training and test MDPs sampled from a distribution over parameters θ.
- Uses gradient cosine similarity (GCS) between training and test policy gradients as a primary metric to assess alignment and landscape smoothness.
- Employs PPO and policy gradient algorithms with consistent hyperparameters to minimize bias in GCS estimation.
- Measures gradient norm, variance, and ℓ₂ weight norm to analyze optimization dynamics and stability.
- Applies data augmentation via random shape addition to observations and analyzes its effect on gradient alignment.
- Varying γ and stochasticity across environments like CoinRun and RandomMazes to study their joint effects on test performance and GCS.
Experimental results
Research questions
- RQ1How do hyperparameters such as γ, action stochasticity, and regularization interact in their influence on RL generalization?
- RQ2To what extent is gradient cosine similarity (GCS) a reliable predictor of test performance instability in RL?
- RQ3Does increasing reward function complexity diminish the correlation between GCS and test performance?
- RQ4How does stochasticity affect the allowable range of γ for achieving high test performance?
- RQ5Can trajectory-dependent metrics like GCS detect early signs of overfitting or sharp minima in RL training?
Key findings
- Many hyperparameters are not orthogonal to each other; the effect of one hyperparameter on generalization can reverse or alter the monotonicity of another.
- Non-monotonically decreasing GCS patterns are strongly correlated with unstable test performance and performance drops, often preceding sudden failures.
- Stochasticity reduces gradient norm significantly even before convergence, indicating a more stable optimization path.
- Higher γ values that lead to worse test performance suggest overfitting to the training distribution, as the agent converges on suboptimal policies.
- In complex environments like mazes, stochasticity extends the range of γ values that yield high test performance, indicating improved exploration and robustness.
- When reward functions become more complex (e.g., multi-layer CNNs), GCS shows monotonic decrease but loses correlation with test performance, indicating GCS is not always reliable under high complexity.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.