当量化破坏记忆:低精度时序推断中的循环状态回写

·

研究论文 · 2026/09/07

量化常用于降低神经网络推理的计算和内存需求。然而,在循环网络中,量化后的状态会被存储并在下一个时间步返回,因此存储状态的规则会改变后续计算。本文引入“循环状态写回”来指代这一规则,并在用于荧光寿命成像的紧凑GRU编码器-解码器中隔离其影响。固定训练好的模型,将连续状态传播替换为确定性4位状态存储,会使τ1和τ2的估计误差分别增加约70倍和300倍。失败发生在重复的小更新低于写入阈值时,导致存储状态几乎固定而网络继续提出变化。误差反馈、残差记忆和方向记忆能跨时间携带这些被抑制更新的信息,无需重训练即可恢复精度。精度扫描显示,提高状态精度可能恶化固定循环解,而匹配训练表明与状态接口的兼容性可以学习。为测试该行为是否超出GRU,我们在独立训练的LSTM中重复训练后干预,粗写回重现失败,误差反馈恢复精度,状态特定干预显示细胞状态比隐藏状态更敏感。我们的结果确立了循环状态写回是低精度循环动态的关键决定因素,并指出状态存储接口是量化循环推理的核心设计考虑。

该研究首次系统性地揭示了量化循环网络中状态存储规则(写回)对推理精度的关键影响,并提出了无需重训练的恢复方法,为低精度循环推理的设计提供了重要指导,具有理论深度和实际应用价值。

Quantization is widely used to reduce the computational and memory demands of neural-network inference. In recurrent networks, however, the quantized state is stored and returned at the next time step, so the rule used to store that state can alter subsequent computations. Here, we introduce recurrent-state write-back to denote this rule and isolate its effect in a compact GRU encoder--decoder for fluorescence lifetime imaging, a molecular imaging modality used in quantitative biological imaging. A central task is estimating two lifetime parameters, the short-lived component τ1 and the long-lived component τ2, from high-noise time-resolved fluorescence signals. Holding the trained model fixed, replacing continuous state propagation with deterministic 4-bit state storage increases estimation errors for τ1 and τ2 by approximately 70x and 300x, respectively. Failure occurs when repeated small updates remain below the write threshold, leaving the stored state nearly fixed while the network continues to propose change. Error feedback, residual memory, and direction memory carry information from these suppressed updates across time and recover accuracy without retraining. Precision sweeps show that increasing state precision can worsen a fixed recurrent solution, while matched training shows that compatibility with the state interface can be learned. To test whether this behavior extends beyond the GRU, we repeat the post-training intervention in an independently trained LSTM, where coarse write-back reproduces the failure, error feedback restores accuracy, and state-specific interventions reveal greater sensitivity of the cell state than the hidden state. Our results establish recurrent-state write-back as a key determinant of low-precision recurrent dynamics and identify the state-storage interface as a central design consideration for quantized recurrent inference.

阅读原文

参与讨论