用生成式推理替代传统对比学习,让大模型自动生成可解释的语义理由。
GRACE: Generative Representation Learning via Contrastive Policy Optimization
- 将对比信号视为奖励,引导大模型生成自然语言推理过程
- MTEB基准上监督与无监督设置分别提升11.5%和6.9%的综合性能
- 生成的推理过程可解释,适合需要透明决策的场景
现有训练大语言模型作为文本编码器的方法多依赖对比损失,将模型视为黑箱函数,忽略其生成与推理能力。我们提出GRACE(基于对比策略优化的生成式表征学习),将对比信号重新定义为奖励,驱动大模型生成显式的、人类可理解的推理过程——即结构化的自然语言解释,以表达其语义理解。这些推理被均值池化后生成高质量嵌入。通过策略梯度优化,模型在多组件奖励函数下训练,最大化查询正例间的相似性,最小化负例间的相似性。这使大模型从不透明编码器转变为可解释的智能体,其推理过程透明可查。在MTEB基准上,四种基线模型平均表现:监督设置较基础模型提升11.5%,无监督变体提升6.9%,同时保持通用能力。本工作将对比目标转化为对推理过程的奖励,融合表征学习与生成,实现更强嵌入与可解释推理。代码与数据见https://github.com/GasolSun36/GRACE。
原文摘要 · Abstract (English)
Prevailing methods for training Large Language Models (LLMs) as text encoders rely on contrastive losses that treat the model as a black box function, discarding its generative and reasoning capabilities in favor of static embeddings. We introduce GRACE (Generative Representation Learning via Contrastive Policy Optimization), a novel framework that reimagines contrastive signals not as losses to be minimized, but as rewards that guide a generative policy. In GRACE, the LLM acts as a policy that produces explicit, human-interpretable rationales--structured natural language explanations of its semantic understanding. These rationales are then encoded into high-quality embeddings via mean pooling. Using policy gradient optimization, we train the model with a multi-component reward function that maximizes similarity between query positive pairs and minimizes similarity with negatives. This transforms the LLM from an opaque encoder into an interpretable agent whose reasoning process is transparent and inspectable. On MTEB benchmark, GRACE yields broad cross category gains: averaged over four backbones, the supervised setting improves overall score by 11.5% over base models, and the unsupervised variant adds 6.9%, while preserving general capabilities. This work treats contrastive objectives as rewards over rationales, unifying representation learning with generation to produce stronger embeddings and transparent rationales. The model, data and code are available at https://github.com/GasolSun36/GRACE.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。