Manuscript Offprint
arXiv:2610.19697CAFE: Conducting-Cell-Aware Adaptive Differential Encoding for Robust DNN Inference in FeFET-Based Compute-in-Memory
Wenshuai Yao , Wenyong Zhou , Hanyong Shao , Zhiyuan Ning , Ru Huang , Kechao Tang
School of Integrated Circuits, Peking University, Beijing, China
Department of Electrical and Computer Engineering, The University of Hong Kong, Hong Kong
Beijing Advanced Innovation Center for Integrated Circuits, Beijing, China
: Equal Contribution. *: Corresponding Author. Email: tkch@pku.edu.cn
Abstract—Ferroelectric field-effect transistor (FeFET)-based compute-in-memory (CIM) promises energy-efficient deep neural network (DNN) inference, but device variation can severely degrade bit-sliced CIM accuracy. Prior works either rely on hardware modifications or treat such variation as generic noise, overlooking a key FeFET asymmetry: negligible off-state leakage makes errors dominated by conducting on-state cells. This asymmetry is amplified by two's-complement sign extension, which maps small negative values to high-significance bit slices and magnifies their errors during shift-and-add reconstruction. In this paper, we propose CAFE, a conducting-cell-aware adaptive differential encoding framework built upon this FeFET-specific asymmetry. CAFE introduces , a bit-significance-weighted conducting-cell activity metric that predicts output deviation and inference accuracy degradation under FeFET device variation. Guided by , CAFE applies differential weight and activation encoding to eliminate sign-extension-induced conducting-cell amplification. To balance robustness and cost, CAFE performs type-wise encoding enumeration, layer-wise NSGA-II search, and post-GA pruning to allocate robust encodings where the robustness-cost trade-off is favorable. Across representative vision and language workloads, CAFE reduces by up to ; in the main deployment study, it improves accuracy over two's-complement CIM by more than 87 percentage points and approaches full-differential robustness at normalized cost, compared with for uniform full-differential encoding.
Index Terms—CIM, device variation, differential encoding, adaptive deployment, Transformer, FeFET
I. INTRODUCTION
Deep neural networks (DNNs), especially modern Transformer-based models [1], have become dominant workloads across vision, language, and recommendation tasks. Their inference cost is largely driven by dense matrix-vector and matrix-matrix multiplications, which require frequent data movement between memory and compute units. Compute-in-memory (CIM) addresses this bottleneck by performing multiply-accumulate operations directly inside memory arrays, thereby improving energy efficiency and throughput for DNN inference. Among emerging nonvolatile devices, ferroelectric field-effect transistors (FeFETs) are particularly attractive for CIM because of their CMOS compatibility, nonvolatility, and high on/off ratio [2].
However, FeFET-based CIM inference remains vulnerable to device variation. In bit-sliced CIM, quantized weights and activations are decomposed into bit planes, computed separately in memory arrays, and reconstructed through shift-and-add operations. Small device-level current variations can therefore be magnified by bit significance and propagate into large output deviations. Prior works typically address this problem in two ways: modifying hardware circuits to compensate for variation, or abstracting variation as generic conductance or output noise for noise-aware training. While effective in some settings, these approaches overlook an important device- and representation-dependent error mechanism in FeFET-based CIM.
Our key observation is that FeFET-CIM variation is not uniformly distributed across all stored bits or cells. Due to the extremely high on/off ratio of FeFETs, off-state leakage is negligible, and variation-induced computation error is dominated by conducting on-state cells. This conducting-cell-dominated behavior becomes especially problematic under two's-complement signed representation: small negative weights or activations are numerically small, but sign extension maps them to many high-significance ones, creating variation-sensitive conducting events whose errors are amplified by shift-and-add reconstruction. Fig. 1 summarizes the three observations that motivate CAFE and the corresponding design components: FeFET variation is centered on conducting cells, two's-complement sign extension induces excessive high-significance conducting activity, and layer sensitivity differs across layer types. Together, these observations make signed representation a device-variation problem in bit-sliced FeFET CIM.
Differential encoding has long been used in analog CIM for signed arithmetic. In contrast, bit-sliced CIM commonly relies on two's-complement or offset-style encodings because they align naturally with bit-plane multiplication and shift-and-add reconstruction, whereas differential encoding incurs additional hardware cost. As a result, signed representation choices in bit-sliced CIM are typically evaluated for arithmetic support, representation cost, or numerical error. This view overlooks the FeFET-specific conducting-cell asymmetry: un-

