Convolution for Large Language Models

· Source: Computation and Language · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Natural Language Processing · Depth: Expert, quick

Summary

A study investigates integrating lightweight depthwise convolutions into large language models (LLMs) to provide local inductive bias, complementing Transformer self-attention. Macro-level ablation across 17 locations in a Qwen3 Transformer block found optimal results when convolution was applied to projected queries, keys, and values before attention. A subsequent micro-level analysis favored a residual depthwise convolution with a kernel size of 3, without additional normalization or activation. This design consistently improved average accuracy on seven downstream benchmarks across Qwen3 models and various pre-training data budgets, adding less than 0.01% parameters. Representation-level analysis indicated the convolution makes repeated token IDs more sensitive to their immediate context.

Key takeaway

For machine learning engineers optimizing large language models, you should consider integrating lightweight depthwise convolutions. Applying a residual depthwise convolution with a kernel size of 3 to projected queries, keys, and values before self-attention can improve average accuracy on downstream benchmarks. This architectural modification adds less than 0.01% parameters, offering a highly efficient way to enhance local context modeling and token sensitivity in your LLM deployments.

Key insights

Depthwise convolutions enhance LLM locality with minimal parameters, improving context sensitivity.

Principles

Method

Ablation study compared 17 convolution locations in a Qwen3 Transformer block, favoring application to projected queries, keys, and values before attention, using residual depthwise convolution with kernel size k=3.

In practice

Topics

Best for: Research Scientist, AI Engineer, AI Scientist, Machine Learning Engineer, NLP Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Computation and Language.