NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Learning to Scale Logits for Temperature-Conditional GFlowNets

Minsu Kim, Joohwan Ko, Taeyoung Yun, Dinghuai Zhang, Ling Pan, Woo Chang Kim, Jinkyoo Park, Emmanuel Bengio, Yoshua Bengio

Generative Flow Networks (GFlowNets) are powerful probabilistic models designed to sequentially generate compositional structures, such as molecular graphs or DNA sequences, through a stochastic policy. They are particularly useful for scientific discovery because they sample objects proportionally to a given reward function. However, training them to dynamically balance broad exploration and strict exploitation using a "temperature" parameter is notoriously unstable.

This paper introduces Logit-scaling GFlowNets (Logit-GFN), a simple but highly effective architectural tweak that directly scales the policy's logits based on temperature. This approach drastically stabilizes training and improves the model's ability to discover diverse, high-reward candidates.

The Challenge of Temperature Conditioning

In many real-world scenarios, researchers need to control the "temperature" of the generative sampling process. A high temperature encourages broad exploration of the search space, while a low temperature (often denoted by a high inverse temperature, $\beta$) forces the model to exploit known high-reward areas.

Illustration of GFlowNets and the effect of temperature conditioning on generative distributions.

Training a single "temperature-conditional" GFlowNet that can adjust to any $\beta$ on the fly is highly desirable but numerically challenging. The standard approach—known as Layer-GFN—simply concatenates the temperature value into the neural network's hidden layers. This forces the network to implicitly learn how to adjust its confidence and output distribution. Because different temperatures demand vastly different logit magnitudes and create conflicting gradient profiles, this implicit learning leads to severe training instability, especially at extreme temperatures.

Proposed Method: Logit-GFN

To solve this numerical bottleneck, the authors propose Logit-GFN. Instead of merely passing the temperature as a feature to the hidden layers, Logit-GFN introduces a small, auxiliary neural network called the logit scaling net.

Comparison of Vanilla Layer-GFN and the proposed Logit-GFN architectures.

This auxiliary network takes the inverse temperature ($\beta$) as input and outputs a scalar value. This scalar is then used to directly divide (scale) the logits of the main policy network right before the softmax layer is applied.

This provides a strong, mathematically sound inductive bias: it explicitly controls the sharpness of the model's decisions without requiring the main policy network to drastically alter its internal weights for different temperatures. Direct scaling perfectly mirrors the mathematical definition of temperature in a softmax function, removing a massive burden from the learning process.

Furthermore, the authors introduce an online discovery algorithm that pairs Logit-GFN with dynamic temperature sampling (similar to simulated annealing). During exploration, the algorithm queries the model at various temperatures to populate a replay buffer, which is then used to train the network off-policy.

Experimental Evaluation

The paper evaluates the proposed method primarily on four biochemical sequence and molecule design tasks:

  • QM9: Generating small molecule graphs to maximize the HOMO-LUMO gap (an electronic property).
  • sEH: Generating molecule graphs to maximize binding affinity to the sEH protein.
  • TFBind8: Generating 8-nucleotide DNA strings to maximize binding affinity to the SIX6 human transcription factor.
  • RNA-Binding: Generating 14-nucleobase RNA strings to maximize binding affinity to the L14-RNA1 target factor.

(Note: The authors also successfully tested the method on Gridworld and Combinatorial Optimization tasks like Maximum Independent Set).

Key Results and Insights

  • Training Stability: Logit-GFN maintained smooth, stable loss curves even when evaluated at extremely high inverse temperatures (e.g., $\beta = 5000$). In contrast, standard unconditional GFlowNets and Layer-GFNs experienced severe instability and erratic loss spikes under the same conditions.
  • Offline Generalization to Unseen Extremes: Training unconditional GFlowNets on highly selective, high-$\beta$ targets is notoriously difficult because the reward landscape becomes too "peaky." Logit-GFN can be trained on a dataset of sub-optimal samples using lower, smoother $\beta$ values (e.g., 10-50) where exploration is easier. It can then successfully extrapolate to high $\beta$ values ($\beta = 5000$) during inference to generate out-of-distribution, high-reward samples, outperforming models trained specifically on fixed high $\beta$ values.
  • Superior Mode Discovery: In online mode-seeking tasks, pairing Logit-GFN with dynamic temperature sampling significantly boosts discovery. By gradually shifting the exploration temperature from broad exploration to strict exploitation, Logit-GFN consistently discovered more unique, high-reward modes across all four biochemical tasks compared to baselines. For example, in the QM9 task, Logit-GFN found over 300 distinct high-reward modes, outperforming Layer-GFN, standard GFlowNets, and RL baselines like PPO and Soft Q-Learning.

Limitations and Future Work

While Logit-GFN demonstrates strong stability and generalization in the tested biochemical and combinatorial tasks, the authors acknowledge that its effectiveness in very high-dimensional or highly complex generative tasks has not yet been fully explored. Future work will need to validate this architecture across a broader range of application domains to confirm its universal robustness.

Summary updated

BibTeX
@inproceedings{kim2024learning,
  author = {Minsu Kim and Joohwan Ko and Taeyoung Yun and Dinghuai Zhang and Ling Pan and Woo Chang Kim and Jinkyoo Park and Emmanuel Bengio and Yoshua Bengio},
  title = {{Learning to Scale Logits for Temperature-Conditional GFlowNets}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=GUEsK9xJny},
}
Figure