Complex-Valued Attention is a neural attention mechanism that computes query, key, and value transformations directly in the complex domain, where weights, inputs, and activations are complex numbers with real and imaginary components. Unlike standard real-valued attention, which treats IQ samples as two independent real channels, this mechanism preserves the phase rotation and magnitude scaling properties intrinsic to electromagnetic waveforms, enabling the model to learn interference patterns and phase-coherent representations.
Glossary
Complex-Valued Attention

What is Complex-Valued Attention?
Complex-valued attention extends the standard self-attention mechanism to operate natively on complex numbers, preserving the magnitude and phase relationships inherent in IQ baseband signals for more expressive physical-layer processing.
The core operation replaces real-valued matrix multiplications with complex linear layers and employs split activation functions—such as modReLU or complex GELU—that apply non-linearities to magnitude while preserving phase. This allows the attention scores to capture phase differences between signal components, making it particularly effective for tasks like channel estimation, beamforming, and automatic modulation classification where the relative phase of baseband samples carries critical information.
Key Features of Complex-Valued Attention
Complex-valued attention extends the standard transformer mechanism to operate natively on complex numbers, preserving the magnitude and phase relationships inherent in IQ baseband signals for more expressive physical-layer processing.
Complex Dot-Product Attention
Replaces the standard real-valued dot product with a complex inner product to compute attention scores. The query, key, and value projections are complex linear transformations, and the attention weight is computed as the squared magnitude of the complex dot product. This preserves phase alignment between query and key vectors, allowing the model to attend based on both amplitude correlation and phase coherence.
Phase-Aware Softmax
Standard softmax operates on real-valued logits, discarding phase information. Complex-valued attention applies softmax to the magnitudes of the complex attention scores while retaining the phase component for value aggregation. The output is a complex-weighted sum where both the amplitude weighting (from softmax) and phase rotation (from the complex scores) are preserved, enabling the model to learn phase-sensitive alignments.
Wirtinger Calculus Backpropagation
Training complex-valued networks requires optimization in the complex domain. Wirtinger calculus treats the complex variable and its conjugate as independent, enabling gradient computation for non-holomorphic activation functions. This allows standard backpropagation to work with complex-valued parameters by computing gradients with respect to both the real and imaginary parts separately, ensuring stable convergence.
Complex Rotary Position Embedding
Rotary Position Embedding (RoPE) is naturally suited for complex-valued attention. It encodes relative position by rotating query and key vectors in the complex plane by an angle proportional to their position index. For complex-valued signals, this provides a mathematically elegant way to inject temporal or frequency-domain positional information without breaking the complex algebraic structure of the representations.
Magnitude-Phase Decomposition
A common architectural pattern splits complex-valued attention into parallel streams: one processing magnitude (signal energy) and another processing phase (signal structure). The two streams may use different attention mechanisms—e.g., standard dot-product for magnitude and a phase-sensitive operation for the angle—before recombining. This allows the model to learn distinct representations for amplitude-based and phase-based signal features.
IQ-Preserving Residual Connections
Standard residual connections add real-valued tensors. Complex-valued attention uses complex residual connections that preserve the full IQ representation throughout the network depth. This prevents information loss from premature conversion to real-valued magnitudes and ensures that phase coherence is maintained across multiple attention layers, which is critical for tasks like channel equalization and beamforming.
Frequently Asked Questions
Clear, technically precise answers to the most common questions about extending the attention mechanism to operate natively on complex numbers for physical-layer signal processing.
Complex-valued attention is an extension of the standard dot-product attention mechanism that operates natively on complex numbers, preserving both magnitude and phase information. Instead of projecting real-valued vectors to form queries, keys, and values, it uses complex-valued linear transformations with complex weight matrices. The attention score between a query (q) and key (k) is computed using a complex inner product, and the resulting complex attention weights are applied to complex value vectors. A critical design choice is the activation function applied to the attention scores; using a modReLU or complex softmax that operates on magnitudes while preserving phase ensures stable training. This mechanism allows the model to learn phase-dependent relationships in the data, which is essential for processing IQ baseband signals where the relative phase between samples encodes critical information about modulation, channel distortion, and emitter characteristics.
Applications in Wireless Systems
Complex-valued attention mechanisms are revolutionizing physical-layer processing by natively operating on IQ baseband signals, preserving the critical magnitude and phase relationships that standard real-valued networks discard. This enables more expressive and accurate models for the most demanding wireless communication tasks.
Massive MIMO Beamforming
Complex-valued attention directly processes the channel state information (CSI) matrices from antenna arrays, learning optimal beamforming weights. Unlike real-valued networks that split complex numbers, this approach preserves the phase coherence between antenna elements, leading to higher beamforming gain and reduced interference in multi-user scenarios. The attention mechanism learns to focus on the most critical spatial paths.
End-to-End Learned Receiver (DeepRx)
In a fully learned neural receiver, complex-valued attention replaces the entire traditional processing chain. The model attends to a sequence of received IQ symbols to perform joint channel estimation, equalization, and demapping in one shot. The attention mechanism's ability to model long-range dependencies in the complex domain allows it to mitigate severe inter-symbol interference that conventional methods struggle with.
Joint Source-Channel Coding
Complex-valued attention enables the design of autoencoder-based transceivers that map source data directly to channel symbols in the complex domain. The encoder uses self-attention to create robust complex-valued representations, while the decoder uses cross-attention to reconstruct the original data from a noisy received signal. This joint optimization outperforms separate source and channel coding, especially in low-SNR regimes.
Radar and Sensing Waveform Design
Complex-valued attention models are used to design and process radar waveforms for autonomous systems. The network learns to attend to specific delay-Doppler bins in the complex ambiguity function, improving target detection and range-velocity estimation. By operating natively on complex baseband samples, the model preserves the phase history critical for micro-Doppler signature analysis and synthetic aperture radar (SAR) imaging.
Physical Layer Authentication
Complex-valued attention mechanisms excel at RF fingerprinting by learning to attend to the subtle, unique hardware impairments embedded in the phase and magnitude of a transmitter's IQ signal. The model focuses on transient and steady-state phase noise patterns that are discarded by real-valued networks, enabling highly robust specific emitter identification (SEI) for secure device authentication at the physical layer.
Semantic Communication Systems
In goal-oriented semantic communication, complex-valued attention is the core of a system that transmits the meaning of a message, not its exact bits. The transmitter's attention mechanism learns to map semantic features to a robust complex-valued signal. The receiver uses cross-attention to reconstruct the intended meaning from a distorted signal, achieving dramatic bandwidth savings by ignoring task-irrelevant information.
Complex-Valued vs. Real-Valued Attention
A feature-level comparison of attention mechanisms operating natively on complex numbers versus those that process real-valued inputs, highlighting the trade-offs for physical-layer signal processing.
| Feature | Complex-Valued Attention | Real-Valued (2-Channel) Attention | Real-Valued (Magnitude-Phase) Attention |
|---|---|---|---|
Native domain | Complex numbers (a + jb) | Dual real-valued channels (I/Q stacked) | Magnitude and phase as separate real inputs |
Preserves phase relationships | |||
Weight parameter type | Complex-valued matrices | Real-valued matrices | Real-valued matrices |
Activation function | Complex ReLU, modReLU, or zReLU | Standard ReLU, GELU | Standard ReLU, GELU |
Multiplication operations per attention head | 4 real multiplications per complex multiply | 2 real multiplications per real multiply | 2 real multiplications per real multiply |
Gradient propagation | Wirtinger calculus (holomorphic and conjugate gradients) | Standard real-valued backpropagation | Standard real-valued backpropagation |
Inherent rotational equivariance | |||
Compatible with standard softmax | Requires complex modulus for softmax |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Core mechanisms and architectural patterns that underpin complex-valued attention in physical-layer deep learning.
IQ Transformer
A transformer architecture that processes raw in-phase and quadrature (IQ) samples directly. It uses specialized tokenization to preserve the complex baseband structure, making it the primary consumer of complex-valued attention. Key aspects:
- Operates on complex-valued tokens without separating real and imaginary parts
- Uses complex layer normalization to stabilize training
- Enables end-to-end learning from antenna samples to bits
Rotary Position Embedding RF
The application of Rotary Position Embedding (RoPE) to RF signal tokens. RoPE encodes relative temporal or frequency offsets through rotation in the complex plane, making it mathematically natural for complex-valued attention. Benefits include:
- Preserves the complex inner product structure
- Naturally captures phase rotations from carrier frequency offsets
- Enables length extrapolation for variable-duration signals
Complex-Valued Backpropagation
The extension of gradient-based learning to complex parameters using Wirtinger calculus. Unlike real-valued backpropagation, gradients are computed with respect to the complex variable and its conjugate independently. Critical properties:
- The chain rule operates in the complex domain
- Activation functions must be holomorphic or use split-complex approaches
- Enables end-to-end training of complex attention weights
Magnitude-Phase Decoupling
A design pattern in complex attention where the magnitude and phase of the attention weights are computed or constrained separately. This allows:
- Magnitude to represent signal energy and relevance
- Phase to encode relative timing and carrier offsets
- Independent regularization of amplitude and angular components
- More interpretable attention patterns for signal processing engineers
Complex Layer Normalization
A stabilization technique that normalizes complex-valued activations using a complex mean and covariance matrix. Unlike real layer norm, it must account for the correlation between real and imaginary parts. The process:
- Computes a 2×2 covariance matrix per feature
- Whitens using the inverse square root of the covariance
- Applies learnable complex scale and shift parameters
Cross-Attention Spectrum Fusion
A mechanism using complex-valued cross-attention to fuse information from two distinct signal representations. Common pairings include:
- Time-domain IQ samples with frequency-domain spectra
- Multiple antenna streams in MIMO systems
- Pilot symbols with data symbols for channel estimation
- The complex attention weights preserve phase coherence between modalities

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us