Masked History Learning (MHL)
- Masked History Learning (MHL) is a training framework for generative recommendation that enhances next-item prediction by reconstructing masked historical interactions.
- It employs an entropy-guided masking policy and a three-phase curriculum scheduler to focus on the most informative elements of user behavior.
- Empirical results on Amazon review datasets show MHL outperforms traditional autoregressive models in metrics such as Recall and NDCG.
Masked History Learning (MHL) is a training framework for generative recommendation that augments standard autoregressive next-item prediction with an auxiliary objective for reconstructing masked historical items. It was introduced to address a specific limitation of purely autoregressive training: a next-item objective can emphasize local, short-term signals while underusing the internal structure of a user’s interaction history and the latent intent embedded in that history. In MHL, the model is trained not only on “what item comes next” but also on reconstructing informative missing parts of the past, with two explicit mechanisms—an entropy-guided masking policy and a curriculum learning scheduler—designed to make masking focus on the most informative historical items and to transition training from history reconstruction to direct future prediction (Wei et al., 28 Sep 2025).
1. Problem setting and motivation
MHL arises in the setting of generative recommendation, where models directly generate item identifiers for the next recommendation. In the formulation described for MHL, traditional generative recommender systems, including recent LLM-based recommenders, use autoregressive training and optimize next-item likelihood: Here, the model predicts the next item from the preceding interaction sequence (Wei et al., 28 Sep 2025).
The motivation for MHL is that this objective “focuses solely on predicting the next item while ignoring the rich internal structure of a user's interaction history,” and therefore can fail to grasp the “underlying intent.” The reported pilot findings further state that pure autoregressive models such as RPG are brittle to truncation of user histories, which was taken as evidence that they do not effectively use broader historical signals or infer complex intent. The MHL framework therefore shifts the training emphasis from simple next-step prediction to “deep comprehension of history,” with the explicit goal of learning “why” an item path is formed from past behavior rather than only “what” item follows next (Wei et al., 28 Sep 2025).
A common misunderstanding is to treat MHL as a replacement for the underlying sequence model. The paper instead describes it as a training framework that “augments existing generative models without altering architecture,” with gains attributed to the training regime rather than to a new backbone. This is significant because it locates MHL within the optimization and supervision design of generative recommendation rather than in a distinct architectural family (Wei et al., 28 Sep 2025).
2. Representation, masking granularity, and optimization objective
MHL is formulated over item representations encoded as semantic IDs: The next-item objective is expressed at the codeword level as
while the masked history reconstruction objective is
These are combined into the final training loss
The notation denotes the history after masking, and denotes the set of masked codeword positions (Wei et al., 28 Sep 2025).
The framework supports three masking granularities. In item-level masking, the entire semantic ID of a selected historical item is replaced with special mask tokens: In token-level masking, only selected codewords within the semantic ID are masked: In mixed-level masking, the method randomly chooses between item-level and token-level masking for each selected item (Wei et al., 28 Sep 2025).
These design choices are central to the interpretation of MHL. Item-level masking removes the full identifier and forces reconstruction of the complete item representation. Token-level masking preserves partial item structure while requiring the model to infer missing semantic components. Mixed-level masking exposes the model to both regimes. This suggests that MHL is not merely a binary “mask or do not mask” method; it is a family of supervision patterns over structured historical identifiers.
3. Entropy-guided masking policy
A central claim of MHL is that random masking is inefficient because it can mask “easy-to-predict or trivial parts of the sequence,” rather than those positions that are most useful for understanding intent. To address this, the framework introduces an entropy-guided masking policy that measures the uncertainty of the model’s prediction at each codeword position and preferentially masks positions or items with highest entropy (Wei et al., 28 Sep 2025).
For each codeword 0, entropy is defined as
1
where 2 denotes the decoder’s contextualized representations. For an entire item, the item-level entropy is
3
The top-4 tokens or items with highest entropy are then selected for masking, with 5 determined by a masking ratio 6 (Wei et al., 28 Sep 2025).
The stated effect is that the model is forced to learn from “the most uncertain, informative, and intent-revealing aspects of the user’s history.” In the paper’s framing, high entropy identifies positions that are hard for the current model and therefore most informative for auxiliary reconstruction. This directly contrasts with uniform random masking, which is agnostic to model uncertainty. A common misconception is that the gains of MHL follow simply from adding more masked examples; the reported ablations instead indicate that which history elements are masked matters materially, because entropy-guided masking outperforms random masking (Wei et al., 28 Sep 2025).
4. Curriculum from history reconstruction to future prediction
MHL does not use a static masking regime throughout training. Instead, it introduces a three-stage curriculum learning scheduler intended to control training difficulty and to manage the transition from reconstructing history to predicting the future (Wei et al., 28 Sep 2025).
| Phase | Masking policy | Function |
|---|---|---|
| I | Warm-Up with Random Masking | Learn basic item and item-feature associations and reconstruction tasks |
| II | Entropy-Guided Masking with Adaptive Ratio | Increase difficulty and enforce deep context understanding |
| III | Fine-Tuning on Direct Next-Item Prediction | Remove masking and match the real inference scenario |
In Phase I, training begins with a low-ratio, random masking policy. The description states that this enables the model to learn “basic item/item-feature associations and reconstruction tasks.” In Phase II, the method switches to entropy-guided masking, and the masking ratio 7 is initially set high and then decreases adaptively as validation performance plateaus. This stage is described as enforcing “deep context understanding and robust representation learning.” In Phase III, masking is turned off, so 8, and the model is fine-tuned only for the autoregressive prediction objective, explicitly to “bridge any train-test discrepancy” and to ensure that final performance matches the inference setting (Wei et al., 28 Sep 2025).
The scheduler gives MHL a specific interpretation: masked history reconstruction is not the terminal task, but an auxiliary regime used to shape representations before final specialization to next-item generation. The paper summarizes this progression as a gradual transition in which the model first learns to reconstruct and understand “why this path matters,” and only then focuses on “what comes next” (Wei et al., 28 Sep 2025).
5. Empirical characterization
The reported experiments use three Amazon Reviews categories—Beauty, Toys & Games, and Sports & Outdoors—after preprocessing to ensure user and item coverage. The baselines include both ID-based and semantic ID-based methods, specifically BERT4Rec, SASRec, TIGER, HSTU, and RPG. Evaluation is reported with Recall@5, Recall@10, NDCG@5, and NDCG@10 (Wei et al., 28 Sep 2025).
The central empirical result is that MHL “outperformed all baselines—both classic and generative—on all datasets and metrics.” The summary further states that, on Sports & Outdoors, MHL improved NDCG@5 by 27.1% over TIGER, identified as the best prior semantic ID baseline. On Beauty, the abridged table reports for MHL values of Recall@5 9, NDCG@5 0, Recall@10 1, and NDCG@10 2, compared with TIGER values of Recall@5 3, NDCG@5 4, Recall@10 5, and NDCG@10 6 (Wei et al., 28 Sep 2025).
The ablation results are equally important for defining the method. The paper reports that any variant of masked reconstruction, whether random- or entropy-based, beats pure next-item autoregression; that entropy-based masking is better than random masking; and that the full curriculum—random warm-up, then entropy-guided masking, then direct next-item fine-tuning—yields the best results. The paper also states that MHL works not only for semantic ID sequences but also for raw tokenized text item representations. Robustness analyses over different codebook sizes and mask ratios are reported to show stable gains (Wei et al., 28 Sep 2025).
These findings address several possible misconceptions. MHL is not presented as useful only in sparse or low-data settings, even though the motivation emphasizes inadequate use of long-range signals. It is also not presented as depending on a specific semantic-ID encoding alone, because the reported generalization to raw tokenized text item representations suggests broader applicability. A plausible implication is that MHL is best understood as a supervision strategy for sequential recommenders rather than as a semantic-ID-specific trick.
6. Relation to adjacent masked-learning paradigms
MHL belongs to a broader masked-learning lineage, but its specific target is the comprehension of user interaction histories for next-item prediction. Several adjacent works clarify this position.
In closed-book question answering, “Studying Strategically: Learning to Mask for Closed-book QA” learns a masking policy from downstream supervision, then uses that policy during intermediate pre-training so that the model “focuses” on reconstructing spans likely to be queried later (Ye et al., 2020). The conceptual parallel is that both methods treat masking as a learned or adaptive selection mechanism for task-relevant information rather than as a purely random corruption process.
In long-term microscopic traffic simulation, history-masked multi-agent imitation learning removes all vehicles’ historical trajectory information and perturbs current positions during training to address covariate shift (Guo et al., 2023). That approach masks history by deletion rather than by reconstruction, but it similarly treats historical information as a variable to be controlled in order to improve robustness.
In time series forecasting, “PT-Tuning: Bridging the Gap between Time Series Masked Reconstruction and Forecasting via Prompt Token Tuning” argues that forecasting can be viewed as a special case of masked reconstruction in which future values are masked and reconstructed from history (Liu et al., 2023). This provides a close methodological analogy: MHL in recommendation also uses masked reconstruction to support a future-prediction objective, although its emphasis is on intent modeling within user histories.
Within generative recommendation itself, later masked-diffusion approaches depart more radically from autoregression. “Masked Diffusion for Generative Recommendation” models SID sequences by denoising randomly masked sequences and supports parallel decoding of masked positions (Shah et al., 28 Nov 2025). “Masked Diffusion Generative Recommendation” further introduces adaptive masking supervision along temporal and sample dimensions, including curriculum scheduling and history-aware masking (Mu et al., 27 Jan 2026). These works suggest a continuum: MHL augments autoregressive training with masked history reconstruction, whereas masked diffusion recommendation replaces token-wise left-to-right generation with order-agnostic denoising.
Taken together, these studies suggest that MHL is part of a broader research pattern in which masking is used not merely for regularization, but for selective exposure of structure, uncertainty, and difficulty. In the specific case of MHL, the historical sequence is treated as an object to be partially hidden and reconstructed so that the model learns a representation of user intent that is more comprehensive than pure next-step prediction alone (Wei et al., 28 Sep 2025).