Fig. 1. Overview of CAFE. CAFE exploits the conducting-cell-dominated variation behavior of FeFET-based CIM and mitigates two's-complement sign-extension amplification through conducting-cell-aware adaptive differential encoding. It uses , a bit-significance-weighted conducting-cell activity metric, to guide differential weight and activation encoding and adaptive layer-wise deployment.
der high on/off ratio devices, signed encodings also determine where variation-sensitive conducting activity appears across bit slices.
To address this gap, we propose CAFE, a conducting-cell-aware adaptive differential encoding framework for robust DNN inference in FeFET-based CIM. CAFE treats signed representation not as a fixed arithmetic convention, but as a hardware design variable for FeFET variation robustness. It introduces , a bit-significance-weighted conducting-cell activity metric, to estimate the robustness impact of signed encoding choices. Guided by , CAFE selectively replaces two's-complement weight and activation encodings with differential encodings to suppress sign-extension-induced conducting activity. For deployment, CAFE combines layer-type sensitivity analysis, type-wise encoding enumeration, layer-wise NSGA-II search, and post-GA pruning to balance robustness and hardware cost. This paper makes the following contributions:
-
We identify two's-complement sign extension as a key amplifier of FeFET conducting-cell variation and propose , a bit-significance-weighted conducting-cell activity metric for predicting variation-induced robustness degradation.
-
We propose CAFE, a conducting-cell-aware adaptive differential encoding framework for bit-sliced FeFET CIM, covering differential weight and activation encoding, layer-wise adaptive deployment, and post-GA pruning.
-
We design a sensitivity-guided deployment flow that combines layer-type analysis, type-wise enumeration, and layer-wise NSGA-II search to allocate differential protection under hardware-cost constraints.
-
We validate CAFE across vision and language workloads, showing up to reduction and accuracy gains

Fig. 2. FeFET states, on- and off-current distributions, and cell read behavior.
over two's-complement CIM by more than 87 percentage points, while approaching full-differential robustness at normalized cost.
A. FeFET Device
An FeFET integrates a ferroelectric layer into the MOSFET gate stack, as shown in Fig. 2(b). Program and erase pulses switch polarization and shift the threshold voltage, creating two nonvolatile storage states with distinct threshold voltages. During read, a gate bias between these states produces a large for stored “1” and a small for stored “0” (Fig. 2(a)).
Because and differ by orders of magnitude (Fig. 2(c)), off-state leakage is negligible and variation is dominated by the on-state read current. A cell conducts only when the read gate is high and the device stores “1” (Fig. 2(d)).
B. Bit-Sliced CIM and Signed Encoding
Fig. 3 illustrates the bit-serial-input and bit-parallel-weight CIM flow considered in this work. A quantized dot product is decomposed into activation and weight bit-plane products; activation bits are streamed on word lines, weight bits are

