Attn-GS: Attention-Guided Context Compression for Efficient Personalized LLMs

Shenglai Zeng, Tianqi Zheng, Chuan Tian, Dante Everaert, Yau-Shian Wang, Yupin Huang, Michael J. Morais, Rohit Patki, Jinjin Tian, Xinnan Dai, Kai Guo, Monica Xiao Cheng, Hui Liu

TL;DR

Personalizing Large Language Models (LLMs) with extensive user histories typically incurs high API costs and severe latency due to input token constraints. Attn-GS solves this by using the internal attention patterns of a fine-tuned "marking" model to pinpoint critical sentences in a user's profile, guiding an offline compression model to generate highly compact, task-relevant summaries. This approach slashes token usage by up to 50× while retaining downstream performance remarkably close to using the full, uncompressed context.

What Problem Does This Paper Address?

To deliver truly tailored experiences—such as personalized movie recommendations or writing assistants—LLMs need access to a user's rich interaction history and profile. However, feeding thousands of tokens of raw user history directly into an LLM for every query is highly impractical; it blows past context windows, spikes API costs, and introduces massive inference latency.

Overview of personalization paths: directly using raw contexts vs. compressing offline.

Current workarounds rely on simple heuristics (like keeping only the most recent interactions) or prompting an LLM to naively summarize the entire history. The authors point out a major flaw here: these methods treat the user profile as a monolithic block. They completely ignore how an LLM internally prioritizes different pieces of information when solving a specific task.

Methods

The authors introduce Attn-GS (Attention-Guided Summarization), a two-stage framework designed to compress context offline before it ever hits the online generation phase:

  1. Critical Personalization Sentence Marking: The full user history and the target task description are fed into a small, white-box "marking" LLM ($\Phi_{\text{Mark}}$). The framework extracts token-level attention scores from the model's internal layers (specifically targeting the attention paid by the last token to the rest of the sequence). These token scores are aggregated into sentence-level scores. Sentences that clear a relative threshold ($\alpha$) are wrapped in special XML-like tags: <start_important> and <end_important>.

  2. Summarization Based on Marked Context: This tagged text is passed to a summary model ($\Phi_{\text{Sum}}$). The prompt explicitly instructs the model to prioritize the marked sentences, condensing the sprawling user history into a tight, information-dense summary within a strict token budget (e.g., 50 to 200 tokens).

Finally, during online inference, this compact summary is paired with the active user prompt and sent to the generator LLM ($\Phi_{\text{G}}$).

Datasets

The framework was evaluated on two distinct personalization benchmarks:

  • MovieLens-1M: Adapted for movie recommendation. The context includes user demographics, movie titles, genres, ratings, and summaries. The task is to predict the user's next interaction out of five candidates.
  • LaMP-5: Part of the Language Model Personalization benchmark, focused on scholarly title generation. The context consists of an author's past paper titles, abstracts, and publication dates, with the goal of generating a personalized title for a new abstract.

Key Insights and Ideas

  • LLM Attention is a Natural Filter: The authors discovered that an LLM's internal attention weights naturally align with what information is actually useful for a task.
  • Fine-Tuning Sharpens Focus: While a vanilla, off-the-shelf LLM tends to over-attend to generic information (like user demographics), fine-tuning the marking model dramatically sharpens its discriminative attention toward task-critical signals, like specific past movie titles or writing styles.
  • The "Goldilocks" Layers: Not all LLM layers are created equal for this task. The authors found that attention weights from the middle layers (e.g., layer 6 in a 1B model or layer 12 in an 8B model) provide the best marking signals. Early layers focus too much on low-level syntax, while the final layers are overly specialized for token generation mechanics.
Ablation studies showing the impact of the threshold factor $\alpha$ and layer selection on downstream accuracy.

Key Results

  • 50× Token Reduction: Attn-GS compressed user histories down to just 200 tokens (from an original pool of roughly 10,000 tokens) while achieving performance within 1.8% of the uncompressed, full-context upper bound.
  • Outperforming the Baselines: Across both datasets, Attn-GS consistently beat standard compression baselines, including direct summarization, Chain-of-Thought (CoT) summarization, and LLM self-reflection.
  • High Token Efficiency: To reach a target accuracy of 48% on the MovieLens dataset, standard truncation and direct summarization required 750 tokens. Attn-GS achieved the same accuracy using only 100 tokens—a 7× improvement in token efficiency over competing compression methods.

Limitations and Future Work

While Attn-GS marks a significant step forward for efficient personalization, the authors note a few areas for improvement:

  • Mechanistic Understanding: A deeper, more granular understanding of exactly how LLMs internally synthesize and integrate these personalized inputs remains an open research question.
  • Generalization: The current framework was validated on recommendation and title-generation tasks. Future work will need to explore how well attention-guided compression scales to multi-task environments and more diverse application domains.

Summary updated

BibTeX
@inproceedings{zeng2026attn,
  author = {Shenglai Zeng and Tianqi Zheng and Chuan Tian and Dante Everaert and Yau-Shian Wang and Yupin Huang and Michael J. Morais and Rohit Patki and Jinjin Tian and Xinnan Dai and Kai Guo and Monica Xiao Cheng and Hui Liu},
  title = {{Attn-GS: Attention-Guided Context Compression for Efficient Personalized LLMs}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2026},
  doi = {10.18653/v1/2026.acl-long.1663},
}
Figure