Teaching Metric Distance to Discrete Autoregressive Language Models
Jiwan Chung, Saejin Kim, Yongrae Jo, Jaewoo Park, Dongjun Min, Youngjae Yu
TL;DR
This work addresses the limitation of traditional autoregressive models that treat tokens as purely discrete one-hot targets, ignoring underlying metric relationships when outputs are numeric, spatial, or embedded. It introduces DIST2Loss, a distance-aware objective that constructs a discretized distance-based target distribution $p_d(v|x,t)$ from a distance function $d$ and optimizes it via KL divergence, effectively implementing a closed-form analogue to entropy-regularized policy optimization. The approach unifies cross-entropy with a distance-based regularizer, supporting high-dimensional distances and vector-quantized representations, and is demonstrated across toy regression, visual grounding, robotic manipulation, reward modeling, and image generation, with clear gains in low-data regimes. Practically, DIST2Loss is plug-and-play, data-efficient, and compatible with existing backbones and architectures, enabling more faithful generation of metric-aware outputs without additional data or RL instability.
Abstract
As large language models expand beyond natural language to domains such as mathematics, multimodal understanding, and embodied agents, tokens increasingly reflect metric relationships rather than purely linguistic meaning. We introduce DIST2Loss, a distance-aware framework designed to train autoregressive discrete models by leveraging predefined distance relationships among output tokens. At its core, DIST2Loss transforms continuous exponential family distributions derived from inherent distance metrics into discrete, categorical optimization targets compatible with the models' architectures. This approach enables the models to learn and preserve meaningful distance relationships during token generation while maintaining compatibility with existing architectures. Empirical evaluations show consistent performance gains in diverse multimodal applications, including visual grounding, robotic manipulation, generative reward modeling, and image generation using vector-quantized features. These improvements are most notable in low-data regimes, demonstrating DIST2Loss's strength under resource constraints.
