Source-linked AI summary

CRAMER: Control via Request-Aware Masking for Editing Recommenders

Zhiyuan Julian Su, Naihe Feng, Zhen Luther Qin, Ga Wu

arXiv:2608.25370v1cs.IRcs.AIcs.LG

TL;DR

Sequential recommenders have limited flexibility for immediate natural-language requests, while existing adaptations can require retraining or costly request-aware inference. CRAMER converts requests into sparse masks over a frozen backbone, and experiments show consistent gains with minimal overhead. The method also raises deployment concerns about steering conflicts with long-term preferences.

  • Problem

    Sequential recommendation models struggle to adapt to immediate natural-language requests, while existing methods can require backbone retraining or heavyweight inference.

  • Method

    CRAMER treats each request as a control input and uses learned sparse row–column masks to modulate parameters of a frozen Transformer-based sequential recommender.

  • Results

    CRAMER consistently outperforms strong request-aware baselines across multiple metrics and incurs minimal runtime and memory overhead across four datasets and two backbones.

  • Takeaways & Limitations

    CRAMER establishes a controllable, efficient, and scalable approach for integrating immediate user intent into sequential recommendation.

  • Takeaways & Limitations

    The method provides moderate request-conditioned adjustments rather than complete overrides, and deployment should address conflicts between short-term requests and long-term interests.

Abstract

from arXiv · show

Sequential recommendation models, while powerful, have limited flexibility in responding to immediate user requests, making it difficult to adapt their recommendations to the user's timely interests. Unfortunately, existing user request adaptation methods often incur high computational overhead due to either 1) retraining the entire backbone network or 2) leveraging the inference ability of large language models (a.k.a. prompt engineering), limiting their applicability in large-scale recommendation services. This paper presents Control via Request-Aware Masking for Editing Recommenders (CRAMER), a framework that takes users' natural-language requests to immediately change sequential recommendation models' behavior. Specifically, inspired by the model control theory, CRAMER treats user requests as control signals to modulate frozen backbone parameters through masking, achieving instant adaptation to diverse requests while avoiding costly retraining. Experiments on multiple large-scale benchmark datasets show that CRAMER outperforms four state-of-the-art request-aware baselines across multiple recommendation metrics while achieving minimal overhead. Moreover, the proposed framework exhibits enhanced controllability and cross-domain adaptability, establishing a new paradigm for request-aware sequential recommendation.

1. Introduction

Sequential recommenders struggle to incorporate immediate, semantically rich natural-language requests alongside historical preferences. CRAMER addresses this by treating requests as control signals that mask parameters in a frozen backbone.

  • Immediate requests can emphasize or contradict historical preferences, while expressing negations, constraints, and fine-grained attribute preferences.
  • Existing input-level and output-level adaptation methods either provide shallow intent representations or require domain-specific pretraining and heavyweight inference.
  • Current approaches treat the recommender backbone as a static black box and lack posterior control over its internal mechanics.
  • CRAMER converts a natural-language request into masks that modulate parameters of a frozen sequential recommender backbone.

2. Background and Related Work

Transformer-based sequential recommenders model temporal behavior effectively but remain difficult to adapt to immediate natural-language intent. Prior request-aware methods use sequence augmentation, language-to-item representations, or additional adaptation mechanisms with limitations in control, cost, or flexibility.

  • Transformer-based models, including SASRec and BERT4Rec, are predominant approaches for sequential recommendation.
  • Immediate requests can emphasize or negate prior preferences, requiring dynamic adaptation beyond static long-term signals.
  • Request augmentation captures short-term intent but relies on shallow representations, while other request-aware approaches use language-space modeling or additional modules.
  • Retraining or fully fine-tuning Transformer backbones is computationally prohibitive for real-time request adaptation.

3. Methodology

CRAMER formulates request-aware recommendation as lightweight control of a frozen sequential recommender. It encodes requests, generates sparse structured masks, and optimizes predictive accuracy together with sparsity-oriented regularization.

  • 3.1. Task Definition: The task combines a user’s historical interaction sequence with a natural-language request specifying immediate intent to predict the next item.
  • 3.1. Task Definition: Existing strategies manipulate sequences, add request-aware modules, or fine-tune backbone parameters, creating shallow control, added complexity, or prohibitive cost.
  • 3.1. Task Definition: CRAMER maps a request to a control vector and applies operations to backbone parameters to obtain edited parameters.
  • 3.2. Variational Motivation for Model Control: The objective combines predictive loss with a KL regularizer that keeps request-conditioned gates near a sparsity prior.
  • 3.2. Variational Motivation for Model Control: The practical controller uses exact hard k-hot Gumbel–Top-k masks with a straight-through estimator rather than full variational inference.
  • 3.2. Variational Motivation for Model Control: CRAMER adapts a frozen recommender through lightweight binary gates, enabling rapid no-retraining adaptation while preserving fine-grained control.
  • 3.3. Request-to-Mask Adaptation: Mean-pooled contextual token embeddings form a semantic request representation compatible with the frozen sequential backbone.
  • 3.3. Request-to-Mask Adaptation: CRAMER supports masking FFNs, attention output projections, or both as controllable Transformer parameter scopes.

