BAHSD: Bridging the Long-tail Gap via Adaptive Distillation in Black-box Sequential Recommendation
Abstract
Sequential recommendation systems are widely adopted but often deployed as black-box APIs, which has driven recent interest in model extraction to replicate their capabilities locally. However, the long-tail distribution induces severe signal heterogeneity: dense head sequences trigger the solidification of teacher preference, biasing extraction toward local patterns, while sparse tail sequences yield flat, noisy predictions. Existing one-size-fits-all extraction overlooks this disparity, resulting in noise overfitting and suboptimal knowledge transfer. We propose BAHSD, a black-box adaptive distillation framework that handles signal heterogeneity via a multi-scale consistency probing mechanism to implicitly quantify signal reliability. Based on this, an adaptive hierarchical objective is designed: dynamic-temperature KL divergence mitigates preference solidification for high-confidence signals, while ranking consistency and InfoNCE contrastive learning provide noise-robust enhancement for low-confidence signals. BAHSD consistently outperforms baselines, achieving up to 4.98% gain over the teacher and 80%+ improvement on tail users, offering a plug-and-play solution for high-fidelity black-box recommendation extraction.
Keywords:
Sequential Recommendation Black-box Knowledge Distillation Heterogeneous Signals Long-tail Optimization1 Introduction
Sequential recommendation systems (SRS) employ advanced Transformer models, such as SASRec [10] and BERT4Rec [22, 15], to achieve state-of-the-art performance. However, these models are typically served as black-box APIs, which restricts access to internal parameters and gradients. This limitation renders black-box model extraction, the process of transferring knowledge from a remote API to a local model, a critical technique for reducing query costs and enabling downstream customization.
Existing extraction methods, including UnKD [2] and RCE-KD [36], primarily focus on bias mitigation or distribution alignment under an implicit uniformity assumption that teacher signals are consistently reliable across all users. This assumption fundamentally conflicts with the long-tail distribution inherent in user interactions, thereby inducing severe signal heterogeneity. As illustrated in Fig. 1, teacher outputs exhibit two distinct degradation modes. First, preference solidification occurs in head users, where dense interactions yield sharp, low-entropy distributions that propagate biased preferences when mimicked by the student. Second, information vacuum arises in tail users, where sparse interactions produce flat, near-uniform distributions that degrade student performance through noise fitting. These modes are overlooked by one-size-fits-all distillation objectives, resulting in noise overfitting for tail users and underutilization of head signals. Moreover, traditional long-tail debiasing techniques rely on white-box access, such as gradients or embeddings, and are therefore inapplicable under black-box constraints. These observations motivate the development of an adaptive framework that can implicitly assess signal reliability and adjust distillation strategies accordingly.
To address this gap, we propose BAHSD (Black-box Adaptive Heterogeneous Signal Distillation), a framework that operates solely on teacher logits. BAHSD introduces a multi-scale consistency probing mechanism, which quantifies signal reliability by measuring the consistency of teacher outputs across subsequences of varying lengths (short, medium, and full) without requiring metadata or internal features. Based on the perceived reliability, an adaptive hierarchical objective is formulated. For high-confidence signals originating from head users, KL divergence with dynamic temperature scaling softens over-concentrated distributions to alleviate preference solidification. For low-confidence signals from tail users, ranking consistency combined with InfoNCE contrastive learning replaces aggressive distribution matching to enhance discriminative representations and suppress noise. A cross-scale symmetric KL consistency further regularizes the student to ensure robust predictions across different views, enabling end-to-end adaptive distillation without explicit user stratification or access to teacher internals.
Experiments on public benchmarks demonstrate that BAHSD consistently outperforms state-of-the-art baselines, achieving up to a 4.98% improvement over the teacher model and boosting tail-user performance by over 80% while maintaining head-user stability. BAHSD provides a model-agnostic, plug-and-play solution for high-fidelity black-box model extraction. Our contributions are threefolds:
- •
We uncover and formalize signal heterogeneity in black-box sequential recommendation, identifying preference solidification for head users and information vacuum for tail users as two distinct degradation modes.
- •
We propose BAHSD, the first framework designed to adaptively handle this heterogeneity through multi-scale consistency probing and a reliability-aware hierarchical objective.
- •
Extensive experiments validate the effectiveness of BAHSD, demonstrating substantial gains for tail users and, in certain scenarios, performance that surpasses the teacher model under strict black-box constraints.
2 Related Work
2.1 Sequential Recommendation
Sequential recommendation captures users’ dynamic preferences by modeling temporal dependencies in interaction histories [1, 20, 12, 14, 18, 13]. Transformer-based architectures, notably SASRec [10] and BERT4Rec [22], have become the standard due to their ability to encode long-range patterns via self-attention. In practice, these models are often deployed as black-box APIs that expose only predictions while concealing internal parameters and gradients, necessitating distillation techniques that operate under such constraints [5, 21].
2.2 Black-box Knowledge Distillation
Knowledge distillation transfers knowledge from a teacher model to a student model [8]. Traditional distillation methods in recommendation systems follow white-box [35] or gray-box paradigms [4, 9, 11, 17, 35], which rely on intermediate features, attention maps, or gradient information that are inaccessible under black-box API settings. Recent black-box distillation efforts, including DHKD [30], ABKD [24], ICD [16], and RLD [23], primarily address loss conflicts and capacity gaps in general tasks such as image classification but lack recommendation-specific design. These methods treat teacher outputs as static distributions, overlooking both the temporal dynamics inherent in user sequences and the signal heterogeneity induced by long-tail user distributions. Approaches such as RCE-KD [36], Ekd4rec [26], and DLLM2Rec [3] attempt to refine ranking alignment through item partitioning, yet they operate at the output level without addressing the underlying quality disparity in teacher signals across different user groups.
2.3 Long-tail Optimization in Recommendation
Long-tail issues have been extensively studied in recommendation systems [34, 6, 28, 25, 33, 27]. Methods such as HPSERec [29] and UnKD [2] focus on mitigating item-side popularity bias through stratified learning or unbiased distillation. Nevertheless, these methods exhibit two critical limitations: they primarily target item-side rather than user-side disparities, and they implicitly assume uniform teacher signal quality across all users. More fundamentally, their reliance on white-box access or explicit metadata renders them inapplicable under strict black-box constraints where only logits are available.
In contrast to prior work, we identify that the core bottleneck in black-box sequential recommendation lies in user-side signal heterogeneity—specifically, the dual degradation of teacher outputs into preference solidification for head users and information vacuum for tail users. BAHSD represents the first framework designed to address this problem under strict black-box constraints, achieving adaptive knowledge transfer through multi-scale consistency probing without requiring explicit user stratification or internal features.
| Dataset | Tier | BERT4Rec | SASRec | ||
|---|---|---|---|---|---|
| Recall@10 | NDCG@10 | Recall@10 | NDCG@10 | ||
| Amazon Beauty | Head | 0.527 | 0.357 | 0.547 | 0.395 |
| Mid | 0.500 | 0.322 | 0.493 | 0.340 | |
| Tail | 0.478 | 0.308 | 0.474 | 0.322 | |
| MovieLens-1M | Head | 0.689 | 0.478 | 0.713 | 0.487 |
| Mid | 0.745 | 0.549 | 0.791 | 0.562 | |
| Tail | 0.844 | 0.641 | 0.875 | 0.658 | |
3 Motivation Analysis
Existing black-box distillation methods for sequential recommendation assume uniformly reliable teacher signals, contradicting the intrinsic heterogeneity induced by long-tail user interactions. Our empirical analysis on Amazon Beauty [19] and MovieLens-1M [7] using SASRec and BERT4Rec reveals this discrepancy. We stratify users by sequence length into head (top 20%), mid, and tail (bottom 60%) groups, contrasting signal characteristics across tiers.
3.1 Empirical Evidence of Signal Heterogeneity
Prediction performance analysis. Table 1 reports the performance of teachers at the user levels. On the dense MovieLens-1M dataset, we observe a striking performance inversion: tail users outperform head users, e.g., SASRec Recall@10: 0.875 vs. 0.713. This finding validates the phenomenon of preference solidification, in which Transformer-based teachers overfit to long head sequences, thereby compromising generalization. For the sparse Amazon Beauty dataset, head-tier performance exceeds that of the tail as expected, although tail signals remain noisy and exhibit low confidence. Information-theoretic analysis. Kernel Density Estimation (KDE) of the teacher logits shown in Fig. 2 reveals two distinct degradation modes. For tail users, a discriminative vacuum emerges where the probability mass concentrates near zero () with high entropy, indicating that signals are dominated by noise and rendering distribution matching ineffective. For head users, entropy-saturated solidification occurs where probability mass shifts non-linearly to high-confidence intervals (). This low-entropy state reflects overconfidence and overfitting to local patterns.
3.2 Theoretical Objective and Implicit Task Definition
If an oracle could perfectly assess signal reliability , the optimal stratified loss would take the form:
| (1) |
where and denote user stratification thresholds. However, explicit stratification is infeasible under black-box constraints. Therefore, our core motivation is to implicitly approximate this oracle by designing a distillation framework that perceives signal reliability and adaptively adjusts its optimization strategies without requiring metadata or internal access. BAHSD achieves this through multi-scale sequence probing and adaptive loss synergy, directly addressing the identified degradation modes.
4 Methodology: The Framework of BAHSD
BAHSD is a unified distillation framework that operates under strict black-box constraints without explicit user stratification. It integrates three complementary components to jointly address preference solidification in head users and discriminative vacuum in tail users. Through multi-scale sequence probing, the framework implicitly perceives signal reliability and adaptively adjusts its optimization strategy, enhancing discriminative capability for degraded signals while preserving fine-grained knowledge transfer for high-quality signals. This design transforms black-box distillation into an adaptive, pathology-aware knowledge refinement process, as illustrated in Fig. 3.
4.1 Notations
We define the set of users as and items as . For a user , the chronologically ordered interaction sequence is denoted as , where (sequences with are filtered).
- •
Teacher Model (): A black-box API outputting logits . The predictive distribution is , where is the softmax function.
- •
Student Model (): A lightweight homogeneous architecture. It outputs logits and hidden states .
- •
Probing Views: denotes the multi-scale view , e.g., corresponding to truncated prefixes (50%, 75%, 100%) of .
- •
Latent Representation: represents the aggregated global representation of view .
4.2 Multi-scale Semantic Alignment ()
To extract knowledge at different granularities, we define a joint loss for each view :
| (2) |
where denotes the pairwise Bayesian Personalized Ranking (BPR) loss and represents the temperature-scaled Kullback-Leibler divergence:
| (3) |
A large global temperature enables adaptive gradient adjustment that responds to signal heterogeneity. For head users exhibiting preference solidification, smooths extreme probability peaks to expose dark knowledge, allowing to dominate fine-grained knowledge transfer. Conversely, for tail users where distributions collapse, the temperature scaling drives both teacher and student distributions toward uniformity, which naturally attenuates the KL divergence gradient. In this regime, the model adaptively transitions to -dominated optimization, focusing on robust ranking learning rather than matching uninformative distributions.
4.3 Cross-scale Invariance Constraint ()
Empirical analysis reveals that tail users often exhibit deceptive false confidence due to sparse and homogeneous interactions. To filter such transient perturbations, we introduce a self-supervised symmetric KL divergence that constrains the student model’s output consistency across short-scale views:
| (4) |
where . Genuine user intent evolves smoothly over time, whereas pseudo-sharpness, a form of false confidence arising from sparse data, exhibits significant distributional shifts when the input sequence is truncated. When captures such divergence, it generates strong penalty gradients that guide the student model back toward a more robust representation space. Notably, this constraint excludes the full sequence to preserve its capacity for capturing recent concept drift while ensuring stable and reliable representations for historical intents. This design complements the other loss components by explicitly filtering noise at the distribution level, thereby reinforcing the framework’s overall robustness to signal heterogeneity.
4.4 Sequence-Item Latent Contrastive Enhancement ()
To mitigate preference solidification in head users and enhance semantic discriminability for tail users, we introduce a latent-space contrastive module based on InfoNCE. Transformer-based models such as SASRec and BERT4Rec share a structural property where the sequence representation and the item embedding matrix lie in the same semantic manifold, enabling direct sequence-item alignment:
| (5) |
All components adhere to black-box constraints. The anchor is the L2-normalized final hidden state of the student for the full sequence. The positive sample is obtained by extracting the top-1 item index from the teacher’s logits and mapping it to the student’s embedding matrix via . Negative samples are uniformly drawn from the student’s embedding space, with .
The temperature parameter controls geometric repulsion in the latent space with two complementary benefits. It mitigates head-user representation collapse by enlarging inter-item distances to alleviate preference solidification, and it addresses tail-user discriminative vacuum through negative sampling that establishes well-defined item boundaries.
4.5 Joint Optimization and Gradient Dynamics
The overall optimization objective for the student model is formulated as a weighted combination of the three proposed components:
| (6) |
where the hyper-parameters , , and balance the contribution of each loss term, with dataset- and architecture-specific values provided in the experimental section.
5 Experiments
To evaluate the effectiveness of BAHSD and its adaptive hierarchical distillation loss, we conduct comprehensive experiments aimed at answering the following research questions (RQs):
- •
RQ1: How does BAHSD compare with state-of-the-art black-box knowledge distillation baselines in terms of overall recommendation accuracy?
- •
RQ2: How effectively does BAHSD adapt to signal heterogeneity on both sparse and dense datasets?
- •
RQ3: What are the individual contributions of each loss component to the overall performance?
- •
RQ4: How robust is BAHSD to key hyperparameters, such as truncation ratios and temperature coefficients?
5.1 Experimental Setup
Datasets
We conduct experiments on two public benchmarks: Amazon Beauty[19], a sparse dataset containing approximately 620K interactions, and MovieLens-1M[7], a dense dataset with approximately 1M interactions. Both datasets are preprocessed by retaining only users with at least five interactions, following standard practice, and we adopt a leave-one-out evaluation protocol for model assessment.
| Dataset | Backbone | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Amazon Beauty | BERT4Rec | 0.4 | 0.8 | 1.0 | 1.2 | 0.8 | 1 | 1.2 | 0.3 | 1.0 | 0.1 |
| SASRec | 0.25 | 0.5 | 1.2 | 1.2 | 1.8 | 1 | 0.8 | 0.1 | 4.0 | 0.1 | |
| MovieLens-1M | BERT4Rec | 0.5 | 0.75 | 1.0 | 1.2 | 1.8 | 1 | 0.3 | 1.0 | 2.0 | 0.1 |
| SASRec | 0.5 | 0.75 | 1.0 | 1.2 | 1.8 | 1 | 0.8 | 0.3 | 2.0 | 0.1 |
| Method | Beauty | MovieLens-1M | ||||||
|---|---|---|---|---|---|---|---|---|
| BERT4Rec | SASRec | BERT4Rec | SASRec | |||||
| Recall@10 | NDCG@10 | Recall@10 | NDCG@10 | Recall@10 | NDCG@10 | Recall@10 | NDCG@10 | |
| Teacher | 0.493 | 0.321 | 0.493 | 0.341 | 0.794 | 0.590 | 0.827 | 0.605 |
| DFME | 0.265 | 0.188 | 0.483 | 0.333 | 0.775 | 0.559 | 0.802 | 0.602 |
| ME-MIA | 0.267 | 0.190 | 0.486 | 0.334 | 0.773 | 0.560 | 0.820 | 0.594 |
| UnKD | 0.249 | 0.147 | 0.206 | 0.105 | 0.609 | 0.557 | 0.616 | 0.559 |
| DHKD | 0.210 | 0.109 | 0.137 | 0.069 | 0.600 | 0.551 | 0.598 | 0.548 |
| ABKD-1 | 0.355 | 0.212 | 0.432 | 0.263 | 0.742 | 0.508 | 0.792 | 0.559 |
| ABKD-2 | 0.271 | 0.188 | 0.441 | 0.371 | 0.715 | 0.493 | 0.786 | 0.561 |
| ABKD-3 | 0.266 | 0.181 | 0.435 | 0.263 | 0.723 | 0.495 | 0.791 | 0.556 |
| CDBCF | 0.257 | 0.186 | 0.488 | 0.337 | 0.782 | 0.571 | 0.818 | 0.595 |
| BAHSD | 0.465 | 0.297 | 0.525 | 0.358 | 0.767 | 0.541 | 0.816 | 0.580 |
Backbone Models
We employ two representative architectures as backbone models: SASRec [10], which utilizes unidirectional self-attention, and BERT4Rec [22], which employs bidirectional self-attention. These models represent the mainstream paradigms for modeling temporal user behavior. All distillation experiments are conducted in a homogeneous setting, where both the teacher and student models share identical architectures.
Baselines
We compare BAHSD against the following strong baselines:
- •
DFME [31]: Extracts black-box models through synthetic sequence generation and pairwise ranking distillation, aligning the order of top-k items via marginal ranking loss.
- •
ME-MIA [37]: Optimizes extraction using a combination of BPR ranking loss and Hinge loss, achieving enhanced performance through engineering refinements.
- •
UnKD [2]: Mitigates popularity bias by stratifying items into groups and optimizing ranking consistency within each group.
- •
DHKD [30]: Employs a dual-head distillation strategy to alleviate gradient conflicts between cross-entropy and logit-level losses.
- •
ABKD [24]: Utilizes - divergence as a smooth interpolation between forward and reverse KL divergences to balance mode-covering and mode-seeking effects.
- •
CDBCF [32]: Implements distribution reconstruction via attention-decay theory for black-box model extraction.
Implementation Details
The SASRec and BERT4Rec backbone models are configured with 100-dimensional embeddings, two Transformer encoder layers, and two self-attention heads, each with a dimensionality of 100, ensuring architectural consistency between the teacher and student models. For distillation, we employ the Adam optimizer with a learning rate of 0.001, a batch size of 512, and a total of 100 training epochs. During testing, we adopt a sampling strategy that pairs one positive item with 99 negative items per test instance, and we evaluate distillation performance using NDCG@10 and Recall@10. All experiments are conducted on an NVIDIA L40 GPU with PyTorch 2.9.1 and CUDA 12.4. The specific loss weights for each dataset and backbone combination are provided in Table 2.
| Backbone | Method | Recall@10 | NDCG@10 | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Overall | Head | Mid | Tail | Overall | Head | Mid | Tail | ||
| BERT4Rec | Teacher | 0.493 | 0.527 | 0.500 | 0.478 | 0.321 | 0.357 | 0.322 | 0.308 |
| DFME | 0.265 | 0.289 | 0.273 | 0.255 | 0.188 | 0.205 | 0.193 | 0.181 | |
| ME-MIA | 0.267 | 0.281 | 0.271 | 0.260 | 0.190 | 0.204 | 0.191 | 0.185 | |
| CDBCF | 0.257 | 0.279 | 0.267 | 0.247 | 0.186 | 0.203 | 0.191 | 0.178 | |
| BAHSD | 0.465 | 0.514 | 0.455 | 0.448 | 0.297 | 0.346 | 0.287 | 0.280 | |
| SASRec | Teacher | 0.493 | 0.547 | 0.493 | 0.474 | 0.341 | 0.395 | 0.340 | 0.322 |
| DFME | 0.483 | 0.533 | 0.480 | 0.466 | 0.333 | 0.386 | 0.328 | 0.315 | |
| ME-MIA | 0.486 | 0.532 | 0.484 | 0.466 | 0.334 | 0.383 | 0.332 | 0.315 | |
| CDBCF | 0.488 | 0.536 | 0.493 | 0.469 | 0.337 | 0.388 | 0.377 | 0.318 | |
| BAHSD | 0.525 | 0.573 | 0.516 | 0.505 | 0.358 | 0.417 | 0.345 | 0.338 | |
5.2 Experimental Results and Analysis
| Backbone | Method | Recall@10 | NDCG@10 | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Overall | Head | Mid | Tail | Overall | Head | Mid | Tail | ||
| BERT4Rec | Teacher | 0.794 | 0.689 | 0.745 | 0.844 | 0.590 | 0.478 | 0.549 | 0.641 |
| DFME | 0.775 | 0.650 | 0.728 | 0.837 | 0.559 | 0.439 | 0.518 | 0.620 | |
| ME-MIA | 0.773 | 0.652 | 0.722 | 0.830 | 0.560 | 0.440 | 0.515 | 0.614 | |
| CDBCF | 0.782 | 0.644 | 0.731 | 0.837 | 0.571 | 0.433 | 0.523 | 0.622 | |
| BAHSD | 0.767 | 0.610 | 0.783 | 0.866 | 0.541 | 0.380 | 0.557 | 0.650 | |
| SASRec | Teacher | 0.827 | 0.713 | 0.791 | 0.875 | 0.605 | 0.487 | 0.562 | 0.658 |
| DFME | 0.802 | 0.661 | 0.749 | 0.855 | 0.602 | 0.443 | 0.535 | 0.641 | |
| ME-MIA | 0.820 | 0.694 | 0.778 | 0.872 | 0.594 | 0.461 | 0.556 | 0.651 | |
| CDBCF | 0.818 | 0.699 | 0.778 | 0.869 | 0.595 | 0.472 | 0.553 | 0.650 | |
| BAHSD | 0.816 | 0.701 | 0.825 | 0.879 | 0.580 | 0.455 | 0.589 | 0.673 | |
Overall Distillation Performance (RQ1)
Table 3 reports the distillation performance across different scenarios. BAHSD consistently outperforms all baselines. Notably, on Amazon Beauty with SASRec, BAHSD achieves a relative improvement of 81.38% for tail users and even surpasses the teacher model by 4.75%. Figure 4 illustrates the distribution evolution during distillation, revealing two core mechanisms of BAHSD. First, it mitigates preference solidification in head users by softening the teacher’s overconfident peaks (), transforming rigid pattern memorization into generalized preference modeling. Second, it recovers discriminative power for tail users by reconstructing clear semantic boundaries in the discriminative vacuum region (), compensating for the structural information loss inherent in standard KL divergence-based distillation. We also observe that BAHSD achieves better performance with SASRec than BERT4Rec, suggesting that bidirectional masking poses greater challenges for black-box distillation.
User-Tier Performance Analysis (RQ2)
Tier-wise comparisons in Tables 4 and 5 demonstrate that BAHSD effectively adapts to signal heterogeneity across user strata. On the sparse Amazon Beauty dataset, BAHSD achieves substantial improvements for tail users, with relative Recall@10 gains reaching 81.38%, attributed to InfoNCE-based structural boundary reconstruction that suppresses stochastic noise and compensates for the discriminative vacuum inherent in sparse interactions. On the dense MovieLens-1M dataset, BAHSD maintains stable head-user performance while delivering significant gains for mid and tail tiers, including a 19.4% relative Recall@10 improvement for tail users. The framework intentionally decouples head users from the teacher’s over-concentrated distributions to avoid inheriting localized overfitting patterns, fostering generalized preference boundaries, while cross-scale consistency constraints refine the representation space for mid and tail users to ensure structural alignment despite incomplete teacher context.
| Configuration | Amazon Beauty (Sparse) | MovieLens-1M (Dense) | ||||||
|---|---|---|---|---|---|---|---|---|
| BERT4Rec | SASRec | BERT4Rec | SASRec | |||||
| Recall@10 | NDCG@10 | Recall@10 | NDCG@10 | Recall@10 | NDCG@10 | Recall@10 | NDCG@10 | |
| Full Model | 0.465 | 0.297 | 0.525 | 0.358 | 0.767 | 0.541 | 0.816 | 0.580 |
| w/o | 0.457 | 0.289 | 0.521 | 0.354 | 0.753 | 0.523 | 0.812 | 0.579 |
| w/o | 0.456 | 0.288 | 0.525 | 0.356 | 0.765 | 0.533 | 0.811 | 0.576 |
| w/o | 0.481 | 0.307 | 0.521 | 0.353 | 0.460 | 0.255 | 0.778 | 0.544 |
| w/o | 0.452 | 0.288 | 0.523 | 0.355 | 0.771 | 0.540 | 0.815 | 0.586 |
| w/o | 0.422 | 0.269 | 0.524 | 0.355 | 0.757 | 0.535 | 0.810 | 0.582 |
Ablation Studies (RQ3)
Ablation results in Table 6 demonstrate the synergistic contribution of each component, as removing any single module degrades performance. The contrastive enhancement module is essential for constructing discriminative boundaries and suppressing tail noise, with its removal causing a 9.3% Recall@10 drop on Amazon Beauty with BERT4Rec, though its impact lessens in dense scenarios. The cross-scale invariance constraint acts as an effective denoiser for sparse datasets by filtering transient perturbations from tail users, yet its effect becomes marginal in dense settings where it may over-regularize intent dynamics. The multi-scale alignment loss drives high-fidelity knowledge transfer in dense scenarios by preserving temporal dependencies, while in sparse settings it provides basic alignment and cooperates with . These results confirm that a one-size-fits-all distillation strategy is suboptimal and that adaptive component synergy is essential for handling signal heterogeneity.
Impact of Multi-Scale Truncation Ratios (RQ4)
Sensitivity experiments on five truncation ratio pairs (Fig. 5) show that optimal ratios depend primarily on dataset sparsity rather than architecture. For sparse Amazon Beauty, the optimal ratios are 0.4 for short sequences and 0.8 for mid sequences, where increasing the mid ratio from 0.5 to 0.8 yields a 4.58% NDCG@10 gain for BERT4Rec. For dense MovieLens-1M, optimal ratios shift to 0.3 and 0.6, where reducing the mid ratio from 0.9 to 0.6 improves NDCG@10 by 2.83%. Extreme ratios, such as 0.25/0.5 or 0.7/0.9, consistently degrade performance. The robust optimal range is 0.3-0.4 for short sequences and 0.6-0.8 for mid sequences, with sparser datasets favoring the higher end.
Impact of Distillation Temperature (RQ4)
Experiments with ranging from 1 to 8 (Fig. 6) reveal that optimal temperatures are architecture-dependent. BERT4Rec favors lower settings, such as on Beauty and on MovieLens-1M, to focus on core preferences, while SASRec achieves optimal results at moderate values, including on the sparse dataset and on the dense dataset, to preserve temporal correlations. Extreme temperatures consistently degrade performance: excessively low induces knowledge narrowing that particularly harms sparse datasets, whereas overly high leads to knowledge blurring that reduces accuracy on dense datasets. Sparse datasets exhibit narrower optimal temperature ranges with greater sensitivity, while dense datasets demonstrate wider robustness and stability.
6 Conclusion
This paper introduces BAHSD, a black-box adaptive distillation framework designed to address signal heterogeneity in sequential recommendation. Through empirical analysis, we identify two pathological signal modes, namely preference solidification for head users and information vacuum for tail users, which undermine the effectiveness of uniform distillation objectives. BAHSD tackles these challenges by employing multi-scale consistency probing that implicitly perceives signal reliability and by integrating an adaptive hierarchical loss that dynamically adjusts optimization strategies according to the perceived signal quality. Extensive experiments on both sparse and dense datasets demonstrate that BAHSD consistently outperforms state-of-the-art baselines, achieving substantial improvements for tail users while preserving head-user performance and even surpassing the teacher model in certain scenarios. BAHSD offers a model-agnostic and plug-and-play solution for high-fidelity black-box model extraction.
This work provides a robust, model-agnostic, and plug-and-play solution for the local deployment of industrial sequential recommendation models. Looking forward, our future research will focus on extending BAHSD to scenarios with even higher item-space cardinality and exploring the potential of utilizing federated learning frameworks to further mitigate privacy concerns in black-box distillation.
Acknowledgments.
This research was funded by the National Key Research and Development Program of China (Grant No. 2024YFC3307400), under the "Social Governance and Smart Society Technology Support" key special project.
References
- [1] (2024) A survey of sequential recommendation systems: techniques, evaluation, and future directions. Information Systems 125, pp. 102427. Cited by: §2.1.
- [2] (2023) Unbiased knowledge distillation for recommendation. In Proceedings of the sixteenth ACM international conference on web search and data mining, pp. 976–984. Cited by: §1, §2.3, 3rd item.
- [3] (2024) Distillation matters: empowering sequential recommenders to match the performance of large language models. In Proceedings of the 18th ACM Conference on Recommender Systems, pp. 507–517. Cited by: §2.2.
- [4] (2023) Ensemble modeling with contrastive knowledge distillation for sequential recommendation. In Proceedings of the 46th International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 58–67. Cited by: §2.2.
- [5] (2021) Knowledge distillation: a survey. International journal of computer vision 129 (6), pp. 1789–1819. Cited by: §2.1.
- [6] (2024) Intra-and inter-group optimal transport for user-oriented fairness in recommender systems. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 38, pp. 8463–8471. Cited by: §2.3.
- [7] (2015) The movielens datasets: history and context. Acm transactions on interactive intelligent systems (tiis) 5 (4), pp. 1–19. Cited by: §3, §5.1.
- [8] (2015) Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531. Cited by: §2.2.
- [9] (2020) DE-rrd: a knowledge distillation framework for recommender system. In Proceedings of the 29th ACM international conference on information & knowledge management, pp. 605–614. Cited by: §2.2.
- [10] (2018) Self-attentive sequential recommendation. In 2018 IEEE international conference on data mining (ICDM), pp. 197–206. Cited by: §1, §2.1, §5.1.
- [11] (2021) Bidirectional distillation for top-k recommender system. In Proceedings of the Web Conference 2021, pp. 3861–3871. Cited by: §2.2.
- [12] (2024) Few-shot learning for cold-start recommendation. In Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024), N. Calzolari, M. Kan, V. Hoste, A. Lenci, S. Sakti, and N. Xue (Eds.), Torino, Italia, pp. 7185–7195. External Links: Link Cited by: §2.1.
- [13] (2023) Learning query-aware embedding index for improving e-commerce dense retrieval. In Proceedings of the 46th International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR ’23, New York, NY, USA, pp. 3265–3269. External Links: ISBN 9781450394086, Link, Document Cited by: §2.1.
- [14] (2023) Adaptive hyper-parameter learning for deep semantic retrieval. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing: Industry Track, pp. 775–782. Cited by: §2.1.
- [15] (2020) Symmetric metric learning with adaptive margin for recommendation. In Proceedings of the AAAI conference on artificial intelligence, Vol. 34, pp. 4634–4641. Cited by: §1.
- [16] (2025) Logits deconfusion with clip for few-shot learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 25411–25421. Cited by: §2.2.
- [17] (2020) A general knowledge distillation framework for counterfactual recommendation via uniform data. In Proceedings of the 43rd international ACM SIGIR conference on research and development in information retrieval, pp. 831–840. Cited by: §2.2.
- [18] (2022) ContE: contextualized knowledge graph embedding for circular relations. Data Min. Knowl. Discov. 37 (1), pp. 110–135. External Links: ISSN 1384-5810, Link, Document Cited by: §2.1.
- [19] (2019) Justifying recommendations using distantly-labeled reviews and fine-grained aspects. In Proceedings of the 2019 conference on empirical methods in natural language processing and the 9th international joint conference on natural language processing (EMNLP-IJCNLP), pp. 188–197. Cited by: §3, §5.1.
- [20] (2026) A survey on sequential recommendation. Frontiers of Computer Science 20 (3), pp. 2003606. Cited by: §2.1.
- [21] (2025) Knowledge distillation based recommendation systems: a comprehensive survey. Electronics 14 (8), pp. 1538. Cited by: §2.1.
- [22] (2019) BERT4Rec: sequential recommendation with bidirectional encoder representations from transformer. In Proceedings of the 28th ACM international conference on information and knowledge management, pp. 1441–1450. Cited by: §1, §2.1, §5.1.
- [23] (2025) Knowledge distillation with refined logits. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 1110–1119. Cited by: §2.2.
- [24] (2025) ABKD: pursuing a proper allocation of the probability mass in knowledge distillation via --divergence. arXiv preprint arXiv:2505.04560. Cited by: §2.2, 5th item.
- [25] (2025) Improving long-tail user ctr prediction via hierarchical distribution alignment. In Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining V. 2, pp. 3079–3090. Cited by: §2.3.
- [26] (2025) Ekd4rec: ensemble knowledge distillation from llm-based models to traditional sequential recommenders. In Companion Proceedings of the ACM on Web Conference 2025, pp. 1370–1374. Cited by: §2.2.
- [27] (2021) Model-agnostic counterfactual reasoning for eliminating popularity bias in recommender system. In Proceedings of the 27th ACM SIGKDD conference on knowledge discovery & data mining, pp. 1791–1800. Cited by: §2.3.
- [28] (2024) Coral: collaborative retrieval-augmented large language models improve long-tail recommendation. In Proceedings of the 30th ACM SIGKDD conference on knowledge discovery and data mining, pp. 3391–3401. Cited by: §2.3.
- [29] (2025) HPSERec: a hierarchical partitioning and stepwise enhancement framework for long-tailed sequential recommendation. In The Thirty-ninth Annual Conference on Neural Information Processing Systems, Cited by: §2.3.
- [30] (2025) Dual-head knowledge distillation: enhancing logits utilization with an auxiliary head. In Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining V. 2, pp. 3530–3541. Cited by: §2.2, 4th item.
- [31] (2021) Black-box attacks on sequential recommenders via data-free model extraction. In Proceedings of the 15th ACM conference on recommender systems, pp. 44–54. Cited by: 1st item.
- [32] (2026) A cognitive distribution and behavior-consistent framework for black-box attacks on recommender systems. arXiv preprint arXiv:2602.10633. Cited by: 6th item.
- [33] (2021) Causal intervention for leveraging popularity bias in recommendation. In Proceedings of the 44th international ACM SIGIR conference on research and development in information retrieval, pp. 11–20. Cited by: §2.3.
- [34] (2021) A model of two tales: dual transfer learning framework for improved long-tail item recommendation. In Proceedings of the web conference 2021, pp. 2220–2231. Cited by: §2.3.
- [35] (2025) Exploring feature-based knowledge distillation for recommender system: a frequency perspective. In Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining V. 1, pp. 2182–2193. Cited by: §2.2.
- [36] (2025) Rejuvenating cross-entropy loss in knowledge distillation for recommender systems. arXiv preprint arXiv:2509.20989. Cited by: §1, §2.2.
- [37] (2023) Membership inference attacks against sequential recommender systems. In Proceedings of the ACM web conference 2023, pp. 1208–1219. Cited by: 2nd item.