Intermittent Semi-Working Mask: A New Masking Paradigm for LLMs
On the map: Efficient LLM inference and serving → KV cache optimization
Abstract (arXiv)
Multi-turn dialogues and context-intensive tasks challenge Large Language Models (LLMs) to integrate long histories without sacrificing generation quality. Although prefix LLMs can better exploit historical context via bidirectional attention on prefix tokens, they are rarely used in practice because multi-turn training requires many duplicated triplets, and its bidirectional prefix prevents KV-cache reuse at inference time, driving up high cost and latency. To retain the contextual understanding of prefix mask while preserving the inference-time efficiency of causal mask, we introduce Intermittent Semi-working Mask (ISM), a masking scheme that injects sparse bidirectional attention into the causal backbone. ISM alternates bidirectional attention over query segments with unidirectional attention over answer segments, enabling the synthesis of in-context while preserving global causality. This design eliminates triplet expansion during training and maintains KV-cache reuse during inference, yielding latency comparable to standard causal LLMs. ISM is architecture-agnostic and parameter-free, adding only minimal latency. Across extensive evaluations, ISM outperforms causal baselines not only on multi-turn dialogue, but also on context-intensive tasks like mathematical reasoning.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in KV cache optimization, one of 12 directions in Efficient LLM inference and serving. Builds on 37 of its 45 references that are in the map. First posted on arXiv 1 Aug 2024.
Builds on
37 of 45 references.
References · 37
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023GPT-4 Technical Reportcited by 18,132
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,393
- 2020Measuring Massive Multitask Language Understandingcited by 7,768
25 more
- 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,874
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
- 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,203
- 2022Scaling Instruction-Finetuned Language Modelscited by 2,997
- 2024Qwen2 Technical Reportcited by 2,076
- 2023PaLM 2 Technical Reportcited by 1,154
- 2021GLM: General Language Model Pretraining with Autoregressive Blank Infillingcited by 1,026
- 2023Enhancing Chat Language Models by Scaling High-quality Instructional Conversationscited by 825
- 2022Transformers learn in-context by gradient descentcited by 714
- 2023C-Eval: A Multi-Level Multi-Discipline Chinese Evaluation Suite for Foundation Modelscited by 694
- 2019Unified Language Model Pre-training for Natural Language Understanding and Generationcited by 668
- 2017DailyDialog: A Manually Labelled Multi-turn Dialogue Datasetcited by 649
- 2023LMSYS-Chat-1M: A Large-Scale Real-World LLM Conversation Datasetcited by 449
- 2023GPTScore: Evaluate as You Desirecited by 357
- 2023Trained Transformers Learn Linear Models In-Contextcited by 331
- 2022UL2: Unifying Language Learning Paradigmscited by 292
- 2023Improving Language Model Negotiation with Self-Play and In-Context Learning from AI Feedbackcited by 202
- 2020MuTual: A Dataset for Multi-Turn Dialogue Reasoningcited by 114
- 2024MT-Eval: A Multi-Turn Capabilities Evaluation Benchmark for Large Language Modelscited by 78
- 2023Cue-CoT: Chain-of-thought Prompting for Responding to In-depth Dialogue Questions with LLMscited by 62
- 2020KdConv: A Chinese Multi-domain Dialogue Dataset Towards Multi-turn Knowledge-driven Conversationcited by 59
- 2021NaturalConv: A Chinese Dialogue Dataset Towards Multi-turn Topic-driven Conversationcited by 35
- 2023CausalLM is not optimal for in-context learningcited by 26
- 2023Do pretrained Transformers Learn In-Context by Gradient Descent?cited by 18
- 2023From Beginner to Expert: Modeling Medical Knowledge into General LLMscited by 14
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Tail-Replay: Escaping the Curse of Linear Attention in Prefix Caching for Hybrid LLMs
- 2026Compressing Long Context into Answer-Aligned Memory Embeddings for LLM Inference
- 2025Retrospective Sparse Attention for Efficient Long-Context Generation
- 2026Context Memorization for Efficient Long Context Generation
- 2025Krul: Efficient State Restoration for Multi-turn Conversations with Dynamic Cross-layer KV Sharing
- 2025Training-free Context-adaptive Attention for Efficient Long Context Modeling
- 2024Quest: Query-Aware Sparsity for Efficient Long-Context LLM Inference
- 2025Sentinel: Decoding Context Utilization via Attention Probing for Efficient LLM Context Compression