[论文解读] Query as Anchor: Scenario-Adaptive User Representation via Large Language Model
本文提出 Query-as-Anchor (Q-Anchor),一种动态、面向场景的用户表示框架,使用分层多模态编码器和双塔 LLM 来通过软提示微调和 KV-cache 加速推理将用户嵌入适配到特定场景。它在支付宝基准测试上实现了最先进的结果,并通过在线 A/B 测试验证了部署。
Industrial-scale user representation learning requires balancing robust universality with acute task-sensitivity. However, existing paradigms primarily yield static, task-agnostic embeddings that struggle to reconcile the divergent requirements of downstream scenarios within unified vector spaces. Furthermore, heterogeneous multi-source data introduces inherent noise and modality conflicts, degrading representation. We propose Query-as-Anchor, a framework shifting user modeling from static encoding to dynamic, query-aware synthesis. To empower Large Language Models (LLMs) with deep user understanding, we first construct UserU, an industrial-scale pre-training dataset that aligns multi-modal behavioral sequences with user understanding semantics, and our Q-Anchor Embedding architecture integrates hierarchical coarse-to-fine encoders into dual-tower LLMs via joint contrastive-autoregressive optimization for query-aware user representation. To bridge the gap between general pre-training and specialized business logic, we further introduce Cluster-based Soft Prompt Tuning to enforce discriminative latent structures, effectively aligning model attention with scenario-specific modalities. For deployment, anchoring queries at sequence termini enables KV-cache-accelerated inference with negligible incremental latency. Evaluations on 10 Alipay industrial benchmarks show consistent SOTA performance, strong scalability, and efficient deployment. Large-scale online A/B testing in Alipay's production system across two real-world scenarios further validates its practical effectiveness. Our code is prepared for public release and will be available at: https://github.com/JhCircle/Q-Anchor.
研究动机与目标
- 解决工业场景中静态、与任务无关的用户嵌入与多样化下游场景之间的不匹配。
- 开发可扩展的预训练数据集 (UserU),将多模态行为与用户理解语义联系起来。
- 创建一个基于查询的嵌入机制,在不同下游任务下重新锚定行为配置。
- 通过 KV-cache 加速部署实现高效的多场景推理。
- 通过软提示微调和判别性结构将通用预训练与业务特定逻辑相衔接。
提出的方法
- 构建 UserU 预训练数据,结合未来行为预测和 UserQA 监督。
- 设计分层自粗到自细的编码器,从多模态信号中产生多粒度的用户表示。
- 实现 Query-as-Anchor,双塔结构:锚点塔生成面向查询的嵌入,语义塔建模目标答案。
- 使用联合对比学习–生成目标优化,包括基于 InfoNCE 的对齐和 Next-Token Prediction 损失。
- 应用基于簇的软提示微调,使用原型来强化场景自适应的判别潜在结构。
- 通过预先计算并缓存分层用户前缀,实现 KV-cache 加速推理,以高效再锚定到多个查询。

实验结果
研究问题
- RQ1单一模型能否产生按自然语言查询条件进行场景自适应的用户嵌入?
- RQ2基于查询锚定的分层编码是否能提升工业用户表示的跨域泛化能力?
- RQ3软提示微调能否在不进行完整微调的情况下,使通用预训练与下游业务逻辑对齐?
- RQ4KV-cache 启用的推理在生产环境中实现实时多场景嵌入生成是否可行?
- RQ5离线与在线评估在参与度、风险和营销任务上能揭示哪些增益?
主要发现
- Q-Anchor 通过提示微调在 10 个支付宝场景中相较基线实现了更优的平均 AUC 和 KS,在平均值上达到 0.8225 AUC 和 0.5267 KS。
- 经提示微调的 Q-Anchor 持续优于基础版本和通用嵌入,特别在营销中的 Brand 与风险中的 Money 表现显著提升。
- 数据规模对嵌入质量的影响大于模型大小,最佳结果出现在 0.5B 的骨干网络和 50k 的预训练步骤。
- 软提示导致场景特定的注意力偏移,使模态再锚定具有可解释性(例如 Takeout Interest 的 Bill 注意力上升,Ant Forest 的 SPM 注意力上升)。
- KV-cache 加速推理使在工业部署中对多个下游查询进行再锚定的延迟几乎可忽略不计。

更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。