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.
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:
- 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.
- 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.
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