4. Experiments and Evaluation

CRAMER is evaluated across four datasets, two frozen Transformer backbones, multiple request-aware baselines, sensitivity settings, inference costs, and request-controlled recommendation shifts. It consistently improves recommendation quality while maintaining low overhead and semantically aligned behavior.

  • Experimental Setup: Experiments use four benchmark datasets, frozen SASRec and BERT4Rec backbones, four request-aware baselines, and ranking metrics HR@k, NDCG@k, and MRR at k ∈{10, 20}.Evaluation uses 100 randomly sampled non-interacted negatives paired with one ground-truth positive.
  • Overall Performance: CRAMER achieves the best results across all reported metrics, datasets, and experiments under both SASRec and BERT4Rec backbones.Table 1 averages results over five runs; boldface marks the highest result and underlining the second best.
  • Results by Dataset and Backbone: CRAMER shows advantages on large-scale datasets and consistent gains on smaller datasets, with stable improvements across both SASRec and BERT4Rec.The reported pattern is attributed to integrating long-term preferences with immediate request semantics.
  • Sensitivity Analysis of Hyperparameters: A drop ratio ρ around 0.10 generally provides the best balance, while extreme masking ratios degrade performance; optimal ratios vary with dataset scale.Smaller datasets tend to favor larger ρ values, whereas information-dense large datasets tend to favor smaller values.
  • Efficiency and Overhead: CRAMER adds only 0.018s runtime overhead over vanilla SASRec and maintains a small GPU-memory footprint while improving recommendation quality.Its cost is reported as comparable to LLM-ESR, lower than Query-SeqRec and BLaIR, and far below REARANK’s runtime.
  • Mask Interpretability: Across six request types, CRAMER produces semantically aligned recommendation shifts, including directional changes for clear, ambiguous, and rare-term requests.The increase in variance remains within acceptable limits, supporting stable request-conditioned behavior.

5. Conclusion

CRAMER uses natural-language requests to control frozen sequential recommender backbones through lightweight masking. Across four datasets and two backbones, it outperforms strong request-aware baselines with minimal runtime and memory overhead.

  • CRAMER treats natural-language requests as control inputs and projects them into structured row–column masks over frozen Transformer backbones.This provides fine-grained request-conditioned control without retraining.
  • Experiments cover four benchmark datasets and two sequential recommendation backbones.
  • CRAMER consistently outperforms strong request-aware baselines across multiple metrics while incurring minimal runtime and memory overhead.

Impact Statement

The work targets efficient, flexible control of sequential recommenders through natural-language requests, allowing deployed models to adapt to immediate intents without retraining. Increased controllability also raises concerns about inappropriate steering and conflicts with long-term interests.

  • CRAMER enables deployed recommender models to adapt to users’ immediate intents without retraining.
  • Increased controllability may produce unintended or inappropriate steering, including conflicts between short-term requests and long-term interests.
  • The method is designed for moderate request-conditioned adjustments rather than complete overrides of learned preferences.

A. Derivation of the Training Objective

The derivation formulates request-conditioned masking with binary gates and a variationally motivated objective. In practice, hard k-hot masks, a supervised predictive loss, and an analytic KL regularizer provide sparse and tractable optimization.

  • Mask parameterization: The mask vector selects row and column activations for the subset of frozen backbone parameters subject to request-conditioned masking.
  • Variational formulation: The derivation models binary control signals with a request-conditioned variational distribution over mask gates and a factorized Bernoulli prior.The prior matches the hard sparsity budget and supports a closed-form KL term.
  • Regularization: The KL penalty is normalized by d so its scale does not grow with the mask dimension.
  • Discrete optimization: Hard k-hot masks are used in the forward path through Gumbel–Top-k, while STE propagates gradients through a soft surrogate.
  • Training objective: The practical objective replaces negative log-likelihood with supervised next-item loss under the edited backbone and adds KL regularization.
  • Objective interpretation: The objective is variationally inspired rather than a strict ELBO because hard k-hot masking and independent Bernoulli gates are combined.

B.1. Data Preprocessing

