arXiv:2610.33909cs.CVOct 2026

Manuscript Offprint

arXiv:2610.33909

Rank-1 Weight-Corrected Trainable Weight Averaging for Out-of-Distribution Detection

Akito Shinohara, Hiroaki Aizawa

Akito Shinohara and Hiroaki Aizawa

Graduate School of Advanced Science and Engineering,

Hiroshima University, Japan

{m252486,hiroaki-aizawa}@hiroshima-u.ac.jp

Abstract. Out-of-distribution (OOD) detection identifies inputs outside the training distribution. Rank-based analyses such as RankFeat and RankWeight suggest that OOD overconfidence is closely related to dominant low-rank components in feature and weight spaces. Since weight averaging operates directly in parameter space and improves model generalization, we consider it for OOD detection from a dominant-component perspective. Trainable Weight Averaging (TWA) assigns a single coefficient to each checkpoint, limiting independent control of dominant weight components. We extend TWA with leading rank-one weight components extracted by Singular Value Decomposition as correction directions, whose contributions are learned through the in-distribution classification objective. On ResNet50, our method improves over fine-tuning and standard TWA across the evaluated datasets with MSP and RankWeight, both with and without Outlier Exposure. Mahalanobis-based evaluation yields mixed results, indicating that the benefit depends on the OOD scoring protocol. Target-layer analyses with MSP and Energy favor correction near the classifier.

Keywords: Out-of-Distribution Detection · Trainable Weight Averaging · Subspace Optimization

1 Introduction

Reliable prediction requires models to maintain discriminative performance on known classes while identifying unknown data at test time. In real-world environments, deep neural networks often encounter inputs that are not represented in the training distribution. Such inputs can induce overconfident predictions even when they do not belong to any known class, which is problematic in safety-critical applications. Out-of-distribution (OOD) detection [19][19] addresses this problem by determining whether an input lies outside the training distribution.

A broad range of OOD detection methods has been developed using model outputs or intermediate representations. Post-hoc scoring methods, such as Maximum Softmax Probability (MSP) [6] and Energy Score [13], use confidence or

A. Shinohara and H. Aizawa

logit-derived scores to separate in-distribution (ID) and OOD samples. Feature-space methods, such as Mahalanobis Distance [11] and ReAct [17], exploit statistical properties of learned representations. In addition to these post-hoc scoring and feature-level perspectives, recent rank-based analyses such as RankFeat and RankWeight [16] suggest that dominant low-rank components in feature and weight spaces are closely related to OOD behavior and model performance. These findings indicate that OOD overconfidence is not only a property of output scores, but is also linked to the geometry of representations and model parameters.

This parameter-space perspective naturally connects to weight averaging methods. Weight averaging has been widely studied as a way to improve generalization by operating directly on model parameters, including Stochastic Weight Averaging (SWA) [9], Model Soup [18], SWAD [1], and Trainable Weight Averaging (TWA) [12]. Among these methods, TWA learns averaging coefficients in a subspace spanned by candidate weights, providing a natural parameter-space mechanism for optimizing combinations of checkpoints. However, standard TWA assigns a single coefficient to each checkpoint. As a result, dominant low-rank weight components and the remaining checkpoint parameters are controlled together, making it difficult to adjust components that may contribute to OOD overconfidence without also changing components useful for ID classification.

Motivated by this limitation, we propose a dominant-component-aware extension of TWA. For each checkpoint, we apply Singular Value Decomposition (SVD) to selected weight matrices, extract the leading rank-one component, and introduce the resulting correction direction into the TWA subspace. The correction magnitude is learned with the ID classification objective, enabling adaptive control of dominant weight components without hard removal, architectural modification, or inference-time overhead. Since the proposed method operates in weight space, it can also be combined with data-driven OOD regularization such as Outlier Exposure (OE) [7]. We evaluate the proposed method on OOD detection tasks and compare it with conventional fine-tuning and standard TWA. We further analyze checkpoint ranges, target layers for the correction, compatibility with OE, and backbone architectures to clarify when dominant-component control is effective.

The main contributions of this work are summarized as follows:

– We propose a dominant-component-aware extension of TWA that augments the trainable weight subspace with correction directions derived from leading rank-one weight components.

– We enable independent control of dominant weight components and residual checkpoint components while retaining the standard inference cost and network architecture.

– We demonstrate improvements over fine-tuning and standard TWA with MSP and RankWeight on ResNet50, both with and without OE, while identifying mixed results with Mahalanobis scoring. Target-layer analyses with MSP and Energy show the strongest performance when correction is applied to the final classification layer.