Fig. 3. Bit-sliced CIM flow and considered error sources.
stored across array columns, and each bit pair is accumulated on bit lines.
Combined with the conducting-cell-dominated FeFET behavior above, shift-and-add reconstruction makes robustness depend on where conducting activity appears across bit planes. Signed computation in bit-sliced CIM commonly uses two's-complement, offset-binary, or canonical signed digit (CSD)-based encodings that align naturally with bit-plane reconstruction [3]. Differential encoding has also been used in analog CIM for signed arithmetic [4], [5], but uniform differential deployment in bit-sliced CIM incurs extra storage, array, and peripheral cost. CAFE revisits differential encoding as a robustness mechanism: by decomposing signed values into positive and negative components, it removes sign extension and suppresses high-significance conducting-cell activity under FeFET variation.
C. Robustness and Adaptive Deployment
Prior CIM robustness techniques use hardware compensation, calibration, error correction, or noise-aware training. While useful, they often require specialized hardware support or retraining, still leaving the representation-dependent error structure of bit-sliced FeFET CIM unaddressed. These techniques are largely orthogonal to CAFE, which reshapes signed bit-plane activity before CIM execution. Efficiency methods such as mixed-precision mapping [6] and pruning [7] exploit layer-wise sensitivity or sparsity. CAFE instead keeps quantized precision fixed, uses to quantify bit-significance-weighted conducting-cell activity, and applies pruning as a robustness refinement rather than sparse execution.
III. METHODOLOGY
A. Conducting-Cell-Dominated Variation
We consider one output element of a bit-sliced dot product. Let be the b-th stored weight bit and be the k-th activation bit of input element . Their product
indicates whether the corresponding FeFET cell conducts for bit pair . The bit-plane partial sum is , and the arithmetic output is reconstructed as
where is the signed reconstruction coefficient determined by the encoding and the weight and activation bit positions. For unsigned bit planes, ; for signed encodings, sign bits or emitted signed digits change the sign but not the need to weight errors by reconstruction magnitude.
Due to the large FeFET on/off ratio, off-state cells contribute negligible read current ( ). We model a conducting on-state cell as
Here is an effective normalized perturbation that absorbs device-to-device (D2D), cycle-to-cycle (C2C), and read-path on-current variation into the standard deviation ; analog-to-digital converter (ADC) quantization is modeled separately in our simulator. Unless otherwise specified, experiments sample as zero-mean Gaussian with standard deviation . The current perturbation accumulated by bit pair is therefore
Ignoring fixed current-to-digital conversion constants, shift-and-add reconstruction maps these bit-plane perturbations to
Taking magnitudes gives a representation-dependent error envelope:
Thus, the sign of determines addition or subtraction, while determines how strongly a conducting-cell perturbation is amplified. FeFET-CIM variation is therefore concentrated on conducting events, especially those appearing in high-significance bit slices.
B. : Conducting-Cell Activity Metric
Based on Eq. (6), we define as a bit-significance-weighted count of conducting activity. For layer l, the number of conducting events at bit pair is
where the count is accumulated over evaluated samples or tokens, output channels, and reduction dimensions. The model-level metric is
For Gaussian effective variation, , so is proportional to the representation-dependent part of the expected error envelope in Eq. (6). It is computed directly from encoded bit planes and does not require Monte Carlo variation simulation, making it suitable for rapid comparison among encoding choices.
differs from generic activity counting in two aspects. First, it counts only conducting events, matching the
(a)

