arXiv:2602.10622cs.CL2026-02被引 3

改进解码器模型的注意力掩码,提升用户行为建模效果

How Do Decoder-Only LLMs Perceive Users? Rethinking Attention Masking for User Representation Learning

  • 提出梯度引导软掩码,平滑从单向到双向注意力的过渡
  • 在9个工业级任务中实现更稳定训练和更高精度的用户表征
  • 兼容预训练解码器,适合需要长序列用户行为建模的场景

解码器仅大型语言模型越来越多地被用作用户表征学习的行为编码器,但注意力掩码对用户嵌入质量的影响尚未得到充分研究。本文在基于大规模真实世界支付宝数据的统一对比学习框架下,系统评估了因果、混合与双向注意力掩码的效果。为改善从因果到双向注意力转换时的训练动态,提出梯度引导软掩码(Gradient-Guided Soft Masking),通过梯度驱动的预热阶段,在线性调度器前逐步开启未来注意力。在涵盖预测、偏好与营销敏感性的9个工业级用户认知基准上,该方法相较于因果、混合及仅调度基线,展现出更稳定的训练过程和更高质量的双向表征,同时保持与解码器预训练的兼容性。结果表明,掩码设计与训练过渡策略在适配解码器模型进行有效用户表征学习中至关重要。

原文摘要 · Abstract (English)

Decoder-only large language models are increasingly used as behavioral encoders for user representation learning, yet the impact of attention masking on the quality of user embeddings remains underexplored. In this work, we conduct a systematic study of causal, hybrid, and bidirectional attention masks within a unified contrastive learning framework trained on large-scale real-world Alipay data that integrates long-horizon heterogeneous user behaviors. To improve training dynamics when transitioning from causal to bidirectional attention, we propose Gradient-Guided Soft Masking, a gradient-based pre-warmup applied before a linear scheduler that gradually opens future attention during optimization. Evaluated on 9 industrial user cognition benchmarks covering prediction, preference, and marketing sensitivity tasks, our approach consistently yields more stable training and higher-quality bidirectional representations compared with causal, hybrid, and scheduler-only baselines, while remaining compatible with decoder pretraining. Overall, our findings highlight the importance of masking design and training transition in adapting decoder-only LLMs for effective user representation learning. Our code is available at https://github.com/JhCircle/Deepfind-GGSM.

用户表征注意力掩码解码器模型行为建模

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。