skills/skillxiv-v0.0.2-claude-opus-4.6/fairy2i-complex-llm-quantization/SKILL.md
Enable extreme 1-2bit quantization of pre-trained LLMs by leveraging complex-valued arithmetic. Convert real-valued linear layers to complex domain losslessly, quantize to fourth roots of unity {±1, ±i}, and apply recursive residual error quantization for near full-precision performance.
npx skillsauth add ADu2021/skillXiv fairy2i-complex-llm-quantizationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Fairy2i introduces extreme quantization through complex-valued arithmetic, enabling conversion of pre-trained real-valued LLMs to 1-2bit precision without retraining. The method proves that any real-valued linear layer can be expressed as a complex-valued operation, then quantizes weights to the fourth roots of unity {±1, ±i} using phase-based projection. Recursive residual error quantization further reduces approximation errors, achieving near full-precision performance on LLaMA-2 7B at effective 2-bit precision.
Three key technical innovations enable extreme compression:
1. Widely-Linear Transformation Prove that any real-valued linear layer can be mathematically expressed as an equivalent complex-valued operation combining "a complex-linear part and a conjugate-linear part." This lossless reparameterization converts pre-trained real models into the complex domain without altering behavior before quantization.
2. Phase-Aware Complex Quantization Rather than using real-valued binary or ternary sets, quantize complex weights to the "fourth roots of unity ({±1,±i})" using phase-based projection. This utilizes the full 2-bit encoding space more efficiently than real alternatives.
3. Recursive Residual Error Quantization Iteratively quantize the remaining error after each stage using the same codebook. At deployment, the final weight is a sum of multiple ultra-low-bit terms, reducing approximation errors with minimal overhead.
Start with pre-trained real-valued checkpoints. Apply widely-linear transformation to convert layers to complex domain. Implement phase-aware quantization to fourth roots of unity. Apply recursive residual error quantization for multi-term weight representation. Validate performance on downstream tasks—method typically preserves functionality within 1-3% accuracy loss.
testing
Uses flow maps as look-ahead operators to enable principled reward-guided diffusion by predicting trajectory endpoints at any denoising step. Deploy when applying rewards or preferences to diffusion trajectories with meaningful gradients throughout generation.
testing
Train language models where each expert learns independently on closed datasets, enabling flexible inference with selective data inclusion or exclusion. 41% performance improvement while allowing users to opt out of specific data sources without retraining.
data-ai
Understand how token generation flexibility in diffusion LMs paradoxically constrains reasoning, as models exploit ordering flexibility to avoid uncertain tokens, and apply simplified approaches that preserve parallel decoding benefits. Use when optimizing diffusion-based language models for reasoning tasks.
devops
Enable LLM agents to improve continuously during deployment by constructing structured experience libraries through self-reflection on successes and failures—achieving 23% improvement on reasoning without gradient-based parameter updates or external training.