(b)
Fig. 4. Sign-extension amplification and differential encoding. (a) Near-zero negative quantized values create high-significance ones under two's-complement bit-slicing. (b) Differential weight and activation encoding removes sign extension with positive and negative unsigned components.
FeFET-specific observation that off-state leakage is negligible. Second, it weights each event by bit significance, reflecting shift-and-add amplification. As a result, encodings that represent the same quantized tensor values can still have different values when they induce different high-significance conducting patterns.
is validated at both the sample-output and end-to-end accuracy levels in Sec. IV.
C. -Guided Differential Encoding
A major representation-dependent source of high-significance conducting activity in signed bit-sliced CIM is two's-complement sign extension. For a B-bit signed value z, two's-complement representation computes
where is the sign bit. Sign extension makes negative codes carry leading ones in high-significance bit planes. Because quantized DNN weights are often concentrated near zero and signed activations can also contain near-zero negative codes, these patterns frequently appear in practical layers, as illustrated in Fig. 4(a). In bit-sliced FeFET CIM, sign-extension ones are physical stored or streamed bits; when paired with one bits from the other operand, they increase high-significance conducting events whose variations are amplified by shift-and-add reconstruction. The represented integer is fixed, but the physical conducting pattern changes.
CAFE uses differential encoding to change the physical bit representation while preserving the signed quantized tensor. For weights,
where and are unsigned magnitude tensors. A weight-differential layer computes
Similarly, activation differential encoding decomposes
and computes
When both operands are differentially encoded, the multiplication becomes
The signs are applied during digital recombination, while CIM arrays store and multiply only unsigned magnitude bit planes. Thus the clean quantized arithmetic is unchanged, but sign-extension ones are removed from CIM execution, as shown in Fig. 4(b). This representation change reduces on high-significance bit pairs in Eq. (6), thereby lowering AM without retraining or changing quantization scales.
CAFE considers four encoding configurations for each layer: TC-W/TC-A, Diff-W/TC-A, TC-W/Diff-A, and Diff-W/Diff-A, denoted as , where TC denotes two's-complement encoding and Diff denotes differential encoding. TC-W/TC-A is the lowest-cost baseline, while Diff-W/Diff-A provides the strongest sign-extension removal but incurs the highest branch, storage, and bit-serial overhead. Therefore, differential encoding should be applied selectively rather than uniformly across the whole model.
D. Sensitivity-Guided Adaptive Deployment
Full differential encoding reduces but incurs high cost when applied uniformly. To balance robustness and cost, CAFE combines layer-type sensitivity, type-wise coarse search, layer-wise non-dominated sorting genetic algorithm II (NSGA-II) [8], and post-GA pruning to select adaptive encoding schemes from , as shown in Fig. 5.
We use an area-latency cost proxy, normalized to the all-TC-W/TC-A baseline, as a search-ranking objective rather

Fig. 5. CAFE adaptive deployment flow: layer-type sensitivity guides type-wise enumeration, layer-wise NSGA-II search, and post-GA pruning for robustness-cost optimization.
than an absolute layout estimator. Differential weights require two unsigned magnitude branches with bit planes, while differential activations require bit-serial cycles. For layer , let , , and let be proportional to layer size. The normalized cost is
This proxy charges explicit branch and cycle overhead but does not credit possible peripheral savings from reduced bit-line current range or relaxed ADC precision, making the reported cost conservative for differential policies.
-
Layer-Type Sensitivity Analysis: CAFE profiles Transformer layer types by injecting FeFET-CIM variation into one functional role at a time, such as query, key, value, output, or feed-forward network (FFN) projections. Types causing larger accuracy degradation receive stronger candidate protections, while robust types retain lower-cost options.
-
Sensitivity-Constrained Type-Wise Coarse Search: Given , exhaustive layer-wise search is costly. CAFE therefore first enumerates type-wise policies in which all layers of the same type share one encoding. The allowed encoding subset for each type is constrained by its sensitivity group: robust types can choose low-cost encodings, while sensitive types must include stronger protection. CAFE evaluates robust accuracy and cost for these coarse policies and keeps accurate candidates as Pareto-ranked seeds.
-
Layer-Wise Fine-Grained NSGA-II Search: To recover flexibility beyond shared type-wise assignments, CAFE expands promising type-wise policies into layer-wise chromosomes, where each gene specifies one CIM layer's encoding. For a Transformer with blocks and six profiled layer types per block, the chromosome has genes. NSGA-II maximizes validation accuracy under FeFET-CIM variation while minimizing . The population is initialized from Pareto-ranked type-wise candidates and evolved by crossover and mutation, with tournament selection prioritizing feasibility, lower Pareto rank, and larger crowding distance.
-
Post-GA Pruning Refinement: After NSGA-II, CAFE applies post-GA pruning to selected Pareto candidates. This step targets harmful small-magnitude weights that may become small negative two's-complement codes and introduce high-significance conducting activity, rather than performing general model compression. Since differential encoding already removes sign extension, pruning is mainly applied to layers using two's-complement weight encoding.
For each selected candidate, CAFE sweeps the pruning ratio . Small-magnitude floating-point weights are masked before quantization and encoding. The pruned candidates are then evaluated under FeFET-CIM variation, and CAFE keeps the one with the best accuracy-cost trade-off.
IV. EXPERIMENTS
A. Experimental Setup
We evaluate CAFE with a behavioral bit-sliced CIM simulator adapted from NeuroSim [9], extended to support signed Transformer bit-plane encodings and the conducting-cell-level FeFET error flow in Fig. 3, including bit-plane decomposition, on-current variation, bit-line accumulation, ADC quantization, and shift-and-add reconstruction. The main workload is Vision Transformer (ViT)-Tiny [10] on CIFAR-100 [11], with additional evaluations on ViT-Base on CIFAR-100, ViT-Tiny on ImageNet, and Pythia [12] on WikiText-103.
Motivated by reported FeFET D2D and C2C variation [13], we sweep an effective on-current perturbation strength from to 0.20 with step 0.01, using as the clean reference. Unless specified, weights use 8-bit per-channel quantization, activations use 8-bit per-token quantization, and the CIM simulator uses a 6-bit ADC and 64 parallel read rows; variation results are averaged over 20 seeds from 2026 to 2045. Baselines include TC-W/TC-A, Diff-W/TC-A, TC-W/Diff-A, Diff-W/Diff-A, offset-binary, and CSD encoding [3]. Deployment experiments report normalized cost using Eq. (15).
B. Experimental Results
Fig. 6 validates at both sample and policy levels. Fig. 6(a) shows that per-sample tracks the Kullback-Leibler (KL) divergence between noisy and clean outputs under the two's-complement baseline, consistent with the error envelope in Eq. (6). Fig. 6(b)–(d) further evaluates diagnostic policies spanning uniform, type-wise, block-wise, and layer-wise encodings, showing that policies with larger consistently suffer larger normalized accuracy degradation under different FeFET variation strengths. The monotonic correlation remains strong as increases, with Spearman coefficients of , , and for , 0.15, and 0.2,

