Inferensys

Glossary

IQ Transformer

A transformer model adapted to process raw in-phase and quadrature (IQ) sample sequences directly, using specialized tokenization and positional encoding to capture temporal dependencies in the complex baseband waveform.
ML engineer running AI model benchmarks, performance charts on multiple screens, late night home office setup.
NEURAL NETWORK ARCHITECTURE

What is an IQ Transformer?

An IQ Transformer is a deep learning model that applies the transformer architecture directly to raw in-phase and quadrature (IQ) sample sequences, using specialized tokenization and positional encoding to model temporal dependencies in complex baseband waveforms.

An IQ Transformer is a neural network that adapts the self-attention mechanism to process raw complex baseband signals natively. Unlike traditional transformers that operate on text or images, this architecture tokenizes sequences of in-phase and quadrature samples, preserving the magnitude and phase relationships critical for physical-layer learning tasks such as automatic modulation classification and emitter identification.

The model employs complex-valued attention or dual-channel real-valued processing to handle the two-dimensional nature of IQ data. By leveraging rotary position embeddings and causal masking, the IQ Transformer captures long-range temporal dependencies in the waveform, enabling it to replace conventional signal processing blocks with a single, end-to-end learned system for tasks like channel estimation and equalization.

ARCHITECTURAL INNOVATIONS

Core Characteristics of IQ Transformers

The IQ Transformer redefines physical-layer processing by applying the self-attention mechanism directly to raw complex baseband samples. These core characteristics distinguish it from conventional signal processing chains and standard NLP transformers.

01

Complex-Valued Tokenization

Unlike NLP transformers that tokenize discrete words, the IQ Transformer operates on continuous complex-valued samples. The raw In-Phase (I) and Quadrature (Q) components are treated as a single complex token z = I + jQ, preserving the critical magnitude and phase relationships that define the signal's modulation and propagation characteristics.

  • Direct IQ Input: Bypasses hand-crafted feature extraction like cyclostationary moments or constellation diagrams.
  • Complex Linear Projection: The initial embedding layer uses complex-valued weights to project each IQ sample into a higher-dimensional token space without collapsing the real and imaginary parts prematurely.
  • Preserves Baseband Geometry: This approach maintains the geometric structure of the complex plane, which is essential for tasks like phase rotation compensation and automatic modulation classification.
02

Rotary Position Embedding (RoPE) for RF

Standard sinusoidal or learned absolute position encodings struggle to capture the relative phase offsets between IQ samples. The IQ Transformer employs Rotary Position Embedding (RoPE), which encodes position information through rotation in the complex plane.

  • Relative Phase Encoding: RoPE naturally captures the phase progression between samples, making it ideal for modeling carrier frequency offsets and Doppler shifts.
  • Complex-Plane Rotation: The embedding applies a rotation matrix to the query and key vectors based on their relative temporal distance, ensuring that the attention score depends only on the relative phase difference.
  • Seamless Integration: RoPE is applied directly to the complex-valued token embeddings, maintaining the signal's mathematical structure throughout the attention computation.
03

Causal Temporal Attention Masking

For real-time streaming applications, the IQ Transformer uses a causal attention mask that restricts each token to attend only to past and present samples. This prevents the model from peeking into the future, enabling sample-by-sample processing with deterministic latency.

  • Streaming Inference: The model processes a sliding window of IQ samples, generating outputs with a fixed look-back window and no future dependence.
  • Triangular Mask Matrix: A lower-triangular mask is applied to the attention scores, zeroing out contributions from future time steps.
  • Real-Time Demodulation: This causal constraint is critical for deploying the transformer as a neural receiver in live communication links, where future symbols are unavailable.
04

Multi-Head Spectrum Attention

The core self-attention mechanism is extended to multi-head spectrum attention, allowing the model to jointly analyze the IQ sequence across multiple representational subspaces simultaneously. Each head can learn to focus on different temporal scales or signal features.

  • Diverse Feature Extraction: One head might attend to short-term symbol-rate patterns, while another captures long-term fading correlations or interference bursts.
  • Parallel Processing: All heads compute attention in parallel, with their outputs concatenated and projected back to the token dimension.
  • Implicit Equalization: Through this mechanism, the transformer learns to implicitly perform channel equalization and interference rejection by weighting the importance of different temporal neighborhoods.
05

Hierarchical Temporal Processing

To capture both fine-grained symbol transitions and long-term channel coherence, the IQ Transformer often employs a hierarchical architecture. This involves processing the signal at multiple temporal resolutions through pooling or strided attention layers.

  • Multi-Scale Analysis: Early layers operate on high-resolution sample sequences, while deeper layers process downsampled representations that capture envelope and fading statistics.
  • Strided Attention Windows: By applying attention with a stride greater than one, the model reduces computational complexity for long sequences while expanding its receptive field.
  • Fusion Layers: Cross-attention mechanisms fuse features from different temporal scales, combining local waveform detail with global context for robust classification and detection.
06

Cross-Attention for Multi-Domain Fusion

The IQ Transformer can fuse information from multiple signal representations using cross-attention. This allows the model to jointly reason over raw IQ samples and a transformed domain, such as a spectrogram or delay-Doppler map.

  • Time-Frequency Fusion: One transformer branch processes time-domain IQ tokens, while another processes frequency-domain tokens from an FFT. Cross-attention layers allow the time-domain branch to query the frequency-domain branch for spectral context.
  • Sensor Modality Fusion: Cross-attention can also fuse IQ data from multiple antenna elements in a MIMO array, allowing the model to learn spatial beam patterns implicitly.
  • Query-Key Asymmetry: The query vectors come from the primary IQ sequence, while the key and value vectors come from the auxiliary domain, enabling the model to selectively retrieve relevant spectral or spatial information.
IQ TRANSFORMER ARCHITECTURE

Frequently Asked Questions

Explore the core mechanisms behind adapting transformer networks to process raw in-phase and quadrature (IQ) baseband samples for advanced wireless signal processing.

An IQ Transformer is a neural network architecture that adapts the standard transformer's self-attention mechanism to directly process raw sequences of complex-valued in-phase and quadrature (IQ) samples. Unlike traditional models that require pre-processed spectrograms or feature vectors, the IQ Transformer operates on the native complex baseband waveform. It first converts the complex IQ stream into a sequence of tokens using a specialized time-frequency tokenizer or a learned linear projection. Complex-valued attention or a dual-channel real-valued attention mechanism then captures long-range temporal dependencies and intricate phase-amplitude relationships within the signal. This allows the model to learn optimal representations for tasks like automatic modulation classification, signal denoising, and end-to-end physical layer processing without relying on hand-crafted expert features.

Prasad Kumkar

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.