Papers
Topics
Authors
Recent
Search
2000 character limit reached

Lookup-Table Precomputation

Updated 7 July 2026
  • Lookup-table precomputation is the offline generation of structured tables that replace repeated complex calculations with simple indexed retrievals.
  • It employs decomposition, quantization, and interpolation techniques to manage high-dimensional inputs and large state spaces across diverse applications.
  • This methodology optimizes performance by reducing runtime arithmetic overhead, making it valuable in areas from neural inference to quantum error correction.

Lookup-table precomputation is the offline construction of indexed representations of a target computation so that online execution is reduced to table reads, simple arithmetic, interpolation, pooling, or cache retrieval rather than full recomputation. Across the literature, this pattern appears in point-cloud feature extraction, text-to-SQL KV caching, undersampled PSF centroiding, low-bit neural inference, algebraic transforms, reciprocal-square-root hardware, quantum error correction, and image enhancement. The central motivation is consistent: direct lookup is ordinarily blocked by high-dimensional inputs or large state spaces, so practical systems first factorize the original computation into low-arity functions, quantized blocks, or structured units that can be precomputed and indexed efficiently (Lin et al., 2019, Su et al., 13 Jan 2026, Ganji et al., 2023).

1. Formal models of lookup-table precomputation

A recurring formulation is to replace repeated evaluation of a function ff by storing its values on a discrete domain and recovering outputs by direct indexing. In JustLookup, a PointNet-style set function is reduced to a family of $3$-variable functions gs(x,y,z)g_s(x,y,z), and the offline table is defined as

T[i,j,k,s]=gs(xi,xj,xk),T[i,j,k,s] = g_s(x_i,x_j,x_k),

with the continuous domain V=[1,1]3V=[-1,1]^3 subdivided into S3S^3 voxels and each scalar output quantized into LL bits. The resulting memory footprint is

M=mS3Lbits,M = m\,S^3\,L \quad \text{bits},

which makes the precompute cost explicit and shifts online complexity to indexed retrieval and max-pooling (Lin et al., 2019).

A second formulation enumerates the finite product space induced by quantization. DeepGEMM precomputes all products of quantized weights and activations in a 2Bw×2Ba2^{B_w}\times 2^{B_a} table, with total entries 2Bw+Ba2^{B_w+B_a}. For $3$0-bit weights and $3$1-bit activations, the table has $3$2 entries; for grouped lookup, LUT-65k uses $3$3 entries. In both cases, the online scalar multiplication $3$4 is replaced by a table lookup indexed by $3$5 (Ganji et al., 2023).

A third formulation precomputes structured state rather than numeric function values. TableCache partitions schema prompts into table-specific blocks, computes key/value pairs $3$6 for each token in a table block offline, and preserves cross-table attention by building the primary–foreign key graph, topologically sorting it, and encoding tables jointly within each connected component. The lookup object is not a scalar-valued function but a reusable KV block identified by a Trie and loaded into the inference engine on demand (Su et al., 13 Jan 2026).

These formulations show that lookup-table precomputation is not a single technique but a family of offline-online transformations. A plausible implication is that the decisive design question is not whether a task admits lookup at all, but whether its computation can be recast into a precomputable domain whose cardinality is acceptable.

2. Decomposition as the enabling step

The dominant obstacle to lookup methods is the combinatorial growth of the table domain. The literature therefore relies on decomposition before precomputation.

JustLookup is explicit on this point. Although PointNet is a high-dimensional set-function, its shared MLP realizes scalar functions $3$7, so the full network reduces to a family of $3$8-variable functions $3$9 followed by channelwise max-pooling. This decomposition is what makes tabulation feasible at all (Lin et al., 2019).

Divide-and-conquer is the corresponding strategy in arithmetic hardware. LUT-NA writes a product as

gs(x,y,z)g_s(x,y,z)0

where the activation is partitioned into gs(x,y,z)g_s(x,y,z)1 gs(x,y,z)g_s(x,y,z)2-bit blocks. The same principle appears in LUNA-CIM, where gs(x,y,z)g_s(x,y,z)3 and gs(x,y,z)g_s(x,y,z)4, and only the two gs(x,y,z)g_s(x,y,z)5-bit partial multiplications gs(x,y,z)g_s(x,y,z)6 and gs(x,y,z)g_s(x,y,z)7 are precomputed; the final result is formed by shift-and-add recombination (Sen et al., 2024, Dehghanzadeh et al., 2023).

