Manuscript Offprint

arXiv:2610.19743

Discriminative Score Function: Turning Pretrained Models into Functional Generative Priors

Junhoo Lee, Hyeonjin Kim, Sangbum Han, Nojun Kwak

Abstract

Discriminative models are trained with task-specific objectives such as classification, detection, or representation learning, yet their practical utility depends on generalizing beyond the training task to unseen samples from the same domain. This suggests that a discriminative model may retain an implicit trace of the data manifold beyond its task labels. We ask whether this trace can be exposed as a generative signal without task-specific guidance. We introduce the Discriminative Score Function (DSF), which extracts an image-space generative field from the loss-gradient geometry of a pretrained discriminative model. DSF provides a training-free update rule that moves images toward model-consistent visual regions without retraining or task-specific targets. We apply DSF to diverse pretrained discriminative models, including ResNet classifiers, DETR detectors, and DINOv2 ViT encoders. DSF generates unconditional images from noise and supports conditional guidance, editing, inpainting, and explanation through the same field. DSF-generated samples also provide effective zero-shot quantization calibration when real images or labels are unavailable, preserving feature geometry better than data-free calibration baselines. These results show that discriminative training leaves a generative functional signal for synthesis and calibration. Project page: https://junhoo.me/dsf.

1 Introduction

“What I cannot create, I do not understand.”

— Richard P. Feynman [14]

Discriminative models are trained through task objectives such as classification, detection, or representation learning, but their usefulness depends on something broader: they must generalize to unseen samples from the same visual domain. This generalization suggests that a discriminative model captures data-manifold structure beyond the specific task used to train it. Such structure is closely related to the goal of generative modeling, which is to move toward or sample from the data manifold itself. If this view is correct, the model should be able to induce unconditional generation without a task prior or a specified generation objective. We ask whether this implicit manifold structure can be exposed and reused as a standalone generative objective in a general way.

Existing discriminative-to-generative methods typically rely on external or task-specific handles, including class labels, activation objectives, reconstruction losses, architecture-specific statistics such as BatchNorm priors, or auxiliary generative models [17, 31, 51]. These handles already specify what should be produced, reconstructed, or activated. As a result, the generated images do not by themselves show that the discriminative model exposes the data manifold; they also do not provide a general solution for arbitrary discriminative models. This limitation is especially visible beyond

∗^{*}Now at KAIST.

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

classification, where detectors and self-supervised encoders may not provide class probabilities or labels at all. A suitable answer therefore needs a label-free interface that avoids task objectives and external generators while applying across diverse pretrained discriminative models.

We answer this question by introducing the Discriminative Score Function (DSF), a functional generative field extracted from a pretrained discriminative model. DSF converts the model's loss-gradient geometry into an image-space update direction. Unlike prior work, DSF evaluates whether a candidate image lies on the model-implied manifold by measuring its alignment in functional space. This alignment moves the image toward visual structure that is consistent with the pretrained model itself. In this operational sense, DSF turns a discriminative model into a generative model and provides a solution for discriminative models operating in continuous, high-dimensional image space.

The key challenge is that the manifold structure captured by a discriminative model is implicit. We therefore reinterpret score-based generation as motion toward a data manifold, and replace the inaccessible image-space manifold distance with a functional distance induced by the Loss Tangent Kernel (LTK) [5], a loss-aware variant of NTK [24]. This yields a computable field in which candidate images are updated according to their alignment with the pretrained model's loss-gradient geometry. As a result, DSF provides a functional score induced by a discriminative model. With a label-free augmentation-invariance surrogate in LTK functional space, the same formulation applies to classifiers, detectors, and self-supervised models under one rule across architectures.

We show that DSF is a general solution for reusing pretrained discriminative models as generative models, and that this solution is practically useful. DSF generalizes across both architecture and objective, spanning convolutional classifiers such as ResNet [19], detection transformers such as DETR [3], self-supervised ViT encoders such as DINOv2 [11, 41], and contrastive vision-language models such as CLIP. In all cases, DSF generates model-consistent images and support conditional generation, editing, inpainting, and explanation through a unified interface. Finally, we show that DSF is not only a generative interface but also a practical tool for model compression. In zero-shot quantization, DSF-generated images provide effective calibration data without access to real data or labels, outperforming existing data-free alternatives and demonstrating the broader utility of the model-induced generative geometry.

References (49)