TL;DR
SeqFold is a novel framework that compresses massive multi-layer user action sequence backbones into compact, timestamp-addressable discrete codes. By combining learned multi-channel fusion with Lookup-Free Quantization (LFQ), it achieves a staggering 3,400x reduction in storage while retaining over 97% of the predictive performance of uncompressed models.
What Problem Does This Paper Address?
In modern e-commerce, user behavior models are the engine behind search and recommendations. These models often use "backbones" (like Transformers) to process long histories—sometimes thousands of actions like clicks, searches, and purchases.
The challenge isn't just processing these sequences; it's reusing them. A frozen backbone produces a rich timeline of hidden states for every single action. However, downstream applications (like a search ranker) only need a "snapshot" of the user's state at the exact moment they perform a query. Storing or transmitting the full, uncompressed hidden-state timeline for every user is prohibitively expensive, often requiring millions of floating-point values per sequence. Existing methods usually focus on making the backbone faster, but SeqFold focuses on making the interface between the backbone and downstream tasks efficient.
Methods
SeqFold acts as a compressed-state interface that sits between a frozen backbone and downstream models. Its architecture consists of three main components:
- Multi-Channel Fusion & Gating: Instead of saving every action's state, SeqFold uses data-dependent gating to route information from the backbone into a fixed number of "fusion channels." This condenses thousands of actions into a small set of continuous vectors.
- Temporal Decay: To capture the fact that recent actions are often more relevant than old ones, each channel has a learnable exponential decay factor. This allows the model to "forget" or "remember" information over different time horizons.
- Lookup-Free Quantization (LFQ): To achieve extreme compression, the fused vectors are mapped into binary codes. Unlike standard Vector Quantization (VQ) which requires a massive codebook, LFQ uses sign-based indexing, making it incredibly lightweight and efficient for large-scale serving.
To make this practical, the authors developed a fused streaming implementation (using Triton). This kernel updates the user state action-by-action but only "materializes" (saves) the state at the specific timestamps requested by downstream tasks, avoiding the memory bottleneck of storing a dense prefix timeline.
Datasets
The researchers evaluated SeqFold on large-scale proprietary e-commerce datasets from Coupang. These datasets include heterogeneous user actions (searches, clicks, purchases) with sequences up to 2,000 actions for main experiments and up to 10,000 actions for scalability benchmarks.
Key Insights and Ideas
- Decoupling Update from Materialization: The "aha moment" here is that while the model must process every action to maintain a causal state, it only needs to output a state when a downstream task asks for it. This insight allows for massive savings in training backfill and online serving.
- Multi-Layer Compression: The authors found that compressing information from all layers of the Transformer backbone (not just the last one) provides complementary signals that significantly improve downstream performance.
- Learned Memory Horizons: By making temporal decay learnable per channel, SeqFold can automatically dedicate some channels to long-term user preferences and others to short-term "in-the-moment" intent.
- Task-Specific Decoding: The compressed codes are "universal." Different downstream tasks (e.g., Search vs. Query Autocomplete) can learn their own small decoders to map these shared codes into whatever embedding dimension fits their specific needs.
Key Results
- Extreme Compression: SeqFold reduced the per-state storage from ~7 MB (uncompressed) to just 2,048 bytes, a 3,400x reduction.
- High Fidelity: Despite the compression, the model maintained a high level of performance, trailing the uncompressed "Full Model" by only 2.11% in PRAUC.
- Efficiency at Scale: For long sequences (10,000 actions), the fused streaming kernel was 19.6x faster and used significantly less peak memory than an optimized PyTorch baseline.
- Downstream Transfer: The compressed codes showed consistent gains when plugged into real-world search and query autocomplete models, proving they capture meaningful user intent.
Limitations and Future Work
- Proprietary Data: Because the evaluation is on proprietary data, it is difficult for outside researchers to replicate the exact results, though the architectural principles are general.
- Fixed Checkpoints: In the current training setup, the model uses periodic export points. The authors suggest that adaptive checkpointing (exporting states only when a significant user action occurs) could be a promising future direction.
- Task-Aware Budgets: Future work could explore varying the compression budget (number of bits) dynamically based on the complexity of the downstream task.
Summary updated