Quantum-enhanced branches improve language model token processing

Circuit Hypernetworks for Quantum-Augmented Diffusion Language Models

Computation and Language

Summary

The paper explores a way to improve language models by adding small quantum computing parts that modify how each word is processed. These quantum parts are trained separately while the main model stays fixed, making it easier to train. By using a special quantum circuit that changes depending on the word, the authors show better performance on language tasks, even with fewer training examples than classical methods. They demonstrate this is possible for large models using up to 64 qubits.

What this means in practice

  • For machine learning engineers: Build larger language models that incorporate quantum circuit modules to improve specific token processing with fewer training examples.
  • For quantum software developers: Develop efficient quantum residual branches within classical transformer blocks to improve hybrid quantum-classical NLP models.

Authors

Xiaoqiang Wang, Mengyang Xiong, Jun Dai, Bang Liu

Abstract

Language models can be adapted by changing the computations applied to individual tokens. Quantum circuits offer one such approach, but evaluating wider circuits inside a large model can be computationally demanding. Here we introduce HyperQ, which adds token-conditioned quantum residual branches to a frozen masked-diffusion language model. A quantum residual branch is a module in each transformer block that reads a token's hidden state, emits the coordinates of that token's circuit, executes it, and adds the measured values back through a residual connection. The backbone remains frozen, and only the added branches are trained. Within each branch, a lightweight circuit hypernetwork emits token-specific rotation angles, coupling strengths, and measurement axes in a shared sparse circuit structure. The required expectation values have an exact classical expression whose evaluation cost grows linearly with the qubit count, enabling circuits from 16 to 64 qubits to be trained within a 1.1-billion-parameter backbone. Across downstream benchmarks, increasing circuit width raises the average score from 47.65 to 54.30. At 64 qubits, HyperQ exceeds the backbone and its low-rank-adapted counterpart by 4.71 and 3.67 points, respectively. HyperQ is fine-tuned on 20,000 prompt-response pairs, compared with 200,000 for the classical baselines. These findings support token-conditioned circuit emission as a tractable architectural approach to quantum-augmented language modelling.