用于量子增强扩散语言模型的电路超网络

·

研究论文 · 2026/09/23

语言模型可以通过改变应用于单个词元的计算来适配。量子电路提供了一种这样的方法,但在大型模型内部评估更宽的电路可能在计算上要求很高。在这里,我们介绍了 HyperQ,它向冻结的掩码扩散语言模型添加了以词元为条件的量子残差分支。量子残差分支是每个 transformer 块中的一个模块,它读取词元的隐藏状态,发出该词元电路的坐标,执行它,并通过残差连接将测量值加回。主干保持冻结,仅训练添加的分支。在每个分支内,一个轻量级电路超网络在共享稀疏电路结构中发出词元特定的旋转角度、耦合强度和测量轴。所需的期望值具有精确的经典表达式,其评估成本随量子比特数线性增长,使得在 11 亿参数的主干内可以训练 16 到 64 量子比特的电路。在下游基准测试中,增加电路宽度将平均得分从 47.65 提高到 54.30。在 64 量子比特时,HyperQ 分别超过主干及其低秩适配对应物 4.71 和 3.67 分。HyperQ 在 20,000 个提示-响应对上进行微调,而经典基线为 200,000 个。这些发现支持以词元为条件的电路发射作为一种可行的架构方法,用于量子增强的语言建模。

该工作提出了一种可训练的量子增强语言模型架构,在保持主干冻结的情况下,通过轻量级超网络生成词元特定的量子电路,并以线性成本精确评估期望值,从而在有限计算资源下实现 64 量子比特电路的训练,并在下游任务上取得显著提升,为量子增强语言建模提供了可行路径。

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.

阅读原文

参与讨论