← Latest papers
💬 NLP

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

This paper investigates how different attention masking strategies affect the quality of user embeddings in decoder-only LLMs and proposes "Gradient-Guided Soft Masking" to facilitate a stable transition from causal to bidirectional attention during user representation learning.

Original authors: Jiahao Yuan, Yike Xu, Jinyong Wen, Baokun Wang, Yang Chen, Xiaotong Lin, Wuliang Huang, Ziyi Gao, Xing Fu, Yu Cheng, Weiqiang Wang

Published 2026-02-12
📖 3 min read☕ Coffee break read

Original authors: Jiahao Yuan, Yike Xu, Jinyong Wen, Baokun Wang, Yang Chen, Xiaotong Lin, Wuliang Huang, Ziyi Gao, Xing Fu, Yu Cheng, Weiqiang Wang

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to understand a person’s personality just by watching them walk through a giant shopping mall.

If you only look at them through a rear-view mirror (seeing only what they’ve already done), you might miss the "why" behind their actions. If you try to look at their entire life story all at once (seeing the past, present, and future simultaneously), your brain might get overwhelmed and confused by too much information at once.

This paper, written by researchers at Ant Group, solves this exact problem for Artificial Intelligence.

The Problem: The "One-Way Street" Dilemma

Most modern AI models (like the ones behind ChatGPT) are "Decoder-only" models. They are designed to be storytellers. Because they predict the next word in a sentence, they are trained to look only at the past. They read from left to right, like a person reading a book. This is called Causal Attention.

However, to truly understand a user (like a shopper on Alipay), you don't just need a storyteller; you need a detective. A detective needs to look at a person's behavior holistically—seeing how a purchase made on Monday connects to a search made on Friday—to understand their true intent.

The researchers found a conflict:

  1. The Storyteller (Causal): Great at predicting the next step, but "blind" to the future context.
  2. The Detective (Bidirectional): Great at seeing the whole picture, but hard to train because it breaks the way the AI was originally "born" (pre-trained).

The Solution: The "Gradual Spotlight" (GG-SM)

The researchers created a new method called Gradient-Guided Soft Masking (GG-SM).

Think of it like training a student to become a detective. You wouldn't throw a beginner into a complex crime scene and say, "Look at everything at once!" They would freeze up. Instead, you use a Gradual Spotlight:

  • Phase 1 (The Storyteller): At first, you let the AI look only at the past, just like it was trained to do.
  • Phase 2 (The Smart Spotlight): Instead of suddenly opening its eyes to everything, the AI uses "gradients" (which you can think of as internal intuition) to decide which future clues are actually important. It’s like a detective saying, "I'm not looking at everything yet, but I'm going to peek at that suspicious briefcase over there."
  • Phase 3 (The Full Detective): Slowly, the spotlight widens until the AI can see the entire scene at once, having already learned which parts of the scene matter most.

Why does this matter?

By using this "smart transition" instead of just flipping a switch, the AI becomes much better at "User Representation"—which is just a fancy way of saying "understanding what a person actually wants."

The Results:
When they tested this on real-world data from Alipay (looking at things like what movies people like, how they spend money, and how they use apps), their "Detective AI" beat out much larger, more expensive models.

In short: They proved that it’s not just about how big the AI is, but about how you teach it to look at the world. By teaching it to transition smoothly from a storyteller to a detective, they created an AI that understands human behavior with much more depth and stability.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →