Leuvenshtein: Efficient FHE-based Edit Distance Computation with Single Bootstrap per Cell
本文提出了一种基于TFHE的编辑距离计算方法,通过优化算法结构和实现细节,显著降低了计算成本,提高了计算效率。
更新于 2025-08-21。作者:Wouter Legiest、Jan-Pieter D'Anvers、Bojan Spasic、Nam-Luc Tran、Ingrid Verbauwhede。
中文摘要
本文提出了一种在完全同态加密(FHE)框架内计算Levenshtein(编辑)距离的新方法,特别针对第三代方案,如TFHE。编辑距离计算在金融和基因组学等应用中至关重要,例如DNA序列对齐。我们介绍了一种优化的算法,称为Leuvenshtein,显著降低了编辑距离计算的成本。该算法专门减少了每个计算单元所需的可编程引导(PBS)数量,将数量从大约94次操作(由传统的Wagner-Fisher算法所需)降低到仅仅1次。此外,我们还提出了一种高效的方法来执行字符的等值检查,将ASCII字符比较减少到仅2次PBS操作。最后,我们探讨了通过在输入字符串之一未加密的情况下利用预处理来进一步提高性能的潜力。我们的Leuvenshtein算法相较于最好的TFHE实现快278倍,比优化的Wagner-Fisher算法实现快39倍。此外,当由于服务器端存在未加密的输入而可以进行离线预处理时,还可以实现额外的3倍速度提升。
英文摘要
This paper presents a novel approach to calculating the Levenshtein (edit) distance within the framework of Fully Homomorphic Encryption (FHE), specifically targeting third-generation schemes like TFHE. Edit distance computations are essential in applications across finance and genomics, such as DNA sequence alignment. We introduce an optimised algorithm that significantly reduces the cost of edit distance calculations called Leuvenshtein. This algorithm specifically reduces the number of programmable bootstraps (PBS) needed per cell of the calculation, lowering it from approximately 94 operations -- required by the conventional Wagner-Fisher algorithm -- to just 1. Additionally, we propose an efficient method for performing equality checks on characters, reducing ASCII character comparisons to only 2 PBS operations. Finally, we explore the potential for further performance improvements by utilising preprocessing when one of the input strings is unencrypted. Our Leuvenshtein achieves up to 278times faster performance compared to the best available TFHE implementation and up to 39times faster than an optimised implementation of the Wagner-Fisher algorithm. Moreover, when offline preprocessing is possible due to the presence of one unencrypted input on the server side, an additional 3times speedup can be achieved.
解读
一句话总结
本文提出了一种基于TFHE的编辑距离计算方法,通过优化算法结构和实现细节,显著降低了计算成本,提高了计算效率。
问题1:这篇论文想要解决什么具体问题?
- 问题背景:编辑距离计算在金融和基因组学等领域中至关重要,例如DNA序列比对。
- 现有方案不足:传统的Wagner-Fisher算法在FHE框架下计算成本高,效率低。
- 研究目标:开发一种高效的编辑距离计算算法,以降低计算成本并提高效率。
问题2:论文的核心创新点是什么?
- 技术创新:提出了一种新的算法,称为Leuvenshtein,优化了计算过程,包括使用小多值操作符、重用可编程引导和单一查找中的非线性计算。
- 方法改进:改进了等式检查实现,使用更少的可编程引导,并提出了预处理阶段来进一步减少计算成本。
- 优势:Leuvenshtein算法相比传统方法减少了94倍的PBS操作,提高了计算效率。
问题3:实验结果如何验证了方法的有效性?
- 关键实验:通过与Wagner-Fisher和Myers算法的实验比较,验证了Leuvenshtein算法的性能。
- 性能提升:Leuvenshtein算法相比最佳TFHE实现快278倍,比优化后的Wagner-Fisher算法快39倍。
- 对比结果:Leuvenshtein算法在ASCII输入上的实现相比最佳实现快278倍,比优化后的Wagner-Fisher实现快39倍。
问题4:这个研究的实际应用价值是什么?
- 应用场景:金融和基因组学等领域中的字符串相似度计算。
- 实施建议:采用Leuvenshtein算法进行编辑距离计算,以提高效率和安全性。
- 局限与展望:未来可以进一步探索并行化实现和优化算法以适应更大规模的数据。