prism-hypothesis

Unify semantic understanding and pixel-level detail in a single representation by decomposing features into frequency bands. Low frequencies encode semantics while high frequencies capture pixels—enab

SKILL.md

GitHub

Overview

The Prism Hypothesis addresses the fundamental tension between semantic abstraction and pixel fidelity in foundation models. Rather than maintaining separate semantic and pixel encoders that conflict, this approach uses a unified frequency-decomposed representation where different frequency bands serve different purposes.

Core Technique

The key insight is that different frequency components naturally separate semantic and pixel concerns.

Frequency-Based Decomposition: Data modalities are viewed as projections onto a shared feature spectrum, where semantic meaning lives in low frequencies and fine details in high frequencies.

# Frequency-based latent decomposition
import numpy as np

class UnifiedAutoencoder:
    def __init__(self, num_bands=4):
        self.num_bands = num_bands

    def decompose_spectrum(self, features):
        """
        Split latent representations into K frequency bands
        using FFT-based projection.
        """
        # FFT to frequency domain
        fft_features = np.fft.fft(features, axis=-1)

        # Divide into bands
        bands = []
        band_size = fft_features.shape[-1] // self.num_bands
        for i in range(self.num_bands):
            start = i * band_size
            end = (i + 1) * band_size
            band = fft_features[..., start:end]
            bands.append(band)

        return bands  # Low freq → semantic, High freq → pixel detail

Unified Autoencoding (UAE) Architecture: Three mechanisms process multi-band latents:

# Multi-stage frequency processing pipeline
class FrequencyBandModulator:
    def __init__(self):
        self.noise_injection = NoiseLayer()
        self.spectral_transforms = SpectralTransformBlocks()
        self.decoder = Decoder()

    def process_bands(self, bands):
        """
        Process each frequency band through modulation pipeline.
        """
        # Robustness via noise injection
        bands = [self.noise_injection(b) for b in bands]

        # Spectral transformation
        transformed = [self.spectral_transforms(b) for b in bands]

        # Decode to both semantic and pixel outputs
        output = self.decoder(transformed)
        return output

Semantic-Wise Alignment: Only low-frequency bands are aligned with frozen semantic encoders. High-frequency bands learn freely to capture pixel details.

def loss_semantic_alignment(predicted_bands, semantic_encoder):
    """
    Align only lowest frequency bands with semantic encoder.
    Higher bands have no semantic constraint.
    """
    low_freq_band = predicted_bands[0]
    frozen_semantic = semantic_encoder(original_data)

    # Alignment loss only on semantic dimension
    semantic_loss = mse(low_freq_band, frozen_semantic)

    # High-frequency bands: reconstruction loss only
    reconstruction_loss = mse(decode(predicted_bands), original_pixels)

    return semantic_loss + reconstruction_loss

When to Use This Technique

Use Prism Hypothesis when:

  • Building unified tokenizers for both understanding and generation
  • You need strong semantic understanding and pixel-level quality
  • Joint training on semantic and generative tasks
  • Foundation models for multimodal applications

When NOT to Use This Technique

Avoid this approach if:

  • Task-specific semantic or pixel encoders are optimal
  • Frequency decomposition doesn't align with your domain
  • Single-purpose models (understanding-only or generation-only)
  • Computational overhead of multi-band processing is prohibitive

Implementation Notes

The framework requires:

  • FFT-based frequency band decomposition
  • Separate semantic and reconstruction loss components
  • Frozen semantic encoder for alignment
  • Multi-band processing pipeline with noise injection and spectral transforms

Key Performance

  • State-of-the-art reconstruction quality
  • Strong semantic understanding
  • Competitive generative capabilities
  • Single unified tokenizer

References

  • Frequency-based representation decomposition
  • Low-frequency semantic alignment, high-frequency pixel detail
  • Unified autoencoding for multi-purpose representations