Segment-wise enumeration serves the same role in matrix multiplication and low-bit inference. BiQGEMM partitions each weight row into gs(x,y,z)g_s(x,y,z)8 segments of length gs(x,y,z)g_s(x,y,z)9, precomputes all T[i,j,k,s]=gs(xi,xj,xk),T[i,j,k,s] = g_s(x_i,x_j,x_k),0 inner products between a length-T[i,j,k,s]=gs(xi,xj,xk),T[i,j,k,s] = g_s(x_i,x_j,x_k),1 activation slice and all T[i,j,k,s]=gs(xi,xj,xk),T[i,j,k,s] = g_s(x_i,x_j,x_k),2-bit patterns, and replaces T[i,j,k,s]=gs(xi,xj,xk),T[i,j,k,s] = g_s(x_i,x_j,x_k),3 MACs by one lookup and one add. PALUTE likewise chooses T[i,j,k,s]=gs(xi,xj,xk),T[i,j,k,s] = g_s(x_i,x_j,x_k),4 so that each segment contains exactly two T[i,j,k,s]=gs(xi,xj,xk),T[i,j,k,s] = g_s(x_i,x_j,x_k),5-bit weights and two T[i,j,k,s]=gs(xi,xj,xk),T[i,j,k,s] = g_s(x_i,x_j,x_k),6-bit activations; the table therefore contains T[i,j,k,s]=gs(xi,xj,xk),T[i,j,k,s] = g_s(x_i,x_j,x_k),7 weight-segment combinations, reduced by sign symmetry to a half-table of T[i,j,k,s]=gs(xi,xj,xk),T[i,j,k,s] = g_s(x_i,x_j,x_k),8 entries (Jeon et al., 2020, Tian et al., 8 Jun 2026).

Decomposition can also be structural rather than arithmetic. ReducedLUT partitions the input bits into T[i,j,k,s]=gs(xi,xj,xk),T[i,j,k,s] = g_s(x_i,x_j,x_k),9, forms V=[1,1]3V=[-1,1]^30 sub-tables of length V=[1,1]3V=[-1,1]^31, and then exploits self-similarity under right shifts, later enlarging the compression space by injecting “don’t care” conditions on unobserved inputs (Cassidy et al., 2024).

This body of work directly contradicts the common assumption that lookup tables are inherently limited to trivial scalar functions. The cited systems succeed only after reformulating the original computation into smaller blocks, segments, or structured components.

3. Offline construction and indexing mechanisms

Once a decomposition has been chosen, the quality of the offline construction determines both memory cost and online latency.

In continuous-domain tabulation, discretization and quantization are central. JustLookup fixes V=[1,1]3V=[-1,1]^32, divides it into V=[1,1]3V=[-1,1]^33 equal voxels of width V=[1,1]3V=[-1,1]^34, stores V=[1,1]3V=[-1,1]^35, and quantizes each real scalar V=[1,1]3V=[-1,1]^36 into an V=[1,1]3V=[-1,1]^37-bit integer

V=[1,1]3V=[-1,1]^38

At inference, a point V=[1,1]3V=[-1,1]^39 is mapped to indices S3S^30 by floor division, the stored value is dequantized, and the feature extractor is reduced to array indexing plus simple arithmetic (Lin et al., 2019).

In cache precomputation for LLM systems, the construction problem is relational. TableCache first builds the primary–foreign key graph, topologically sorts it, and encodes tables jointly within each connected component so that when computing K/V for table S3S^31, the model has already attended to table S3S^32’s tokens if S3S^33. Offline, positional encoding is omitted and raw K/V is stored; online, absolute positional embeddings are re-applied at the global offset. Retrieval uses a shared character-/token-level Trie whose leaves store S3S^34. The build time is S3S^35, query is amortized S3S^36, and space is S3S^37 (Su et al., 13 Jan 2026).

In scientific imaging, the construction target is a database of simulated observations. For undersampled PSFs, a uniform grid of subpixel centroid shifts S3S^38 is defined over one pixel, a detector image S3S^39 is generated for each offset by integrating the shifted model over each pixel, and the simulated image is stored as the key with the true offset as the value. Online retrieval minimizes the sum-of-squares residual

LL0

optionally followed by a local quadratic refinement (Ludwick et al., 2024).

For segment tables, precompute speed itself becomes important. BiQGEMM therefore gives a dynamic-programming routine that builds a length-LL1 lookup table in LL2 rather than LL3 by reusing partial sums and sign symmetry (Jeon et al., 2020).

These cases illustrate a general principle: lookup-table precomputation is inseparable from the indexing scheme. Voxel grids, Tries, bit-packed indices, and simulated residual dictionaries are not implementation details; they are the mechanism that turns an offline artifact into an online primitive.

4. Online execution modes and reported performance

At runtime, the precomputed object may replace an MLP front end, a decoder prefill, a product kernel, a dequantization path, or a nonlinear operator. The online kernels therefore vary, but they share the same reduction of arithmetic to retrieval and accumulation.

