adu2021/skillxiv/va-pi-pixel-ar

Claude Code and agent skill by adu2021/skillxiv

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Align autoregressive image models with pixel-space quality via variational optimization. Formulates alignment as ELBO combining reconstruction (pixel supervision) and prior regularization (token distribution), treating model as RL policy with tokenizer reconstruction as reward—achieving 86.6% cost reduction vs standard RL fine-tuning.

Install

npx vskill@latest install adu2021/skillxiv/va-pi-pixel-ar

SKILL.md

The same SKILL.md was published earlier as majiayu000/claude-skill-registry-data/va-pi-pixel-ar.

Overview

VA-π addresses the token-to-pixel mismatch in autoregressive image generation through principled variational alignment, eliminating expensive standard RL fine-tuning.

Core Technique

Variational Alignment Formulation:

python
class VariationalAlignment:
def __init__(self, ar_model, tokenizer):
self.ar_model = ar_model
self.tokenizer = tokenizer
self.optimizer = torch.optim.Adam(ar_model.parameters())
def elbo_loss(self, images, prompts):
"""
Evidence Lower Bound combining pixel reconstruction and prior.
"""
# Sample tokens from AR model
z_sampled = self.ar_model.sample(prompts)
# Reconstruction term: pixel-space supervision
reconstructed = self.tokenizer.decode(z_sampled)
reconstruction_loss = mse(reconstructed, images)
# Prior term: preserve token distribution
z_prior = self.tokenizer.encode(images) # Ground truth
prior_loss = cross_entropy(z_sampled, z_prior)
# ELBO = reconstruction + prior
elbo = reconstruction_loss + 0.1 * prior_loss
return elbo

RL Formulation with Intrinsic Reward:

python
def pixel_quality_reward(tokens, images, tokenizer):
"""
Tokenizer reconstruction quality is RL reward signal.
"""
reconstructed = tokenizer.decode(tokens)
mse_error = mse(reconstructed, images)
reward = -mse_error # Negative MSE as reward
return reward
def policy_gradient_with_pixel_reward(ar_model, images, prompts):
"""
Treat AR model as RL policy, pixel quality as reward.
"""
tokens_sampled = ar_model.sample(prompts)
reward = pixel_quality_reward(tokens_sampled, images, tokenizer)
# Policy gradient
log_prob = ar_model.log_probability(tokens_sampled)
policy_loss = -reward * log_prob
return policy_loss

Computational Efficiency:

Standard RL fine-tuning: expensive per-episode rollouts
VA-π: 25 minutes on 1% ImageNet-1K
Cost reduction: 86.6% vs standard RL

When to Use

Use when: AR image generation, pixel quality important, training efficiency critical.

Performance

  • FID: 14.36 → 7.65
  • IS: 86.55 → 116.70
  • 86.6% cost reduction vs RL fine-tuning

References

  • Variational alignment with ELBO
  • Tokenizer reconstruction as reward
  • RL policy formulation for AR models

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
6
7-day trend score
15

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/adu2021/skillxiv/va-pi-pixel-ar/badge)](https://verified-skill.com/skills/adu2021/skillxiv/va-pi-pixel-ar)

Something wrong with this skill or its page? Tell us.