arXiv:2610.05350cs.LGOct 2026

Manuscript Offprint

arXiv:2610.05350

Task Inference Beyond Least Squares in Behavioral Foundation Models

Kuan-Hsun Tu, Chien-Sheng Chiang, Hsin-Wei Chen, Ping-Chun Hsieh, Tsung-Wei Ke

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Behavioral Foundation Models (BFMs) aim to solve a wide range of downstream tasks without test-time policy learning by inferring a task vector from the reward function. While efficient, the retrieved policies are often suboptimal because of how this task vector is inferred, typically with ordinary least squares (OLS). OLS minimizes reward reconstruction error but leaves the ordering of rewards unconstrained, which can bias the successor measure of the retrieved zero-shot policy away from that of the optimal policy. In this work, we propose BLS, an efficient test-time inference method that balances minimizing reward reconstruction error with reducing successor-measure mismatch. Theoretically, we provide a suboptimality gap upper bound characterized by both successor-measure and reward-function residuals. Empirically, we evaluate BLS on top of state-of-the-art BFMs across benchmarks for locomotion, manipulation, and humanoid control. BLS outperforms existing task inference baselines with negligible computational overhead. Project page: https://embodiedai-ntu.github.io/BLS

Figure

Figure 1: Ordinary least squares (OLS) aims to minimize the total errors of reconstructed rewards. Its performance highly depends on the quality of state representations, the state coverage within the dataset, and the distribution of rewards. Because OLS can be biased toward the majority of states, low-reward states (N) may be assigned with high-value rewards and vice versa for high-reward states (G). The successor measure of the retrieved zero-shot policy can therefore diverge from that of the optimal policy. BLS instead adopts an objective that reduces the reward reconstruction errors while enlarging the margin between high- and low-reward states. Thus, the successor measure of the retrieved zero-shot policy is encouraged to stay closer to the optimal policy's.

1 INTRODUCTION

Unsupervised zero-shot reinforcement learning (zero-shot RL; Touati et al., 2023) aims to offer a more general behavior learning framework than typical task-specific RL. During training, it does not require downstream task-specific reward functions, instead learning a repertoire of policies directly from interactions within the environment. At test time, given a downstream reward function, it can immediately retrieve a corresponding policy without additional policy learning or planning. Models

∗^{*}Equal contribution. †\daggerCorresponding author.

trained via zero-shot RL can jointly handle downstream tasks in diverse forms, such as tracking reference trajectories, reaching goals, optimizing rewards, or following semantic instructions (Tirinzoni et al., 2025; Sikchi et al., 2024). Therefore, these models are often termed Behavioral Foundation Models (BFMs; Pirotta et al., 2024).

To empower zero-shot capabilities, BFMs rely on a linear formulation that connects arbitrary tasks with their reward functions. A BFM represents every state and all possible tasks as vectors in a joint latent space, where their inner products define linear reward functions (Barreto et al., 2017). It then trains policies conditioned on each task vector using the associated reward. Given any reward function at test time, the BFM directly obtains the corresponding policy by inferring the task vector through linear regression, with ordinary least squares (OLS) being the most commonly used solver in prior work (Bagatella et al., 2026a).

Although OLS minimizes reconstruction errors of a reward function among all states, it does not guarantee that the retrieved zero-shot policy is the best-performing one for the reward. The performance of a zero-shot policy heavily depends on the quality of state representations, the coverage of states within the dataset, and the distribution of rewards per task (Sikchi et al., 2025). Figure 1 presents an example: when rewards are dense but the highest-reward states are sparse, OLS is biased toward the majority of states, which are low-reward states in this example. This can leave the reconstruction of high-value rewards inaccurate, causing the retrieved zero-shot policy to become suboptimal. To tackle this, Sikchi et al. (2025) propose a fast adaptation strategy that minimizes the residual errors of OLS reconstruction but needs task-specific online interactions. Asadulaev et al. (2026) instead search for a task vector that maximizes rewards, while constraining the retrieved zero-shot policy to follow trajectories within the dataset, which are not optimal for the downstream task. Current methods remain restricted.

We propose BLS, a simple yet effective offline zero-shot inference framework Beyond Least Squares for BFMs. We first identify two sources of error that cause the suboptimality of zero-shot policies: drift in reward reconstruction and drift in state visitation distributions. While the former is covered by OLS, the latter is broadly overlooked in existing approaches. We then make two key observations of the optimal policy's state visitation distributions: (1) high-reward states are more frequently visited than low-reward states, (2) fixing the relative ranking of rewards also helps to preserve the optimal policy's behavior. To achieve both objectives, we propose a soft-margin contrastive loss that enlarges the margin in reconstructed rewards between high- and low-value original rewards. Finally, BLS jointly optimizes the task vector using the soft-margin loss and a trust-region loss with respect to OLS's solution. With the updated task vector, BLS aims to retrieve a zero-shot policy closer to the optimal policy than the one found by OLS.

We validate BLS with extensive experiments across several established RL benchmarks. On OGBench, BLS improves the average performance of all five feature representations under both proprioceptive and pixel-based observations. On DMC and HumEnv, BLS improves 18 out of 20 and 42 out of 45 dense-reward tasks, respectively. In particular, we find that BLS remains effective across different feature representations, reward structures, and task vector anchors. Furthermore, BLS incurs negligible computational overhead compared to OLS while bringing substantial performance gains. Finally, these results show that BLS is not merely an OLS correction but a general task-vector refinement framework for BFMs.

References (27)