While modern multimodal Large Language Models (LLMs) have made massive strides in understanding what is being said, they remain largely "audio-blind" to the spatial context of the physical world. Most models process audio as a single mono stream, discarding the rich directional information captured by the microphone arrays found in phones, smart glasses, and robots.
Existing spatial audio models attempt to bridge this gap but suffer from two critical flaws. First, they exhibit geometry rigidity—they are hard-coded for a specific microphone arrangement and fail if a microphone is moved even slightly. Second, they suffer from a reasoning gap. While they might output a coordinate (e.g., "Sound at 30°"), they are not integrated into the reasoning engine of an LLM, making it impossible for an AI assistant to follow complex instructions like "Listen to the person furthest away."
To solve this, researchers have introduced PhaseCoder, a novel, transformer-based spatial audio encoder that allows LLMs to understand where sounds are coming from using any arbitrary microphone layout.
The PhaseCoder Architecture
PhaseCoder is a transformer-only architecture designed from the ground up to be "geometry-agnostic." Instead of assuming a fixed grid of microphones, PhaseCoder takes two distinct inputs:
- Raw Multichannel Audio: Processed via Short-Time Fourier Transform (STFT) to extract both magnitude and phase.
- Microphone Coordinates: The exact $(x, y, z)$ physical positions of every microphone in the array.
The "Secret Sauce": Spatial Embeddings
To make the model work seamlessly with any hardware layout, the researchers utilize three distinct types of positional embeddings: Sequential (standard 1D order), Frame (grouping information from the same point in time), and Microphone Positional Embeddings.
This third embedding is the key innovation. It converts Cartesian microphone coordinates into spherical coordinates and applies a phase-modulation encoding. This effectively "grounds" the audio data in physical space, allowing the transformer to learn how tiny phase differences between microphones relate to the direction of the sound source.
Empowering LLMs with Spatial Awareness
The output of PhaseCoder is a set of "Spatial Audio Tokens." These tokens are prepended to the standard audio tokens of a Gemma 3n 4B model. The LLM is then fine-tuned using Low-Rank Adaptation (LoRA) to align these spatial signals with text-based reasoning tasks.
Interestingly, these spatial tokens act as natural "diarization prompts." In multi-speaker environments, mono-audio LLMs often "leak" text from one speaker into another. PhaseCoder's spatial tokens help the LLM anchor its attention to a specific point in space, significantly reducing the Word Error Rate (WER).
Training and Evaluation
Due to a lack of labeled real-world spatial data, the authors generated a massive synthetic training dataset of 1.5 million unique Room Impulse Responses (RIRs), randomizing microphone geometries (between 3 and 8 mics) and room materials.
To prove the model generalizes to unseen hardware, evaluation was performed on real-world benchmarks, including the RSL2019 dataset (4-mic array) and the LOCATA dataset (an 8-mic robot head). The team also created a new synthetic Spatial QA dataset featuring tasks like Source Localization, Spatial Reasoning, and Targeted Transcription.
Key Results
PhaseCoder demonstrates remarkable performance across both localization and reasoning tasks:
- State-of-the-Art Localization: On the challenging LOCATA dataset, PhaseCoder achieved a Mean Absolute Error (MAE) of 7.44°, outperforming the previous best-in-class model (GI-DOAEnet at 7.82°).
- Robust Reasoning: The fine-tuned Gemma model achieved 76.76% accuracy on spatial reasoning questions (e.g., "Is the speaker further than 3.5 meters away?").
- Targeted Transcription: For the first time, an LLM successfully transcribed a specific speaker based purely on a spatial cue (e.g., "transcribe the person on the left") from an arbitrary mic array, achieving 52.73% accuracy on attribution in real-world tests.
- Transformer Efficiency: By using a pure transformer architecture rather than hybrid CNNs, PhaseCoder is highly parallelizable, achieving faster empirical inference times on GPUs than previous SOTA models despite a higher theoretical FLOP count.
Limitations and Future Directions
While PhaseCoder represents a major leap forward for embodied AI, it has a few current limitations. The model assumes microphones are "free-floating" and does not explicitly account for the acoustic "shadowing" effect of a device's body (like the frame of smart glasses). Furthermore, while directional accuracy (azimuth/elevation) is high, absolute distance estimation remains difficult because it depends heavily on unknown room reverberations.
Finally, the current iteration is optimized for localizing one dominant speaker at a time. Future work will aim to expand PhaseCoder to full Sound Event Localization and Detection (SELD) to handle multiple overlapping sound sources simultaneously.
Summary updated