Exact and Efficient Unlearning for Large Language Model-Based Recommendation

Zhiyu Hu, Yang Zhang, Minghao Xiao, Wenjie Wang, Fuli Feng, Xiangnan He

TL;DR

The Adapter Partition and Aggregation (APA) framework enables Large Language Model-based recommenders (LLMRec) to "forget" specific user data exactly and efficiently. By partitioning data into semantic shards and training individual LoRA adapters, the system only needs to retrain a small fraction of the model to unlearn data, while a novel sample-adaptive aggregation strategy ensures recommendation accuracy remains high without increasing inference latency.

What Problem Does This Paper Address?

As Large Language Models (LLMs) are increasingly used for personalized recommendations (LLMRec), they inevitably ingest sensitive user history. Privacy regulations like GDPR grant users the "right to be forgotten," requiring systems to completely remove specific data points.

However, unlearning in LLMs faces a "trilemma":

  1. Exactness: Approximate methods (like gradient ascent) often leave "shadows" of the data behind, failing to meet strict legal standards for data erasure.
  2. Efficiency: Retraining a billion-parameter model from scratch every time a user requests data deletion is computationally bankrupt.
  3. Performance: Existing "divide-and-conquer" methods (like SISA) often suffer from reduced recommendation quality or massive inference overhead because they require running the LLM multiple times for a single request.

Methods

The authors introduce the APA (Adapter Partition and Aggregation) framework, which operates in three main phases:

  • Balanced Semantic-aware Partitioning: Instead of random splitting, the training data is partitioned into $K$ shards based on text semantics. They use the LLM’s own hidden representations and K-means clustering to ensure that data within a shard is "knowledge-homogeneous."
  • Sub-adapter Training: For each shard, a dedicated LoRA (Low-Rank Adaptation) adapter is trained. Because the LLM backbone remains frozen, only these tiny adapters (the "sub-adapters") are updated.
  • Sample-Adaptive Aggregation: This is the core innovation. At inference time, the system doesn't just average the adapters. It identifies the "top-n" most similar samples from a validation set for a given query. It then calculates the prediction error of each sub-adapter on those validation samples and assigns higher weights (attention) to the adapters that perform best.
  • Parameter-level Merging: To keep inference fast, the weights of these sub-adapters are merged into a single set of parameters before the LLM forward pass. This allows for "one-pass" prediction, avoiding the $K$-fold increase in latency seen in previous methods.

Unlearning Process: When a deletion request arrives, the system identifies which shard the "unusable data" belongs to and retrains only that specific sub-adapter.

Datasets

The framework was evaluated on two classic recommendation benchmarks adapted for LLMs:

  • BookCrossing (Book): User ratings for books, binarized into "like/dislike" based on a threshold of 5.
  • MovieLens100K (Movie): Movie ratings binarized into "like/dislike" based on a threshold of 3. The authors followed the TALLRec protocol, converting user-item interactions into natural language instructions (e.g., "Given the user's preference... Target new movie: ... Output: Yes/No").

Key Insights and Ideas

  • Semantics Drive Performance: Partitioning data by what it means (textual similarity) is significantly more effective for LLMs than traditional collaborative-filtering-based partitioning. It allows sub-adapters to become "experts" in specific domains.
  • Validation as a Proxy for Weighting: You don't need to train a complex "gate" (like in Mixture-of-Experts) to aggregate adapters. Simply looking at how adapters performed on similar past examples (validation data) provides a robust heuristic for weighting them in real-time.
  • The "Free Lunch" of Aggregation: Surprisingly, APA often outperforms a single model trained on the full dataset. This suggests that the ensemble of specialized adapters, weighted adaptively, can capture nuances that a single global adapter might miss.

Key Results

  • Speedup: On the MovieLens dataset, APA achieved a 3.96x speedup in unlearning time compared to full retraining (roughly proportional to the number of shards, $K=4$).
  • Accuracy (AUC): APA maintained or improved recommendation quality. On the Book dataset, APA achieved an AUC of 0.6846, outperforming the "gold standard" full retraining (0.6738).
  • Inference Efficiency: While traditional ensemble methods (SISA) increased inference time by 4x, APA’s parameter-level aggregation resulted in a negligible delay of only 0.02 seconds per sample.

Limitations and Future Work

  • Batch Unlearning: The current study focuses on unlearning one sample at a time. The authors note that exploring more efficient ways to handle large batches of unlearning requests is a necessary next step.
  • PEFT Generalization: While the paper focuses on LoRA, the authors believe the framework can be extended to other Parameter-Efficient Fine-Tuning (PEFT) methods like Adapter Tuning, but this hasn't been empirically tested yet.
  • Shard Scaling: There is an inherent trade-off between the number of shards (higher $K$ = faster unlearning) and the amount of data per shard (lower data = potentially weaker sub-adapters). Finding the optimal "sweet spot" for massive datasets remains an open question.

Summary updated

BibTeX
@article{hu2025exact,
  author = {Zhiyu Hu and Yang Zhang and Minghao Xiao and Wenjie Wang and Fuli Feng and Xiangnan He},
  title = {{Exact and Efficient Unlearning for Large Language Model-Based Recommendation}},
  journal = {IEEE Trans. Knowl. Data Eng.},
  year = {2025},
  url = {https://openreview.net/forum?id=TgMplOFeWJ},
}
Figure