System Online operation Reported result
JustLookup Array lookup + max-pool + small MLP head 1.5 ms on an Intel i7-8700 CPU (single core mode), 32x over PointNet (Lin et al., 2019)
TableCache Trie lookup + GPU cache + reranking/pipelining Up to a 3.62x speedup in Time to First Token with negligible performance degradation (Su et al., 13 Jan 2026)
DeepGEMM SIMD shuffle-based product lookup Up to 1.74x on x86 platforms over QNNPACK 8-bit kernels (Ganji et al., 2023)
T-MAN Fused two-level table-based dequantization 1.4x and 3.1x speedup for prefill and decoding respectively, and 84% energy savings (Wei et al., 14 Nov 2025)
PALUTE In-DRAM LUT query on M3D DRAM 1,264 TPS end-to-end throughput at 0.16 W (Tian et al., 8 Jun 2026)

In JustLookup, the LL4 ms total is further resolved into LL5 ms for the pure lookup + max-pool over LL6 points LL7 channels and LL8 ms for the small MLP head. In TableCache, latency reduction depends not only on offline KV blocks but also on query reranking, which minimizes table-set switches, and a computation-loading pipeline that overlaps model inference with CPULL9GPU KV transfer. In T-MAN, the online path is still a pipeline—DMA, LUT-based dequant, and HMX GEMM—but dequantization and integerM=mS3Lbits,M = m\,S^3\,L \quad \text{bits},0FP16 conversion have been subsumed into precomputed tables (Lin et al., 2019, Su et al., 13 Jan 2026, Wei et al., 14 Nov 2025).

TeLLMe shows the same online-offline pattern in an FPGA setting. It preloads the ternary weight index matrix into URAM, rebuilds M=mS3Lbits,M = m\,S^3\,L \quad \text{bits},1 parallel tables for each incoming activation group, and then performs M=mS3Lbits,M = m\,S^3\,L \quad \text{bits},2 simultaneous lookups per table. Under a M=mS3Lbits,M = m\,S^3\,L \quad \text{bits},3 W power budget, the reported end-to-end results are up to M=mS3Lbits,M = m\,S^3\,L \quad \text{bits},4 tokens/s decoding throughput and M=mS3Lbits,M = m\,S^3\,L \quad \text{bits},5--M=mS3Lbits,M = m\,S^3\,L \quad \text{bits},6 s time-to-first-token for M=mS3Lbits,M = m\,S^3\,L \quad \text{bits},7--M=mS3Lbits,M = m\,S^3\,L \quad \text{bits},8 token prompts (Qiao et al., 3 Oct 2025).

A recurring misconception is that lookup-table precomputation removes online work entirely. The literature shows instead that it replaces expensive arithmetic with a different online mix: indexing, reductions, interpolation, sign handling, cache management, or a small residual head.

5. Memory, compression, and accuracy trade-offs

The principal cost of lookup-table precomputation is memory, and much of the literature is devoted to controlling that cost without unacceptable error.

JustLookup makes the trade-off explicit. Increasing M=mS3Lbits,M = m\,S^3\,L \quad \text{bits},9 reduces quantization and voxelization error but costs 2Bw×2Ba2^{B_w}\times 2^{B_a}0 memory. With 2Bw×2Ba2^{B_w}\times 2^{B_a}1 output channels and 2Bw×2Ba2^{B_w}\times 2^{B_a}2 bits, the reported ModelNet40 table is: 2Bw×2Ba2^{B_w}\times 2^{B_a}3, 2Bw×2Ba2^{B_w}\times 2^{B_a}4 MB, 2Bw×2Ba2^{B_w}\times 2^{B_a}5; 2Bw×2Ba2^{B_w}\times 2^{B_a}6, 2Bw×2Ba2^{B_w}\times 2^{B_a}7 MB, 2Bw×2Ba2^{B_w}\times 2^{B_a}8; 2Bw×2Ba2^{B_w}\times 2^{B_a}9, 2Bw+Ba2^{B_w+B_a}0 MB, 2Bw+Ba2^{B_w+B_a}1; 2Bw+Ba2^{B_w+B_a}2, 2Bw+Ba2^{B_w+B_a}3 MB, 2Bw+Ba2^{B_w+B_a}4. The baseline PointNet overall accuracy is 2Bw+Ba2^{B_w+B_a}5, and after a brief head-only fine-tuning the accuracy gap vanishes even for 2Bw+Ba2^{B_w+B_a}6 (Lin et al., 2019).