Fig. 6. Multi-level validation of : (a) sample-level output deviation and (b)–(d) policy-level accuracy drop.

Fig. 7. Comparison between and alternative activity metrics.

Fig. 8. Accuracy of different uniform encoding policies under FeFET variation from the default sweep to an extended stress setting.
respectively. This multi-level validation supports using as a low-cost robustness indicator during encoding search.
Fig. 7 compares with normalized count-based activity metrics at . achieves the strongest monotonic correlation with accuracy drop, while the mean count is weaker because it ignores bit significance, and activation-only or weight-only counts are less predictive. This confirms that FeFET-CIM robustness depends on both conducting-cell activity and shift-and-add significance.
Fig. 8 and Table I(a) evaluate uniform encoding policies under the default FeFET variation setting. The figure shows the accuracy trend across the default and extended stress ranges, while the table reports mean accuracy, normalized , and hardware cost.
The TC-W/TC-A baseline degrades sharply even at moderate variation, indicating that two's-complement sign extension

Fig. 9. Generalization across vision and language workloads.
creates high-significance conducting activity that is highly vulnerable to device perturbation. One-sided differential encoding improves robustness by removing sign-extension activity from either weights or activations, with Diff-W/TC-A remaining more stable in the default sweep. Diff-W/Diff-A maintains near-clean accuracy throughout the default range and shows the largest robustness margin in the extended stress region.
Table I(a) further shows that TC-W/TC-A and Offset-W/TC-A have the lowest cost but retain high normalized , so changing the signed representation alone is insufficient. CSD-W/TC-A lowers but still degrades under strong variation and costs more. By directly suppressing sign-extension-induced conducting activity, Diff-W/Diff-A achieves the lowest normalized (0.035, a reduction) and the best strong-variation accuracy.
Table I(b) further evaluates truncated-normal and lognormal perturbations. The same ordering is largely preserved, with Diff-W/Diff-A remaining strongest, indicating that the benefit is not tied to a specific Gaussian error assumption. Table I(c) reports representative CAFE deployments for reference; the search process and Pareto trade-offs are analyzed in the adaptive-deployment results.
Fig. 9 evaluates the four uniform encoding policies beyond the main ViT-Tiny on CIFAR-100 setting, covering ViT-Base on CIFAR-100, ViT-Tiny on ImageNet, and Pythia-70M and Pythia-160M on WikiText-103. Across vision and language workloads, TC-W/TC-A degrades sharply under increasing variation, whereas differential modes preserve accuracy or suppress perplexity growth, with Diff-W/Diff-A consistently strongest. This cross-workload trend shows that the benefit is not tied to one model, dataset, or output metric, but follows from reducing a general representation-induced vulnerability in bit-sliced FeFET CIM.
Fig. 10 visualizes the bit-plane conducting-event ratio, defined as the fraction of activation-weight bit-pair evaluations that activate conducting FeFET cells. TC-W/TC-A produces dense conducting events across both dimensions, including high-significance regions where variation errors are amplified by shift-and-add reconstruction. Differential encoding suppresses high-significance conducting events along the protected dimension: TC-W/Diff-A reduces activation-side events, Diff-W/TC-A reduces weight-side ones, and Diff-W/Diff-A
TABLE I
SUMMARY OF ENCODING BASELINES AND CAFE DEPLOYMENTS: (A) UNIFORM ENCODING ACCURACY, NORMALIZED , AND HARDWARE COST UNDER GAUSSIAN FEFET VARIATION; (B) ROBUSTNESS UNDER TRUNCATED-NORMAL AND LOGNORMAL VARIATION; AND (C) REPRESENTATIVE ADAPTIVE DEPLOYMENTS SELECTED AT DIFFERENT VARIATION STRENGTHS.
| (a) Encoding | σ = 0 | 0.05 | 0.10 | 0.15 | 0.20 | Norm. C2AM | Cost |
|---|---|---|---|---|---|---|---|
| TC-W/TC-A | 88.88 | 50.65±2.35 | 1.39±0.12 | 1.13±0.13 | 1.11±0.07 | 1.000 | 1.00 |
| Offset-W/TC-A | 88.88 | 44.93±1.64 | 1.37±0.09 | 1.14±0.10 | 1.07±0.10 | 1.016 | 1.00 |
| CSD-W/TC-A | 88.88 | 88.86±0.07 | 87.73±0.20 | 81.55±0.53 | 62.16±2.51 | 0.301 | 2.00 |
| TC-W/Diff-A | 88.66 | 88.62±0.08 | 85.40±0.33 | 36.67±3.77 | 2.28±0.38 | 0.140 | 1.75 |
| Diff-W/TC-A | 88.88 | 88.86±0.06 | 88.29±0.13 | 86.18±0.19 | 81.96±0.32 | 0.231 | 1.75 |
| Diff-W/Diff-A | 88.66 | 88.67±0.04 | 88.65±0.07 | 88.40±0.09 | 87.21±0.18 | 0.035 | 3.06 |
| (b) | Truncated normal | Lognormal | (c) Method | σ | Acc. | Norm. C2AM | Cost | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Encoding | 0.05 | 0.10 | 0.15 | 0.20 | 0.05 | 0.10 | 0.15 | 0.20 | |||||
| TC-W/TC-A | 77.0 | 1.5 | 1.3 | 1.1 | 50.1 | 1.4 | 1.0 | 0.9 | CAFE | 0.10 | 88.59 | 0.2166 | 1.859 |
| TC-W/Diff-A | 88.6 | 87.6 | 72.2 | 9.7 | 88.7 | 85.2 | 29.0 | 2.5 | 0.15 | 88.10 | 0.1094 | 2.556 | |
| Diff-W/TC-A | 88.9 | 88.7 | 87.0 | 84.0 | 88.8 | 88.2 | 86.1 | 82.3 | 0.20 | 87.07 | 0.0755 | 2.784 | |
| Diff-W/Diff-A | 88.7 | 88.8 | 88.8 | 88.4 | 88.7 | 88.5 | 88.3 | 87.2 | |||||