The preprocessing pipeline converts four datasets into unified RecBole-style atomic files, chronologically organizes user interactions, and constructs request text from preceding interaction information. Dataset statistics report item counts, interaction counts, and average request length.

  • Data preprocessing: Four datasets are preprocessed in a unified manner to construct RecBole-style atomic files.
  • Data preprocessing: For each user, interactions are sorted chronologically before request text is constructed from prior interaction information.
  • Dataset statistics: Table 4 reports #Items, #Inters, and Average Chars for the processed datasets.#Inters counts interactions containing requests, while Average Chars measures average request length.

B.2. Training of Backbones

The backbone experiments use default RecBole training for SASRec and BERT4Rec, with optimal CRAMER hyperparameters selected per backbone–dataset configuration. The appendix also defines the search spaces for request masking, encoder tuning, regularization, gating, and temperature annealing.

  • Backbone training: SASRec and BERT4Rec parameters are trained using RecBole’s default settings to control experimental variance.Specific settings refer to RecBole v1.2.1.
  • Hyperparameter selection: Optimal hyperparameter configurations are selected separately for each backbone–dataset combination.Selection is based on validation NDCG@10 after searching predefined ranges.
  • Search space: Temperature annealing uses a schedule from 0.7 to 0.3, choosing among linear, exponential, and cosine decays.The schedule applies to Gumbel–Top-k sampling.

B.4. Detailed Experiments

Detailed experiments assess CRAMER’s sensitivity to masking, encoder tuning, regularization, gating, and annealing choices, then examine efficiency and scaling with larger backbones. Results indicate generally robust behavior, with non-shared gates and cosine annealing often preferred.

  • Scopes of θM: CRAMER remains relatively stable across masking scopes FFNs, WO, and FFNs+WO.The scopes correspond to feed-forward networks, attention output projection, or both jointly.
  • Regimes of ϕt: CRAMER is generally robust across frozen, last-layer, and end-to-end request-encoder tuning regimes.Last-layer tuning tends to provide stable gains over a fully frozen encoder, especially on smaller datasets or less informative requests.
  • KL regularization: CRAMER is relatively robust to λKL, with moderate NDCG@10 fluctuations across datasets and backbones.Values around 0.3–0.4 tend to be more effective on smaller datasets such as ReDial.
  • Gate sharing: Non-shared gates consistently and substantially outperform batch-shared gates across datasets and both backbones.The best shared result never exceeds the non-shared results.
  • Temperature annealing: Cosine annealing achieves the best performance in most datasets and backbones, generally outperforming linear decay and often exponential decay.The temperature is annealed from 0.7 to 0.3.
  • Scaling and efficiency: Inference efficiency is compared against vanilla BERT4Rec using average per-request runtime and GPU memory overhead under identical settings.The comparison includes additional overhead introduced by each request-aware method.
  • Scaling and efficiency: CRAMER improves recommendation performance across tested BERT4Rec depths while relative runtime and memory overhead remain controlled and decrease as the backbone grows.The scaling study uses 4-, 6-, 8-, and 10-layer BERT4Rec models on KuaiSAR; row–column gates use α_l + β_l variables instead of α_lβ_l entrywise controls.

B.7. Further Discussion on PLM

Further discussion shows that CRAMER’s performance consistently follows request-encoder capacity, while its control remains reversible and non-destructive. The appendix also clarifies the surrogate role of its variational objective and the baseline-combination procedures.

  • PLM capacity: Across four datasets, CRAMER’s PLM ranking is strictly monotonic: Tiny < Mini < Medium < Base.The same ordering appears under SASRec using NDCG@10, making chance-based instability unlikely according to the paper’s analysis.
  • PLM capacity: Higher PLM capacity supplies richer request representations and correspondingly more accurate, fine-grained control signals.The paper interprets the monotonic pattern as CRAMER reliably leveraging request-encoder semantics.
  • PLM capacity: BERT-base already provides strong performance, while the framework is described as compatible with future lightweight, more capable encoders.The observed sensitivity is attributed primarily to differences in PLM semantic expressiveness.
  • Case study: In a five-user CDs&Vinyl case study, CRAMER achieves the highest ground-truth ranks under both SASRec and BERT4Rec.The comparison reports average ranking of true positive items, where smaller is better.
  • Baseline combinations: Baseline combinations use concatenated request and sequence representations, semantic-collaborative score fusion, or LLM-based reranking and embeddings.The described baselines include Query-SeqRec, BLaIR, LLM-ESR, and REARANK.
  • Objective interpretation: The variational formulation motivates structured sparsity and KL regularization but is not intended as exact variational inference.The optimization objective is a surrogate balancing predictive accuracy and control sparsity.
  • Control mechanism: CRAMER applies request-conditioned multiplicative masks at inference without permanently modifying or pruning frozen backbone parameters.Different requests induce different masks, and the underlying parameters remain intact.
  • Control mechanism: Removing the request immediately restores the original backbone behavior without retraining or parameter updates.This makes the control reversible and non-destructive.
Loading 2608.25370v1…