DeepGEMM illustrates the same exponential table-growth law at smaller scales. LUT-16 adds only 2Bw+Ba2^{B_w+B_a}7 B per kernel in registers, while LUT-65k uses 2Bw+Ba2^{B_w+B_a}8 KiB of L2 cache. The paper states that beyond 2Bw+Ba2^{B_w+B_a}9–$3$00 bits the table grows exponentially, and LUT lookup latency + register pressure begin to offset gains; traditional INT8/FP32 may then win (Ganji et al., 2023).

T-MAN addresses table growth by using a shared Level-1 bit-repack LUT and a block-specific Level-2 quant$3$01FP16 LUT. For INT4 with $3$02, the cited sizes are $3$03 B for LUT1 and $3$04 B for LUT2 per block, with total tables “approximately hundreds of KB” on a $3$05 B-parameter model, all fitting in the $3$06 MB TCM. The paper also states that, since dequant is mathematically exact given FP16 scale $3$07, there is zero additional quantization error beyond the original $3$08-bit quantization (Wei et al., 14 Nov 2025).

Compression can be more structural than arithmetic. ReducedLUT injects “don’t care” conditions by marking unobserved inputs $3$09 and reassigning them to maximize self-similarity under decomposition. The reported result is up to $3$10 reduction in Physical LUT utilization, with a test accuracy drop of no more than $3$11 accuracy points (Cassidy et al., 2024).

Image-enhancement LUTs show another route to compactness. A spatial-aware $3$12D LUT of size $3$13 is decomposed into three $3$14D LUTs plus a bias,

$3$15

and then each $3$16D table is approximated by truncated SVD with $3$17. The cited parameter count falls from $3$18 K for SABLUT to $3$19 K, and the $3$20K runtime falls from $3$21 ms to $3$22 ms while maintaining the reported image-quality metrics (Kim et al., 22 Aug 2025).

Not all lookup-table methods are approximative in the same sense. LUTI-MLP states that the same interpolation formula is used at train and test time and therefore “no further approximation is introduced.” By contrast, PSF centroiding deliberately accepts a discretization bias controlled by the LUT step $3$23, and LUT-NN accepts centroid approximation in exchange for reductions in FLOPs, model size, latency, memory, and power (Sekikawa et al., 2019, Ludwick et al., 2024, Tang et al., 2023).

6. Applications, limitations, and recurring misconceptions

Lookup-table precomputation spans an unusually wide range of computational regimes. In reciprocal-square-root hardware, the table is an initializer for convergence methods such as Newton–Raphson, and the design problem is to reduce ROM width and depth while preserving convergence speed and exactitude. The cited techniques include trimming constant or regular bits, linear interpolation in auxiliary or main tables, and content trimming, with composite reductions that cut ROM area substantially while maintaining a one-ULP final accuracy target in two Newton–Raphson iterations or fewer (Samavi et al., 2017).

In algebraic complexity, lookup tables are used to collapse layers of recursion. Over constant-sized finite fields, precomputing $3$24 for all $3$25 yields a Walsh–Hadamard transform in $3$26 bit operations, and precomputing all products of $3$27 matrices converts any algebraic $3$28 matrix multiplication algorithm into $3$29 bit operations (Alman, 2022).

In quantum error correction, lookup-table precomputation becomes a distance-preserving decoder construction. The compact lookup-table construction, Meet-in-the-Middle technique, adaptive time decoding, classical processing for flag information, and separated $3$30 and $3$31 counting were evaluated on hexagonal color codes of distances $3$32, and the paper reports that combining all tools increases the pseudothreshold for distance $3$33 from $3$34 to $3$35 (Pato et al., 2023).

The limitations are equally consistent across domains. Table sizes often grow as $3$36, $3$37, $3$38, $3$39, or $3$40, depending on whether the discretization is geometric, bitwise, combinatorial, or high-dimensional. The papers therefore repeatedly introduce decomposition, interpolation, symmetry, quantization, hierarchical tiling, or structured-unit assumptions. TableCache is explicit that extension beyond Text-to-SQL requires well-structured “lookup units” and explicit inter-unit relations. LUTI-MLP is explicit that direct “table-only” training yields sparse gradients on fine grids and poor generalization. DeepGEMM is explicit that beyond $3$41–$3$42 bits the exponential table growth can erase the benefit of lookup (Su et al., 13 Jan 2026, Sekikawa et al., 2019, Ganji et al., 2023).

A final misconception is that lookup tables are merely a memory-for-speed heuristic. The surveyed work suggests a stronger characterization: lookup-table precomputation is a design methodology in which the target computation is first re-expressed so that repeated online work lies in a finite, reusable state space. Whether the stored object is a voxelized feature map, a KV cache block, a ternary partial-sum table, a compact syndrome decoder, or a decomposed image-enhancement LUT, the same principle governs the system: offline enumeration of a structured subproblem, followed by online recovery by indexed reuse.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (17)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Lookup-Table Precomputation.