Fig. 10. Bit-plane conducting-event ratio under different encoding policies.

Fig. 11. Hardware hyperparameter sweeps: (a) ADC precision and (b) parallel read rows.
removes both. As a result, Diff-W/Diff-A reduces the average conducting-event ratio by overall and by in high-significance regions, explaining its lower and stronger robustness.
Fig. 11 sweeps ADC precision and parallel-read rows. The reduced conducting-event ratio in Fig. 10 narrows the bit-line current range and lowers ADC requirements: Diff-W/Diff-A reaches with a 3-bit ADC, whereas TC-W/TC-A reaches only even with 6 bits. Under increasing parallel-read rows on ViT-Base on CIFAR-100, fewer active cells let Diff-W/Diff-A remain at from 32 to 768 rows, while TC-W/TC-A falls to beyond 64 rows. These ADC and bit-line tolerance gains are not credited by the normalized cost proxy in Eq. (15).
Fig. 12 profiles layer-type sensitivity by injecting FeFET-CIM variation into one Transformer layer type at a time. Accu- racy loss is highly non-uniform: query and key projections are comparatively robust, value and output projections are moderate, and FFN layers, especially FFN2, dominate degradation under strong variation. This non-uniformity motivates type-wise seeding and selective layer-wise protection instead of uniform differential encoding.

