TL;DR
Decoding-based regression allows Large Language Models (LLMs) to solve continuous numerical prediction tasks by treating numbers as text sequences, but standard token-by-token training ignores numerical magnitude. This paper introduces GenRe² (Generative Reinforced Regressor), a framework that applies reinforcement learning with sequence-level rewards (like negative MSE) to align LLM generation with actual numerical precision. GenRe² consistently outperforms traditional regression heads and token-level baselines across tabular and code metric tasks.
What Problem Does This Paper Address?
Traditional deep learning regressors rely on specialized heads—like pointwise heads (predicting a single scalar) or Riemann heads (predicting a histogram distribution)—to map latent representations to continuous targets. Recently, decoding-based regression has emerged as a flexible alternative. By converting continuous numbers into discrete text tokens (e.g., representing 1.23 as <+><1><2><3><E-2>), researchers can leverage the powerful sequential modeling capabilities of autoregressive LLMs to perform regression on unstructured data like text or code.
However, these models are typically trained using standard Cross-Entropy (CE) loss, which introduces a fundamental misalignment. CE treats tokens as independent categories; it doesn't know that predicting a 9 instead of an 8 is a minor error, while predicting a 1 instead of an 8 is massive. Even worse, token-level losses fail to capture cumulative errors across a sequence: a mistake in the first digit (the most significant bit) is catastrophic compared to a mistake in the last digit.
Methods
The authors propose GenRe² to bridge the gap between discrete token generation and continuous numerical reality. They reformulate decoding-based regression as a Markov Decision Process (MDP) and optimize the decoder using policy gradient methods with full-sequence rewards.
Instead of calculating loss token-by-token during generation, GenRe² allows the model to generate the complete token sequence, detokenizes it back into a continuous numerical prediction ($\hat{y}$), and evaluates it against the ground truth ($y$) using a sequence-level metric like negative Mean Squared Error (MSE).
To avoid the high computational overhead of training a separate critic network, the framework utilizes two lightweight, REINFORCE-style algorithms:
- ReMax: Uses a fast, greedy decoding path as a baseline to reduce variance.
- GRPO: Compares a group of sampled trajectories against their mutual mean to determine the advantage.
Datasets
The authors validated GenRe² across two distinct domains:
- Tabular Regression: Evaluated on the TALENT benchmark, a comprehensive suite containing 100 diverse tabular regression datasets.
- Code Metric Regression: Evaluated using the Regression Language Model (RLM) setup on two datasets:
- APPS Leetcode: Predicting peak memory usage and computational latency for Python code.
- Triton Kernel Latency: Estimating execution latency of PyTorch programs on low-level Triton GPU kernels.
Key Insights and Ideas
- Numerical Awareness via Sparse Rewards: Because the reward is only given at the end of the sequence, the model is forced to learn the holistic magnitude and proximity of numbers, naturally prioritizing accuracy on the most significant digits.
- The RL "Squeeze": The authors show that RL drastically reduces the entropy of the model's output distribution (by over 50%). It sharpens the distribution around high-reward, accurate predictions.
- High Sampling Efficiency: While RL restricts the model's broad exploration space (slightly lowering the theoretical maximum accuracy if you sample thousands of times, i.e., $best@k$), it dramatically boosts the accuracy of a single trial ($best@1$). This makes it highly practical for real-world deployment where generating massive sample batches is too expensive.
- The Danger of Reward Standardization: Interestingly, GRPO's reward standardization mechanism caused performance to degrade as the digit base increased. The authors hypothesize that dividing by the standard deviation introduces gradient estimation biases that disrupt calibrated numerical scaling.
Key Results
- Tabular Superiority: On the TALENT benchmark, GenRe²-ReMax consistently achieved the highest $R^2$ scores and lowest RMSE, outperforming pointwise heads, Riemann heads, and recent token-level distance penalties (like NTL and DIST²).
- Mitigating Catastrophic Forgetting: In code metric regression, standard supervised fine-tuning (SFT) often degrades the model's general regression capabilities. GenRe²-ReMax successfully bypassed this issue, showing steady performance gains over the base model.
- Distribution Alignment: GenRe² significantly minimized the Wasserstein-1 distance to the target values, proving that its generated outputs match the true target distribution far more closely than baseline methods.
Limitations and Future Work
- Over-Sharpening and Calibration: Because GenRe² squashes the output entropy to achieve high precision, the model can become overconfident, which harms its ability to provide well-calibrated uncertainty estimations.
- Hallucinations in Unbounded Spaces: When paired with scientific notation tokenizers (which allow an infinite range of numbers), the model can still occasionally hallucinate extreme outlier values.
- Encoder Constraints: The tabular experiments relied on a simple Multi-Layer Perceptron (MLP) encoder. Combining GenRe² with modern tabular foundation models or tree-based architectures remains an open challenge.
Summary updated