Skip to content
Back to skills

Bar Zeroth Order Optimizer

ASecurity

Train BAR universal-program parameters with query-only one-sided zeroth-order gradient estimates and SGD updates.

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
testingpythongo

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill bar_zeroth_order_optimizer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Bar Zeroth Order Optimizer?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Bar Zeroth Order Optimizer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-bar-zeroth-order-optimizer/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-bar-zeroth-order-optimizer)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
name: bar_zeroth_order_optimizer
description: Train BAR universal-program parameters with query-only one-sided zeroth-order gradient estimates and SGD updates.
---

# BAR Zeroth-order Optimizer

Use this skill when recovery must optimize adversarial-program parameters against a black-box classifier that exposes only prediction outputs. It is the core BAR training loop from the paper.

Do not use it when white-box gradients are available and the goal is ordinary fine-tuning.

## Inputs

- Black-box prediction callable that accepts programmed samples and returns source probabilities.
- Embedded target samples, labels, mask, and initial program parameters.
- Label mapping from source to target classes.
- Focal-loss parameters, smoothing `beta`, random-vector count `q`, learning rate, iterations, and seed.

## Outputs

- Updated parameters `W`.
- Loss before and after optimization.
- Prediction/accuracy trace.
- Query count and evidence that an optimizer step changed parameters.

## Workflow

1. Evaluate focal loss at current parameters.
2. Draw `q` normalized random directions with a fixed seed when reproducibility matters.
3. Evaluate perturbed losses at `W + beta*U_j` using black-box calls only.
4. Average one-sided gradient estimates and update `W` by SGD.
5. Log losses, query counts, and parameters before/after.

## Validation

Run `python tests/test_bar_optimizer.py` or `validate_skill_tree.py --run-tests`.

## Limitations

This skill can run a reduced deterministic proxy. Full paper-scale results require real source models and target datasets supplied by the caller.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…