Fig. 12. Layer-type sensitivity to FeFET-CIM variation.

Fig. 13. Accuracy-cost Pareto comparison.
Fig. 13 compares deployment search strategies at . Type-wise search quickly finds feasible policies but is limited by shared assignments within each layer type, while direct layer-wise NSGA-II explores a larger space yet remains weaker even after 20 generations. By seeding layer-wise NSGA-II with type-wise candidates, the guided search reaches a stronger Pareto frontier within 5 generations: for the near-clean target, it reduces extra cost from 1.73 to 1.56, a reduction, and increases feasible choices from 10 to 18, providing richer deployment options.
Fig. 14 evaluates post-GA pruning as a robustness re-

Fig. 14. Post-GA pruning as robustness refinement.

Fig. 15. Accuracy-cost Pareto trends across FeFET variation strengths.
finement for selected deployment candidates. Pruning TC-W layers is the most effective scope because small-magnitude negative weights in these layers can still introduce sign-extension ones and high-significance conducting events. The pruning-ratio sweep improves robustness up to an intermediate ratio, with the best setting giving a 2.70% accuracy gain over no pruning at ; beyond this point, excessive pruning damages clean model capacity. Fig. 14(c)–(d) links the gain to reduction and shows that pruning lifts the Pareto frontier at unchanged normalized cost.
Fig. 15 compares Pareto frontiers across three FeFET variation levels. Type-wise search quickly provides feasible starting points but is constrained by shared layer-type assignments, while direct layer-wise NSGA-II converges less effectively and fails to meet the 80% feasibility threshold at . The sensitivity-guided NSGA-II consistently achieves stronger frontiers by combining type-level priors with layer-wise flexibility, and post-GA pruning further improves accuracy at unchanged cost. These results show that adaptive encoding and pruning remain complementary across variation strengths.
Fig. 16 shows structured adaptive policies rather than uniform full-differential protection. As the variation strength increases, the selected policies use stronger differential encoding, but value and output projections are protected more often than the more sensitive FFN layers because their lower hardware cost improves the accuracy-cost trade-off. This confirms that CAFE allocates differential protection according to both robustness sensitivity and hardware cost.
V. CONCLUSION
This paper presented CAFE, a conducting-cell-aware adaptive differential encoding framework for robust FeFET-based CIM inference. By exposing how signed encodings amplify conducting-cell variation in bit-sliced FeFET CIM, CAFE

