Jingwen Leng
Author directory2026
One Size Does Not Fit All: Token-Wise Adaptive Compression for KV Cache
Liming Lu | Kaixi Qiu | Jiayu Zhou | Jushi Kai | Haoyan Zhang | Jingzhi Wang | Huanyu Wang | Bo Jiang | Jingwen Leng | Ziwei He | Zhouhan Lin
Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing
Liming Lu | Kaixi Qiu | Jiayu Zhou | Jushi Kai | Haoyan Zhang | Jingzhi Wang | Huanyu Wang | Bo Jiang | Jingwen Leng | Ziwei He | Zhouhan Lin
Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing
Despite the remarkable progress of Large Language Models (LLMs), the escalating memory footprint of the Key-Value (KV) cache remains a critical bottleneck for efficient inference. While dimensionality reduction offers a promising compression avenue, existing approaches typically either necessitate prohibitively expensive pre-training from scratch or suffer from severe performance deterioration under high compression regimes. In this work, we propose DynaKV, a novel post-training framework for low-rank KV cache compression. To the best of our knowledge, DynaKV is the first low-rank method to dynamically allocate compression rates to individual tokens according to their semantic meaning, which allows it to achieve better fidelity at aggressive compression ratios. Extensive experiments demonstrate that our method consistently outperforms existing state-of-the-art compression techniques, achieving significant memory reduction while maintaining competitive generation quality. Furthermore, our approach is orthogonal to sequence-level pruning methods. When integrated with SnapKV, DynaKV retains only 6% of the KV cache while maintaining 94% of the baseline performance on the LongBench benchmark.
CuBridge: An LLM-Based Framework for Understanding and Reconstructing High-Performance Attention Kernels
Xing Ma | Yangjie Zhou | Wu Sun | Zihan Liu | Jingwen Leng | Yun Lin | Shixuan Sun | Minyi Guo | Jin Song Dong
Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)
Xing Ma | Yangjie Zhou | Wu Sun | Zihan Liu | Jingwen Leng | Yun Lin | Shixuan Sun | Minyi Guo | Jin Song Dong
Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)
Efficient CUDA implementations of attention mechanisms are critical to modern deep learning systems, yet supporting diverse and evolving attention variants remains challenging. Existing frameworks and compilers trade performance for flexibility, while expert-written kernels achieve high efficiency but are difficult to adapt. Recent work explores large language models (LLMs) for GPU kernel generation, but prior studies report unstable correctness and significant performance gaps for complex operators such as attention.We present CuBridge, an LLM-based framework that adapts expert-written attention kernels through a structured lift–transfer–lower workflow. CuBridge starts from expert-written CUDA attention kernels and lifts them into an executable intermediate representation that makes execution orchestration explicit while abstracting low-level CUDA syntax. Given a user-provided PyTorch specification, CuBridge generates and verifies a target IR program, then reconstructs optimized CUDA code via reference-guided lowering. Across diverse attention variants and GPU platforms, CuBridge consistently produces correct kernels and substantially outperforms general frameworks, compiler-based approaches, and prior LLM-based methods.
On the (In-)Security of the Shuffling Defense in the Transformer Secure Inference
Zhengyi Li | Yakai Wang | Jingwen Leng | Kang Yang | Yu Yu | Jiaping Gui | Yu Feng | Ning Liu | Minyi Guo
Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)
Zhengyi Li | Yakai Wang | Jingwen Leng | Kang Yang | Yu Yu | Jiaping Gui | Yu Feng | Ning Liu | Minyi Guo
Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)
For Transformer models, cryptographically secure inference ensures that the client learns only the final output, while the server learns nothing about the client’s input. However, securely computing nonlinear layers remains a major efficiency bottleneck due to the substantial communication rounds and data transmission required. To address this issue, prior works reveal intermediate activations to the client, allowing nonlinear operations to be computed in plaintext. Although this approach significantly improves efficiency, exposing activations enables adversaries to extract model weights. To mitigate this risk, existing works employ a shuffling defense that reveals only randomly permuted activations to the client. In this work, we show that the shuffling defense is not as robust as previously claimed. We propose an attack that aligns differently shuffled activations to a common permutation and subsequently exploits them to extract model weights. Experiments on Pythia-70m and GPT-2 demonstrate that the proposed attack can align shuffled activations with mean squared errors ranging from 10-9 to 10-6. With a query cost of approximately $1, the adversary can recover model weights with L1-norm differences ranging from 10-4 to 10-2 compared to the oracle weights.
2025
Gumbel Reranking: Differentiable End-to-End Reranker Optimization
Siyuan Huang | Zhiyuan Ma | Jintao Du | Changhua Meng | Weiqiang Wang | Jingwen Leng | Minyi Guo | Zhouhan Lin
Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)
Siyuan Huang | Zhiyuan Ma | Jintao Du | Changhua Meng | Weiqiang Wang | Jingwen Leng | Minyi Guo | Zhouhan Lin
Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)
RAG systems rely on rerankers to identify relevant documents. However, fine-tuning these models remains challenging due to the scarcity of annotated query-document pairs. Existing distillation-based approaches suffer from training-inference misalignment and fail to capture interdependencies among candidate documents. To overcome these limitations, we reframe the reranking process as an attention-mask problem and propose Gumbel Reranking, an end-to-end training framework for rerankers aimed at minimizing the training-inference gap. In our approach, reranker optimization is reformulated as learning a stochastic, document-wise Top-k attention mask using the Gumbel Trick and Relaxed Top-k Sampling. This formulation enables end-to-end optimization by minimizing the overall language loss. Experiments across various settings consistently demonstrate performance gains, including a 10.4% improvement in recall on HotpotQA for distinguishing indirectly relevant documents.
2023
Fourier Transformer: Fast Long Range Modeling by Removing Sequence Redundancy with FFT Operator
Ziwei He | Meng Yang | Minwei Feng | Jingcheng Yin | Xinbing Wang | Jingwen Leng | Zhouhan Lin
Findings of the Association for Computational Linguistics: ACL 2023
Ziwei He | Meng Yang | Minwei Feng | Jingcheng Yin | Xinbing Wang | Jingwen Leng | Zhouhan Lin
Findings of the Association for Computational Linguistics: ACL 2023
The transformer model is known to be computationally demanding, and prohibitively costly for long sequences, as the self-attention module uses a quadratic time and space complexity with respect to sequence length. Many researchers have focused on designing new forms of self-attention or introducing new parameters to overcome this limitation, however a large portion of them prohibits the model to inherit weights from large pretrained models. In this work, the transformer’s inefficiency has been taken care of from another perspective. We propose Fourier Transformer, a simple yet effective approach by progressively removing redundancies in hidden sequence using the ready-made Fast Fourier Transform (FFT) operator to perform Discrete Cosine Transformation (DCT). Fourier Transformer is able to significantly reduce computational costs while retain the ability to inherit from various large pretrained models. Experiments show that our model achieves state-of-the-art performances among all transformer-based models on the long-range modeling benchmark LRA with significant improvement in both speed and space. For generative seq-to-seq tasks including CNN/DailyMail and ELI5, by inheriting the BART weights our model outperforms the standard BART and other efficient models. Our code will be publicly available at https://github.com/LUMIA-Group/FourierTransformer
2022
Transkimmer: Transformer Learns to Layer-wise Skim
Yue Guan | Zhengyi Li | Jingwen Leng | Zhouhan Lin | Minyi Guo
Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)
Yue Guan | Zhengyi Li | Jingwen Leng | Zhouhan Lin | Minyi Guo
Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)
Transformer architecture has become the de-facto model for many machine learning tasks from natural language processing and computer vision. As such, improving its computational efficiency becomes paramount. One of the major computational inefficiency of Transformer based models is that they spend the identical amount of computation throughout all layers. Prior works have proposed to augment the Transformer model with the capability of skimming tokens to improve its computational efficiency. However, they suffer from not having effectual and end-to-end optimization of the discrete skimming predictor. To address the above limitations, we propose the Transkimmer architecture, which learns to identify hidden state tokens that are not required by each layer. The skimmed tokens are then forwarded directly to the final output, thus reducing the computation of the successive layers. The key idea in Transkimmer is to add a parameterized predictor before each layer that learns to make the skimming decision. We also propose to adopt reparameterization trick and add skim loss for the end-to-end training of Transkimmer. Transkimmer achieves 10.97x average speedup on GLUE benchmark compared with vanilla BERT-base baseline with less than 1% accuracy degradation.
2020
How Far Does BERT Look At: Distance-based Clustering and Analysis of BERT’s Attention
Yue Guan | Jingwen Leng | Chao Li | Quan Chen | Minyi Guo
Proceedings of the 28th International Conference on Computational Linguistics
Yue Guan | Jingwen Leng | Chao Li | Quan Chen | Minyi Guo
Proceedings of the 28th International Conference on Computational Linguistics
Recent research on the multi-head attention mechanism, especially that in pre-trained models such as BERT, has shown us heuristics and clues in analyzing various aspects of the mechanism. As most of the research focus on probing tasks or hidden states, previous works have found some primitive patterns of attention head behavior by heuristic analytical methods, but a more systematic analysis specific on the attention patterns still remains primitive. In this work, we clearly cluster the attention heatmaps into significantly different patterns through unsupervised clustering on top of a set of proposed features, which corroborates with previous observations. We further study their corresponding functions through analytical study. In addition, our proposed features can be used to explain and calibrate different attention heads in Transformer models.
Search
Fix author
Co-authors
- Minyi Guo 5
- Zhouhan Lin 4
- Yue Guan 2
- Ziwei He 2
- Zhengyi Li 2
- Quan Chen 1
- Jin Song Dong 1
- Jintao Du 1
- Minwei Feng 1
- Yu Feng 1
- Jiaping Gui 1
- Siyuan Huang 1
- Bo Jiang 1
- Jushi Kai 1
- Chao Li 1
- Yun Lin 1
- Ning Liu 1
- Zihan Liu 1
- Liming Lu 1
- Xing Ma 1
- Zhiyuan Ma 1
- Changhua Meng 1
- Kaixi Qiu 1
- Shixuan Sun 1
- Wu Sun 1
- Huanyu Wang 1
- Jingzhi Wang 1
- Weiqiang Wang (王维强) 1
- Xinbing Wang 1
- Yakai Wang 1
- Kang Yang 1
- Meng Yang 1
- Jingcheng Yin 1
- Yu Yu 1
- Haoyan Zhang 1
- Jiayu Zhou 1
- Yangjie Zhou 1