Modular Representation Compression: Adapting LLMs for Efficient and Effective Recommendations

Yunjia Xi, Menghui Zhu, Jianghao Lin, Bo Chen, Ruiming Tang, Yong Yu, Weinan ZhangarXiv 2026

TL;DR

Integrating Large Language Models (LLMs) into industrial recommendation systems yields powerful text embeddings but introduces prohibitive storage and computational costs due to their high dimensionality. This paper uncovers a counterintuitive "Mid-layer Representation Advantage" (MRA)—where middle layers of fine-tuned LLMs outperform the final layer on downstream recommendation tasks—and introduces MARC, a modular compression framework that explicitly decouples representation learning from task adaptation to achieve a 2.82% eCPM lift in production.

What Problem Does This Paper Address?

Industrial recommendation systems (RSs) must process millions of users and items within strict latency limits (often under 100ms). To bypass the massive online inference latency of LLMs, a common strategy is to generate and pre-cache text representations offline. However, state-of-the-art LLMs output high-dimensional vectors (e.g., 4096 dimensions for Llama 3), leading to a linear explosion in storage space, training time, and inference overhead for downstream models.

Figure 1: The impact of various LLM representations on downstream performance and costs in MovieLens-1M.

While fine-tuning-based compression methods exist, the authors identify a pervasive flaw: the Mid-layer Representation Advantage (MRA). When an LLM is fine-tuned on a recommendation proxy task, performance on downstream tasks peaks in the middle layers and degrades significantly by the final layer. This happens because the final layers over-specialize on the single-objective proxy task, acting as an information bottleneck that discards rich, diverse semantic features crucial for recommendation.

Methods

The authors propose Modular Representation Compression (MARC) to transform this uncontrolled, implicit layer specialization into an explicit, controllable architecture. MARC consists of two core components:

  1. Modular Adjustment: The LLM backbone is restricted entirely to representation learning. The framework introduces two external, lightweight modules to absorb downstream training pressure: a Compression Network to condense high-dimensional semantics, and a User-Item Matching Network to handle task adaptation. This prevents the LLM's final layers from collapsing into task-specific heads.
  2. Modular Task Decoupling: To ensure each module sticks to its designated role, MARC applies an information constraint using the Hilbert-Schmidt Independence Criterion (HSIC). HSIC maximizes the mutual information between the original high-dimensional and compressed low-dimensional vectors. Crucially, HSIC handles dimension mismatches without requiring distortive projection layers (unlike standard MSE or InfoNCE losses).

Datasets

The framework was evaluated across three public benchmarks and one real-world production environment:

  • MovieLens-1M (ML-1M): 1 million movie ratings from 6,000 users.
  • Yelp: Approximately 8 million business reviews.
  • MovieLens-25M (ML-25M): 25 million movie ratings.
  • Commercial Industrial Dataset: A large-scale search advertising dataset used for online production testing.

Key Insights and Ideas

  • The Over-Specialization Trap: Standard fine-tuning forces final layers to discard "redundant" information to satisfy the proxy objective. However, what is redundant for a proxy task (like contrastive text matching) is often vital for downstream recommendation tasks (like click-through rate prediction).
  • Explicit Modularity via Information Theory: Instead of allowing LLM layers to spontaneously differentiate, MARC uses external networks and HSIC constraints to enforce hard boundaries between learning a representation and adapting to a task.
The Mid-layer Representation Advantage (MRA) observed across different datasets and LLMs.

Key Results

  • Mitigating MRA: As shown in Figure 3, MARC successfully eliminates the mid-layer performance drop. The final layer representations consistently deliver the highest downstream performance.
  • High Information Density: On the ML-1M dataset, compressing Llama3-8B embeddings from 4096 dimensions down to just 128 dimensions using MARC-C achieved an AUC of 0.8011. This significantly outperformed state-of-the-art compression baselines like MRL (0.7943) and LARR (0.7911), suffering a negligible accuracy loss compared to the uncompressed oracle (0.8020).
  • Production Success: In a 7-day online A/B test within a commercial search advertising scenario serving tens of millions of users, MARC achieved a 2.82% lift in eCPM (effective cost per mille) over a highly optimized production baseline, without increasing online inference latency.

Limitations and Future Work

The authors note that the computational complexity of the HSIC constraint scales quadratically with the batch size ($O(n^2)$). While this overhead is currently negligible compared to the massive cost of computing the LLM backbone itself, it could become a bottleneck for exceptionally large batch sizes. Future work could explore scaling MARC to even larger foundation models or adapting its modular decoupling strategy to other multi-task learning domains.

Summary updated

Abstract

Recently, large language models (LLMs) have advanced recommendation systems (RSs), and recent works have begun to explore how to integrate LLMs into industrial RSs. While most approaches deploy LLMs offline to generate and pre-cache augmented representations for RSs, high-dimensional representations from LLMs introduce substantial storage and computational costs. Thus, it is crucial to compress LLM representations effectively. However, we identify a counterintuitive phenomenon during representation compression: Mid-layer Representation Advantage (MRA), where representations from middle layers of LLMs outperform those from final layers in recommendation tasks. This degraded final layer renders existing compression methods, which typically compress on the final layer, suboptimal. We interpret this based on modularity theory that LLMs develop spontaneous internal functional modularity and force the final layer to specialize in the proxy training task. Thus, we propose \underline{M}odul\underline{a}r \underline{R}epresentation \underline{C}ompression (MARC) to explicitly control the modularity of LLMs. First, Modular Adjustment explicitly introduces compression and task adaptation modules, enabling the LLM to operate strictly as a representation-learning module. Next, to ground each module to its specific task, Modular Task Decoupling uses information constraints and different network structures to decouple tasks. Extensive experiments validate that MARC addresses MRA and produces efficient representations. Notably, MARC achieved a 2.82% eCPM lift in an online A/B test within a large-scale commercial search advertising scenario.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
MovieLens 1M · ML-1M retrieval task · DSSMMARC-CHitRate@100.3580+0.04 vs baselinesplit: test · fine-tuned · params=1M · backbone=Llama3-8B · retrieval-model=DSSM · representation-dimension=128
Source quote
L260: MARC-C │ 0.2089* │ 0.2342* │ 0.2631* │ 0.3580* │ 0.4577* │ 0.6026* │ 0.1770*
Large-scale commercial search advertising online A/B testMARCeCPM increase2.82%split: test · duration=7 days · comparison=strong production baseline
Source quote
L273: The original, high-dimensional representations are not used online due to their large deployment costs. In a 7-day online A/B test, MARC achieved a 2.82% increase in eCPM against a strong production baseline, with similar inference latency.
Reported baseline / comparator measurements (1)
BenchmarkMethodMetricScoreProtocol / Evidence
MovieLens 1M · ML-1M retrieval task · DSSMMRL baselineHitRate@100.3177fine-tuned · params=1M · backbone=Llama3-8B · retrieval-model=DSSM · representation-dimension=128
Source quote
L259: MRL │ 0.1842 │ 0.2115 │ 0.2402 │ 0.3177 │ 0.4255 │ 0.5698 │ 0.1582
BibTeX
@misc{xi2026modular,
  author = {Yunjia Xi and Menghui Zhu and Jianghao Lin and Bo Chen and Ruiming Tang and Yong Yu and Weinan Zhang},
  title = {{Modular Representation Compression: Adapting LLMs for Efficient and Effective Recommendations}},
  year = {2026},
  eprint = {2604.18146},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.18146},
}
Figure