Fig. 16. Selected adaptive encoding policies and layer-type composition.
introduces to quantify bit-significance-weighted conducting activity and guide differential encoding, layer-wise adaptive deployment, and post-GA pruning. CAFE retains model performance while limiting hardware overhead: across representative workloads, it reduces by up to , improves accuracy under variation by more than 87 percentage points relative to two's-complement CIM, and approaches full-differential robustness at much lower normalized cost.
ACKNOWLEDGMENT
This work was supported by National Key R&D Program of China (2022YFB4400300), NSFC (62534002, 62274003, 92564302) and 111 Project (B18001), in part by the STIC under Grant QYJS-2022-1501-B and the National Micro/Nano Fabrication Laboratory of Peking University.
REFERENCES
[1] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin, “Attention is all you need,” in Proc. NeurIPS, 2017.
[2] Y. Long, D. Kim, E. Lee, P. Saha, B. A. Mudassar, X. She, A. I. Khan, and S. Mukhopadhyay, “A ferroelectric FET-based processing-in-memory architecture for DNN acceleration,” IEEE Journal on Exploratory Solid-State Computational Devices and Circuits, vol. 5, no. 2, pp. 113–122, 2019.
[3] R. Xiao, Y. Zhang, B. Wang, Y. Xu, J. Fan, H. Shen, and K. Huang, "A low-power in-memory multiplication and accumulation array with modified radix-4 input and canonical signed digit weights," IEEE Transactions on Very Large Scale Integration (VLSI) Systems, vol. 31, no. 11, pp. 1700–1712, 2023.
[4] A. Shafiee, A. Nag, N. Muralimanohar, R. Balasubramonian, J. P. Strachan, M. Hu, R. S. Williams, and V. Srikumar, “ISAAC: A convolutional neural network accelerator with in-situ analog arithmetic in crossbars,” in Proc. ISCA, 2016, pp. 14–26.
[5] P. Chi, S. Li, C. Xu, T. Zhang, J. Zhao, Y. Liu, Y. Wang, and Y. Xie, "PRIME: A novel processing-in-memory architecture for neural network computation in ReRAM-based main memory," in Proc. ISCA, 2016, pp. 27–39.
[6] K. Wang, Z. Liu, Y. Lin, J. Lin, and S. Han, “HAQ: Hardware-aware automated quantization with mixed precision,” in Proc. CVPR, 2019, pp. 8604–8612.
[7] S. Han, J. Pool, J. Tran, and W. J. Dally, “Learning both weights and connections for efficient neural network,” in Proc. NeurIPS, vol. 28, 2015.
[8] K. Deb, A. Pratap, S. Agarwal, and T. Meyarivan, “A fast and elitist multiobjective genetic algorithm: NSGA-II,” IEEE Transactions on Evolutionary Computation, vol. 6, no. 2, pp. 182–197, 2002.
[9] A. Lu, X. Peng, W. Li, H. Jiang, and S. Yu, “Neurosim simulator for compute-in-memory hardware accelerator: Validation and benchmark,” Frontiers in Artificial Intelligence, vol. 4, p. 659060, 2021.
[10] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, J. Uszkoreit, and N. Houlsby, "An image is worth words: Transformers for image recognition at scale," in Proc. ICLR, 2021.
[11] A. Krizhevsky, “Learning multiple layers of features from tiny images,” University of Toronto, Tech. Rep., 2009.
[12] S. Biderman, H. Schoelkopf, Q. G. Anthony, H. Bradley, K. O'Brien, E. Hallahan, M. A. Khan, S. Purohit, U. S. Prashanth, E. Raff, A. Skowron, L. Sutawika, and O. Van Der Wal, "Pythia: A suite for analyzing large language models across training and scaling," in Proc. ICML, 2023, pp. 2397–2430.
[13] B. Manna, A. Saha, Z. Jiang, K. Ni, and A. Sengupta, “Variation-resilient FeFET-based in-memory computing leveraging probabilistic deep learning,” IEEE Transactions on Electron Devices, vol. 71, no. 5, pp. 2963–2969, 2024.