arXiv:2610.30705cs.CLOct 2026

Manuscript Offprint

arXiv:2610.30705

ULME: Predictive Coupling for Mutually Reinforcing Embedding and Language Modeling

Yang Liu, Zhiqiang Yuan, Shu-Dong Huang, Jiancheng Lv, Liwei Yang, Qiwei Yan, Kailin Lv, Jinchao Zhang

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

Abstract

Text embedding and text generation are two of the most useful capabilities of modern large language models, yet they are typically provided by separate specialized models—an embedder and a generator—trained with incompatible objectives and deployed side by side in retrieval-augmented generation and agent systems. Recent unified embedding-generation models such as GritLM share parameters between the two capabilities, but they either switch attention regimes between modes or optimize embedding and language modeling as parallel objectives that never supervise each other. We argue that these designs are only partially unified: the two capabilities coexist on the same weights, but do not shape each other. We propose ULME, a post-training framework that unifies embedding and language modeling on a causal decoder-only LLM through predictive coupling. ULME inserts a chain of learnable slots between the query and the answer, reads a semantic embedding and a reasoning embedding from two designated slots, and trains three objectives on a shared causal backbone: a contrastive loss anchoring the semantic slot to document representations, a language-modeling loss supervising answer generation, and a stop-gradient predictive loss that aligns the reasoning slot with a pooled summary of the answer, so that generation actively shapes what the embedding encodes. Across two model families (Qwen2.5, Qwen3) and eight scales spanning 0.5B–8B parameters, a single ULME checkpoint improves MTEB by 3.3–4.1 points over the strongest open-source baseline, tightens BRIGHT and AdvBench-IR simultaneously, and remains on par with a generation-only fine-tune on standard accuracy benchmarks (MMLU, GSM8K, MMLU-Pro, HumanEval)—demonstrating that genuine unification yields mutually reinforcing rather than merely coexisting capabilities.

Introduction

Modern LLM systems routinely process the same query twice. In retrieval-augmented generation (Lewis et al. 2020; Yan et al. 2026), in-context example selection (Liu et al. 2022), and agent memory (Xu et al. 2026b; Lyu et al. 2026), an embedder first maps the query into a vector to retrieve context, and a generator then processes the query again to produce an answer. The two components are typically trained separately, and their representations of the same query never interact. This treats the semantic understanding needed to retrieve as if it were independent of the semantic understanding needed to generate—yet a generative LLM, on the way to producing a coherent answer, already encodes the query in a form that is largely what a good embedding should be.

More precisely, generating an appropriate answer requires the model to encode, in its causal hidden states, an answer-relevant reading of the query. This reading is not yet an embedding: it is distributed across positions, has no fixed-dimensional readout, and is not organized into a metric space in which similarity reflects relevance. Recent LLM-based embedders (Zhang et al. 2025b; Lee et al. 2025) confirm the underlying assumption: competitive dense representations can be extracted directly from a decoder-only LLM's causal hidden states, without a separate encoder or bidirectional attention.

Exposing these states as embeddings is not as simple as applying both losses to the same token, however. Retrieval and language modeling inhabit the same hidden space but impose different geometries on it: retrieval asks where an input should lie relative to others, requiring a sequence-level state that is globally comparable under inner product; language modeling asks which token should come next, requiring position-dependent states supporting the LM head. Without a dedicated readout, the natural embedding candidate is the final hidden state of the query—yet that state is also used to predict the first answer token. Overloading it creates a representational collision: one surface-token state is simultaneously asked to be a globally comparable embedding and a local next-token predictor. A unified model should separate the two readouts, but couple the semantics they share.

Recent unified models—GritLM (Muennighoff et al. 2025), GEM (Zhang et al. 2025a)—achieve parameter-level unification but leave two gaps. First, the two capabilities may form their representations under different computations: GritLM, for example, switches to bidirectional attention for embedding, so its embedding readout and its generative hidden states do not belong to the same causal trajectory. Second, the two objectives are optimized in parallel: generation does not depend on the learned embedding, and embedding receives no direct signal from the answer-side representations produced by generation. Parameter sharing alone does not establish an interface between them.

We close both gaps by treating the causal hidden-state tra-

† Equal contribution. § Tech Lead. * Corresponding authors. ‡ This work was done during Yang Liu's internship at WeChat AI, Tencent Inc. under the guidance of Zhiqiang Yuan.

jectory as the shared latent, and by introducing a mechanism we call predictive coupling: the answer-side hidden states from the same forward pass—a future-informed view of the query—serve as a learning target for a designated query-side latent, aligned by an InfoNCE loss with a stop-gradient on the answer side. The stop-gradient makes the coupling well-posed: the query-side latent reaches toward the more-informed answer-side representation, while gradient never flows back into the answer side that language modeling separately supervises. This is a one-sided distillation from the answer-side representation into a query-only latent that is available at inference time. Realizing it on the causal trajectory requires dedicated latent positions—slots that summarize the query without being tied to any surface word—so both the retrieval readout and the predictive target can be trained without competing with next-token prediction.

Building on these ideas, we propose ULME (Unifying Language Modeling and Embedding), a post-training framework in which a decoder-only LLM, under causal attention throughout, produces embedding and answer from a single forward pass over q∥⟨EMB⟩1:N∥aq \parallel \langle \text{EMB} \rangle_{1:N} \parallel a. The NN learnable slot tokens realize the shared latent: slot 0 is the semantic embedding, aligned to document representations by Lsem\mathcal{L}_{\text{sem}}; the answer span is supervised by Lgen\mathcal{L}_{\text{gen}}, whose gradient reaches the slots via the answer's attention over them; slot N−1N-1 is the reasoning embedding, aligned by a stop-gradient predictive loss Lpred\mathcal{L}_{\text{pred}} to a pooled summary of the answer-side hidden states. All three losses share every parameter and every hidden state; embedding is no longer trained in isolation, but shaped by the representation the model would use to answer the query.

Our contributions are:

• We reframe unified embedding and generation as reconciling two geometries within one causal hidden space—a globally comparable sequence-level state for retrieval, and position-dependent states for next-token prediction—motivating separate readouts with coupled semantics.

• We propose ULME with predictive coupling: under stop-gradient, an answer-side latent from the same forward pass supervises a query-side latent, so generation shapes embedding without being disturbed by it. A learnable slot chain between query and answer hosts the semantic readout at one end and the predictive target at the other.

• Across two model families (Qwen2.5, Qwen3) and eight scales (0.5B–8B), a single ULME checkpoint is simultaneously competitive on embedding (MTEB, BRIGHT) and generation (MMLU, GSM8K, MMLU-Pro, HumanEval), improving over the strongest same-backbone baseline on MTEB by 3.3–4.1 points.

References (49)