Manuscript Offprint

arXiv:2609.09254

DiffLUT-Net: Differentiable Training of FPGA LUT Networks with Learnable Connectivity

Jiaqi Ye, Xinrui Gong, Jingcun Wang, Olga Kondrateva, Bing Li, Grace Li Zhang

Jiaqi Ye

TU Darmstadt

jiaqi.ye@stud.tu-darmstadt.de

Olga Kondrateva

TU Darmstadt

olga.kondrateva@kom.tu-darmstadt.de

Xinrui Gong

TU Darmstadt

xinrui.gong@tu-darmstadt.de

Jingcun Wang

TU Darmstadt

jingcun.wang@tu-darmstadt.de

Bing Li

TU Ilmenau

bing.li@tu-ilmenau.de

Grace Li Zhang

TU Darmstadt

grace.zhang@tu-darmstadt.de

Abstract

Field-programmable gate arrays (FPGAs) enable efficient neural-network inference, but most deployment flows either accelerate multiply-accumulate operations or convert pretrained quantized models into lookup tables (LUTs). We present DiffLUT-Net, an FPGA-native network connected by six-input LUTs that are trained from scratch. We jointly learn the 64 truth-table entries of a LUT and the source to each of its six input ports using a differentiable LUT function relaxation and hardware source selection. After training, the truth tables and connections are discretized, unused logic can be pruned, and the network is exported directly as synthesizable Verilog. Across five benchmarks, DiffLUT-Net achieves favorable accuracy-resource trade-offs. A compact JSC CERNBox model reaches 72.5% accuracy using 94 LUTs with 1.21 ns latency. On MNIST, a compact configuration reaches 98.0% accuracy while using 41% fewer LUTs than NeuraLUT-Assemble. On Fashion-MNIST, it matches DWN while using 52% fewer LUTs; on CIFAR-10, it improves DWN accuracy by 2.08% while using 16% fewer LUTs. These results demonstrate the effectiveness of jointly learning LUT functions and sparse connectivity for compact FPGA-native inference. The code is available at https://github.com/TUDa-HWAI/DiffLUT-Network.

Keywords: FPGA-native neural networks, differentiable LUT networks, learnable sparse connectivity, hardware-aware machine learning, low-latency inference

1 Introduction

Field-programmable gate arrays (FPGAs) are well suited to applications that require low and predictable inference latency. Their configurable logic, distributed memory, fine-grained parallelism, and customizable datapaths allow a trained model to be implemented as a deeply parallel hardware circuit. However, the efficiency of that circuit depends not only on model size or numerical precision, but also on how closely the trainable representation matches the primitives available in the FPGA fabric. In many existing design flows, model training and hardware realization remain separate: a network is first optimized using conventional multiply-accumulate (MAC) operations and is only later quantized, compiled, or mapped into FPGA resources. This separation creates a gap between the learned model and the logic that performs inference.

State-of-the-art research attempts to narrow this gap from two perspectives. First, truth-table-based methods convert trained quantized neurons or subnetworks into truth tables, which are implemented with LUTs. LogicNets, PolyLUT, NeuraLUT, and their extensions constrain the precision and fan-in of a neuron or compact subnetwork so that its input–output combinations can be enumerated after training and synthesized into FPGA LUTs [1–3, 13, 15, 18, 30, 34]. This strategy can absorb multiplication, accumulation, batch normalization, and non-linear activation into a truth table and thus LUTs. Its scalability is nevertheless limited by the exponential growth of a truth table with the number of input and output bits.

Second, state-of-the-art research also defines the model directly as a network of Boolean gates or LUTs and trains these hardware-oriented functions from scratch. Differentiable logic gate networks use continuous relaxations to train small Boolean gates [23], while subsequent methods improve their parameterization, connectivity, architectural organization, and hardware realization [6, 11, 20, 27]. Differentiable Weightless Neural Networks extend direct learning to multi-input LUTs and introduce learnable input mappings and output reductions [5]. These studies show that logic functions can serve as trainable computational primitives rather than merely as post-training implementation targets.

The methodologies above are effective in many scenarios. However, they leave an important question unresolved: how can the Boolean functions and physical connectivity of an FPGA-native LUT network be optimized together while maintaining a direct path from training to hardware implementation? A physical LUT6 is defined by both its 64-entry truth table and the six signals connected to its inputs, and these choices are closely coupled. We therefore propose DiffLUT-Net, which jointly learns all truth-table entries and selects one source for each LUT input port. A differentiable relaxation enables function learning, while hard selection preserves FPGA-valid wiring. After training, the truth tables are binarized, the connections are fixed, unused logic can be pruned, and the resulting deterministic network is exported directly as synthesizable Verilog.

The main contributions of this work are:

• A LUT6-native differentiable model. We formulate the complete truth table of each six-input FPGA LUT as a closed-form multilinear relaxation. The formulation is exact for binary inputs and exposes all 64 truth-table entries as directly trainable parameters.

• Joint optimization of LUT functions and hardware-valid sparse connectivity. Every LUT input port learns one source signal. After training, the learned scores become deterministic wiring and can expose unused upstream logic for synthesis-time removal.

• A complete training-to-hardware path. DiffLUT-Net integrates distribution-aware binary input encoding, one or more trainable LUT6 layers, grouped output accumulation, truth-table binarization, connection mapping, Verilog generation, and post-placement-and-routing FPGA evaluation.

• A systematic experimental and architectural study. We evaluate DiffLUT-Net on five benchmarks against arithmetic accelerators, post-training truth-table methods, and directly trained logic or LUT networks. DiffLUT-Net demonstrates strong compact and high-accuracy operating points: at comparable accuracy, a compact MNIST configuration uses 41% fewer LUTs than NeuraLUT-Assemble. Relative to DWN, DiffLUT-Net reduces LUT utilization by 52% on Fashion-MNIST and by 16% on CIFAR-10, while closely matching or improving classification accuracy.

The rest of this paper is organized as follows. Section 2 introduces the related work. Section 3 explains the proposed method. Sections 4 and 5 respectively present the experimental results and conclusions.

References (33)