Compute-in-Memory Attention: A Time-Domain Analog Softmax Circuit with RC-Tunable Temperature
Organizations: Department of Electrical and Computer Engineering, University of Wisconsin–Madison, Madison, WI, USA. · ORNL Oak Ridge, Tennessee, USA.
Abstract
Softmax is a key operation in Transformer attention, but its exponentiation and normalization add significant overhead in compute-in-memory (CIM) accelerators, especially when analog attention scores must first be converted to the digital domain. This work presents a tunable-temperature analog softmax circuit in GlobalFoundries 22-nm fully depleted silicon-on-insulator (FDSOI) technology that operates directly on CIM-generated score voltages without intermediate analog-to-digital conversion. Each input score is converted into a time-domain event using a shared falling ramp. The corresponding comparator transition samples an RC-decaying reference to generate an exponential weight, which is then processed by an in-circuit normalization stage. In contrast to analog softmax circuits that rely on transistor weak-inversion behavior for exponentiation, the proposed architecture controls the softmax response through the ramp slope and RC time constant, enabling programmable effective temperature. The 128-element architecture is evaluated using transistor-level and post-layout extracted simulations, including multi-level input vectors, capacitance variation and mismatch, process and temperature variation, monte carlo analysis, and shared-interconnect parasitics. The complete 128-element implementation occupies 9453.42~ including the shared global ramp circuitry, while each replicated softmax element occupies 70.2~. The circuit achieves a 242.97-ns evaluation latency at 13.44mW total power, corresponding to 25.5pJ per output element. The simultaneous 128-element evaluation achieves an RMSE of 24.46~mV relative to the ideal softmax response. The extracted circuit characteristics are further incorporated into a MemTorch-based hardware-aware Transformer model, where the proposed softmax achieves a validation loss within 2.5% of the ideal-softmax baseline.
Figures & tables
| Device | Width ( ) | Length ( ) |
|---|---|---|
| – | 4 m | 50 nm |
| – | 300 nm | 100 nm |
| GF22 standard-cell library | ||
| Parameter | Nominal Value |
|---|---|
| Extracted ramp slope, | 4.501 mV/ns |
| Programmed resistance, | 1.5 M |
| Exponential capacitance, | 25 fF |
| RC time constant, | 37.5 ns |
| Effective softmax temperature, | 84.4 mV |
| Theoretical softmax gain, | 11.85 V -1 |
| Circuit Block | Length ( m) | Width ( m) | Area ( m 2 ) |
|---|---|---|---|
| Ramp generator | 12.1 | 4.2 | 50.82 |
| Exponential generator | 3.80 | 3.08 | 11.70 |
| Comparator | 4.2 | 5.12 | 21.50 |
| Pulse generator | 6.28 | 0.54 | 3.39 |
| Normalization circuit | 5.22 | 2.81 | 14.67 |
| Routing | – | – | 18.94 |
| Circuit Block | Count | Power ( W) | Total Power (mW) |
|---|---|---|---|
| Comparator | 128 | 66.45 | 8.506 |
| Pulse generator | 128 | 37.32 | 4.777 |
| Normalizer | 128 | 1.061 | 0.1358 |
| Exponential generator | 128 | 0.159 | 0.0204 |
| Global ramp generator | 1 | 0.445 | 0.00045 |
| Total | – | 105.43 | 13.44 |
| RMSE | ||||
|---|---|---|---|---|
| (mV) | (ns) | (mV/ns) | (V -1 ) | (mV) |
| 350 | 300 | 3.66 | 14.55 | 18.61 |
| 360 | 283 | 3.89 | 13.72 | 14.12 |
| 370 | 241 | 4.56 | 11.68 | 21.25 |
| 380 | 202 | 5.45 | 9.79 | 29.36 |
| Parameter | Value |
|---|---|
| Softmax input range | 0.30–1.10 V |
| Nominal | 11.85 V -1 |
| Score-to-voltage factor | 0.0844 V/score |
| 1.1 V | |
| Channel-length modulation | 0 |
| Output full scale | 1.0 V |
| Metric | Vatalaro [ 17 ] | Jiang [ 18 ] | Kouretas [ 19 ] | Spagnolo [ 20 ] | Base-2 [ 21 ] | SoftAct [ 22 ] | Kim [ 23 ] | Wang [ 24 ] | Hyft [ 25 ] | This Work |
| Technology | 180 nm | 28 nm | 90 nm | 28 nm FDSOI | 28 nm | 28 nm | 28 nm | 28 nm | FPGA Zynq | 22 nm FDSOI |
| Domain | Analog | Analog | Digital | Digital | Digital | Digital | Digital | Digital | Digital | Analog time-domain |
| Exponential mechanism | Subthresh. | Subthresh. | LUT | Shift-add approx. | SM-LUT | PLF + penalty | Bit-wise LUT | Linear fit | Hybrid fixed/float | Ramp + RC decay |
| Precision | Analog | Analog 4-b MAC 8-b ADC | 10-b fixed | 16-b fixed | 16-b fixed | 16-b fixed | 8-b fixed | 8-/16-b fixed | FP16/FP32 | Analog |
| Parallelism | 10 | 4 | 10 | 10 | 10 | 1 | 8 | 16/8 | 128 | 128 |
| Computation mode | Parallel | Parallel | Parallel comb. | Parallel | Parallel | Serial | Serial | Serial | Serial | Parallel |