Skip to main content
QUICK REVIEW

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

Jiahao Yuan, Yike Xu|arXiv (Cornell University)|Feb 11, 2026
Domain Adaptation and Few-Shot LearningComputer Science0 citations
TL;DR

This paper studies how different attention masking strategies (causal, hybrid, bidirectional) affect user representations learned by decoder-only LLMs within a unified contrastive framework, and introduces Gradient-Guided Soft Masking to optimize the transition from causal to bidirectional attention.

ABSTRACT

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.

Motivation & Objective

  • Investigate how causal, hybrid, and bidirectional attention masking impacts decoder-only LLMs when learning user representations from real-world data.
  • Assess training stability and embedding quality across masking strategies within a unified contrastive learning framework.
  • Propose Gradient-Guided Soft Masking (GG-SM) to stabilize the causal-to-bidirectional transition and enhance bidirectional representations.
  • Demonstrate GG-SM’s effectiveness on 9 industrial user cognition benchmarks using Alipay data.

Proposed method

  • Unified contrastive learning framework for decoder-only LLMs with three masking regimes: causal, hybrid, and bidirectional.
  • Gradient-Guided Soft Masking (GG-SM): a gradient-based pre-warmup that informs future-attention weights during the warmup phase before a linear bidirectional scheduler.
  • Two-source training data for embeddings: (i) Rule-based Behavioral Trajectories linking historical sequences to future behavior, (ii) LLM-synthesized QA alignments with hard-positive mining and calibration.
  • Modality-specific encoders convert heterogeneous user signals into an LLM embedding space with lightweight adapters; the same decoder-only LLM processes user views and answers for dual-tower contrastive learning.
  • InfoNCE-based contrastive objective with in-batch negatives and a masking-based similarity mechanism to reduce false negatives.
Figure 1 : Architechure Overview of Our Find-Embedding (w / GGSM).
Figure 1 : Architechure Overview of Our Find-Embedding (w / GGSM).

Experimental results

Research questions

  • RQ1How do causal, hybrid, and bidirectional attention masks affect the quality of user embeddings learned by decoder-only LLMs?
  • RQ2Does transitioning from causal to bidirectional attention impact training stability and representation quality in a unified training setup?
  • RQ3Can a gradient-guided soft-masking warmup improve the optimization dynamics and final bidirectional representations compared to scheduler-only transitions?
  • RQ4How do GG-SM-enhanced embeddings perform across diverse, real-world user cognition tasks in industry (9 benchmarks) relative to other baselines?

Key findings

  • Bidirectional masking yields the highest representational quality among masking regimes in the unified framework.
  • The transition path from causal to bidirectional masking critically affects optimization stability and embedding quality.
  • GG-SM consistently improves training stability and final bidirectional embeddings compared to causal, hybrid, and scheduler-only baselines.
  • GG-SM achieves higher average AUC than several general-purpose embeddings and outperforms other user-embedding baselines on 9 tasks.
Figure 2 : Average AUC performance across 9 downstream tasks under different attention masking strategies (left) and comparison with general embedding, user embedding (right).
Figure 2 : Average AUC performance across 9 downstream tasks under different attention masking strategies (left) and comparison with general embedding, user embedding (right).

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.