Skip to content

nothingbutbut/era

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Entropy Regularizing Activation: Boosting Continuous Control, Large Language Models, and Image Classification with Activation as Entropy Constraints

Paper Github Website Twitter

🎉News

  • [2025/10/09] Released our Paper on arXiv. See here. We propose ERA, a new paradigm that constrains the sampling entropy above given thresholds by applying specially designed activations to the outputs of models.

📖Introduction

main results

We propose ERA, a new paradigm that constrains the sampling entropy above given thresholds by applying specially designed activations to the outputs of models. Our approach demonstrates broad effectiveness across different domains: 1) for large language models (LLMs), boosting the AIME 2025 score for Qwen2.5-Math-7B by 37.4%; 2) for continuous control reinforcement learning agents, improving performance by more than 30% over strong baselines such as SAC on the challenging HumanoidBench; 3) for image classification, enhancing ImageNet top-1 accuracy by 0.69% for ResNet-50. These gains are achieved with a computational overhead of less than 7%. Our work validates output activation as a powerful tool for entropy control, opening a new direction for designing simpler and more robust algorithms.

🚀 Large Language Models

Entropy and pass@k results for GRPO with ERA

Entropy comparison and pass@k results for GRPO with ERA (ours) versus GRPO. The entropy curves demonstrate that ERA mitigates entropy collapse and establishes a clear lower bound. The pass@k results further indicate that ERA enhances exploration and strengthens the model’s reasoning ability.

For large language models, we apply an activation layer to the logits $z$ to obtain a transformed set $z'$. This layer adaptively modulates the logit values based on the response entropy $H_{\text{resp}}$ and token advantage $A_t$:

$$ z' = \begin{cases} k z & H_{\text{resp}} < \omega_{\text{low}},; A_{t}>0 \\ z & \omega_{\text{low}} \leq H_{\text{resp}} \leq \omega_{\text{high}} \\ \tfrac{1}{k} z & H_{\text{resp}} > \omega_{\text{high}},; A_{t}>0 \end{cases} $$

To ensure the stability of the policy update, we apply an inverse scaling factor to the advantages of the modified tokens:

$$ A'_t = \begin{cases} \frac 1k A_t &amp; H_{\text{resp}} &lt; \omega_{\text{low}},; A_{t}&gt;0 \\ A_t &amp; \omega_{\text{low}} \leq H_{\text{resp}} \leq \omega_{\text{high}} \\ k A_t &amp; H_{\text{resp}} &gt; \omega_{\text{high}},; A_{t}&gt;0 \end{cases} $$

This allows ERA to be integrated seamlessly into on-policy algorithms, resulting in the following GRPO objective:

$$ J(\theta) = \mathbb{E}_t \left[\mathbb{E}_{a_t\sim \pi_\theta(\cdot \mid s_t)} \log \pi_\theta'(a_t\mid s_t), A'_t \right] $$


🦾 Continuous Control

ERA Performance in Continuous Control Benchmarks

Main Results of ERA in Continuous Control. Aggregate normalized performance on HumanoidBench (6 tasks, with SAC), DMC (Humanoid & Dog) (6 tasks, with TD-MPC2), HumanoidBench (8 tasks, with FastSAC) and Mujoco Gym (4 tasks, with PPO). ERA consistently accelerates learning and achieves superior asymptotic performance.

In continuous control, we enforce a minimum entropy on the final policy by constraining the underlying Gaussian's entropy to a higher value. This is achieved by adjusting the Gaussian's standard deviation, $\sigma$. Our activation function $g(\cdot)$ computes the final parameters $(\mu', \sigma')$ as:

$$ \mu' = \mu,\quad \sigma' = \exp\left[\max \left(\log \sigma_{\max} + \frac{\left(\mathcal{H}_0' - D\log \sqrt{2\pi e} - D \log \sigma_{\max}\right) e^{\hat{\sigma}_i}}{\sum_{j=1}^{D} e^{\hat{\sigma}_j}}, \log \sigma_{\min}\right)\right] $$

Here, $\mathcal{H}_0'$ is the target entropy plus a compensation parameter $\delta \ge 0$ to account for the bounding bias. This parameter can be a constant or automatically tuned by minimizing the following loss:

$$ L(\hat{\delta}) = \mathbb{E}_{s \sim \mathcal{D}} \left[\hat{\delta}\left(\mathcal{H}[\pi(\cdot\mid s)] - \mathcal{H}_0\right)\right] $$

Policy Visualization

Dog Run
Dog Run
Dog Walk
Dog Walk
Humanoid Run
Humanoid Run
Humanoid Walk
Humanoid Walk
H1 Run
H1 Run
H1 Walk
H1 Walk
H1 Slide
H1 Slide
H1 Stand
H1 Stand

🖼️ Image Classification

In discrete classification, regularizing predictive entropy is crucial for preventing overconfidence. For a softmax policy, we transform the pre-activation logits $z$ into $z'$ to ensure the policy's entropy is at least a target value $\mathcal{H}_0$:

$$ z' = h^{-1}\left[\max \left(\frac{\log \tau}{\tau} + \left(C_{\mathcal{H}_0} - n \frac{\log \tau}{\tau}\right)\frac{1}{D-1}\left(1 - \frac{e^{z_i}}{\sum_{j=1}^{D} e^{z_j}}\right),, 0\right)\right] $$

Unlike label smoothing which applies uniform regularization, ERA allows the model to learn a structured, input-dependent uncertainty distribution, tailoring the regularization to each sample for greater expressive capacity and improved performance.

Performance on ImageNet and CIFAR-10

Performance Table: ImageNet and CIFAR-10

Top-1 and Top-5 accuracy (%) on ImageNet and CIFAR-10. We compare ERA against the original ResNet-50 baseline. Δ denotes the absolute improvement of ERA. All models are trained for 200 epochs.

Comparison with Other Regularization Methods

To investigate the effectiveness of ERA against common regularization methods, we conducted comparative experiments on CIFAR-10 against various intensities of Label Smoothing and Dropout. The results below show that increasing label smoothing intensity can harm performance, and dropout offers marginal gains. In contrast, ERA consistently and effectively enhances model performance, validating its advantage over conventional regularization methods.

Comparison of different regularization methods on the CIFAR-10 dataset

🎈Citation

If you find this work useful in your research, please consider citing:

@misc{kang2025entropyregularizingactivationboosting,
      title={Entropy Regularizing Activation: Boosting Continuous Control, Large Language Models, and Image Classification with Activation as Entropy Constraints}, 
      author={Zilin Kang and Chonghua Liao and Tingqiang Xu and Huazhe Xu},
      year={2025},
      eprint={2510.08549},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2510.08549}, 
}

🌻 Acknowledgement

Our code is built upon the following open-source projects. We sincerely thank the authors for their contributions to the community.

We also thank the following people for their valuable discussions and suggestions:

📬 Contact

For questions, discussion, or collaboration opportunities, feel free to contact:

About

An official code repo of paper Entropy Regularizing Activation: Boosting Continuous Control, Large Language Models, and Image Classification with Activation as Entropy Constraints.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors